Stellar ControlMission control · by Stellar Systems v0.1.0

API Guide

Error Codes

The error body of the API and the complete list of its stable error codes.

Every error of the API answers an HTTP status and a body listing the errors found. A request that does not resolve reports all its errors at once (every missing input, every invalid argument), not the first one only.

JSON
{
  "errors": [
    {
      "code": "tc::missing-instance",
      "message": "component `tcu` has several instances",
      "help": "give one of: TCU1, TCU2, TCU3"
    },
    {
      "code": "tc::unexpected-argument",
      "message": "telecommand `ping` has no argument `voltage`"
    }
  ]
}
FieldContent
codeStable identifier, <domain>::<name>. Clients match on it, never on the message.
messageExplanation for the operator, naming what is wrong.
helpOptional suggested fix.

The same codes appear in the CLI, which prints the messages of the API. The status gives the family:

StatusMeaning
400The request itself is malformed: body, identifier, selector, missing operator identity for a command
401Identity refused or required by the environment
403Identified, but not allowed: not a feeder, not a supervisor
404Unknown route, target, run, pass, schedule, transfer, instance, or invalid path parameter
409Refused by the current state: target held by a run (telecommand or mode), pass not usable, run not running, alarm command refused, schedule already final
413Content too large
422The request does not resolve against the configuration, or breaks a policy
502, 503, 504A service behind the API is missing, unreachable or did not answer

API#

CodeStatusMeaning
api::unknown-route404No such route in this version of the API
api::invalid-body400The body is not valid JSON of the expected shape (unknown field, wrong type)
api::invalid-id400 / 404Not a ULID: 400 for the id of a submission, 404 for a path parameter
api::invalid-target404The target in the path is not a valid name
api::invalid-alarm404Not an alarm such as tcu[TCU1].anode_voltage
api::invalid-measure400Not a measure selector such as tcu[TCU1].responding
api::invalid-instance404The instance in the path is not a valid name
api::unknown-target404No such target in the current configuration
api::unknown-environment422GET /v1/targets/{target}/parameters?environment=…: the target is not engaged in that environment
api::unknown-instance404No such registered instance
api::unknown-command404Not a command of the route (suspend, resume, abort; acknowledge, shelve, unshelve)
api::anonymous400 / 401No identity: 400 for a command that needs the name of the operator, 401 where the environment requires one
api::no-configuration503No compiled configuration published yet (stellar compile --publish)
api::no-catalogue503The catalogue of the target is missing from the current snapshot
api::unavailable503The bus (NATS, JetStream) is unavailable

Identity#

CodeStatusMeaning
auth::invalid-token401The bearer token is refused: signature, expiry, issuer, audience or subject
auth::no-provider401A token was given but no identity provider is configured (auth.jwks_url, auth.jwks_file)
auth::token-required401auth.required: every request needs an OIDC token, declared identities are refused
auth::jwt-required401The environment requires an OIDC token (identity: jwt): declared identities are refused; also for POST /v1/auth/nats
auth::invalid-key400public_key is not the public nkey of a user
auth::no-signing-key503The API has no account signing key to issue NATS credentials

Telecommands#

POST /v1/tc and POST /v1/targets/{target}/files/refresh resolve the telecommand against the current configuration. An unknown target answers 404; every other resolution error 422.

CodeStatusMeaning
tc::unknown-target404No such target
tc::missing-catalogue422The catalogue of the target is not in the snapshot
tc::unknown-link422The target has no such link
tc::unknown-environment422The target is not engaged in that environment
tc::environment-required422The link has parameters by environment and the target is engaged in several: name the environment
tc::link-component422The link does not carry the component of the telecommand
tc::unknown-telecommand422The platform has no such telecommand
tc::ambiguous-telecommand422Several components have a telecommand of that name: write component.name
tc::missing-instance422The component has several instances: give one
tc::unexpected-instance422The component has a single instance
tc::unknown-instance422The component has no such instance
tc::unexpected-argument422The telecommand has no such argument
tc::missing-argument422An argument has no value and no default
tc::invalid-argument422Wrong type, unit or enum value
tc::out-of-range422The value is outside the range of the argument
tc::target-held409The target is held by a run: direct telecommands wait for its end (a changes_state: false telecommand passes a shared lease)

Runs#

POST /v1/runs resolves the run request (422 with every error), then checks the passes (409).

CodeStatusMeaning
run::unknown-environment422No such environment
run::unknown-library422No such library
run::unknown-procedure422No such procedure
run::ambiguous-procedure422Several libraries have a procedure of that name: give library
run::not-allowed422The procedure is not allowed in the environment (allowed in)
run::draft-not-allowed422A draft library or catalogue, refused where allow_draft is off
run::unexpected-target422The procedure has no such role
run::missing-target422A role has no target
run::unknown-target422No such target, or its catalogue is not in the snapshot
run::wrong-platform422The target does not implement the platform of its role, nor imports components of it
run::catalogue-version422The target implements (or imports) another version of the catalogue than the one the library was compiled against
run::not-imported422The procedure uses a component of the package of its role that the platform of the target does not import
run::target-not-in-environment422The target is not engaged in the environment
run::unexpected-input422The procedure has no such input
run::missing-input422An input has no value
run::invalid-input422Invalid value for an input (type, unit, enum)
run::unknown-link422A link named by via or link[…] does not exist on the target
run::fault-target, run::fault-step, run::fault-not-simulated422A scheduled fault (faults) names no role of the run, or a step it never enters, or is requested in in_orbit
run::link-component422A telecommand goes through a link that does not carry its component
run::plan-required422The procedure sends a hazardous telecommand: in this environment it must be planned on a pass
run::must-be-scheduled422Such a run starts from a schedule only (POST /v1/schedules)
run::parameter-undefined422A configure … for <mode> or param … in <mode> reads a parameter that has no value on the target in that mode
run::unknown-pass422plan names no pass of a target of the run
run::pass-cancelled409The pass is cancelled
run::not-booked409In in_orbit, only a booked pass carries a run
run::before-aos409The pass has not started yet
run::window409The run may end after LOS minus scheduler.margin
run::receive-only409The pass has no uplink and the run sends telecommands
run::no-link409In in_orbit, a manual run needs the default link of each target bound and available
run::unknown404No such run
run::not-running409No executor holds the run: it is over, or not started
run::refused409The executor refused the command (for instance, resuming without leases or ready targets)
run::timeout504The executor did not answer

Modes#

PUT /v1/targets/{target}/mode declares the mode of a target; see Modes and Parameters.

CodeStatusMeaning
mode::unknown422The topology declares no such mode
mode::target-held409A run holds the target: its runs set its mode

api::anonymous (400) answers a PUT without the identity of the operator, api::unknown-target (404) an unknown target.

Alarms#

CodeStatusMeaning
alarm::refused409Nothing to acknowledge, alarm not shelved or never recorded, shelving duration out of bounds
alarm::no-service503No alarm service is running
alarm::timeout504The alarm service did not answer

Passes#

CodeStatusMeaning
pass::not-a-feeder403The caller is not a feeder of passes.feeders
pass::forbidden-source403The feeder writes the passes of another source
pass::invalid422Invalid body or pass: window, elevation, rates, a fds pass booked…
pass::unknown-target422No such target in the current configuration
pass::unknown404No such pass

Schedules#

CodeStatusMeaning
schedule::invalid422Invalid body of a schedule or a rule
schedule::refused422Refused: it would not be scheduled (window, booking, uplink, start in the past), its request does not resolve, or a rule runs a hazardous telecommand
schedule::unknown404No such schedule
schedule::unknown-rule404No such rule
schedule::final409The schedule is already fired, missed or cancelled
schedule::changed409The schedule changed meanwhile: try again
schedule::not-supervisor403Only a supervisor validates a plan

Files and transfers#

CodeStatusMeaning
files::no-directory404 / 422The platform of the target has no on-board directory (files component)
files::no-listing422The platform declares no listing telecommand (transfer.list)
transfer::invalid422Invalid transfer request
transfer::not-listed422The file was never listed: refresh the directory first
transfer::unknown404No such transfer

Simulation and editor#

CodeStatusMeaning
sim::unknown-gateway404No simulated gateway of that name answers
sim::not-simulated422The gateway is not a simulated one
sim::refused422The simulator refused: unknown fault…
sim::timeout504The gateway did not answer
editor::disabled404No editor service behind this API (api.editor_url)
editor::too-large413Request too large for the editor
editor::unreachable502The editor service does not answer

Stellar Control · v0.1.0

↑↓ to moveEnter to open