Commands Utilities¶
This page specifies command handling helpers from inorbit_connector.commands.
CommandResultCode / CommandFailure¶
CommandResultCodeis an enum withSUCCESSandFAILURE.CommandFailureis an exception that carries:execution_status_details: a user-visible failure summarystderr: a more detailed error payload
When CommandFailure is raised inside a command handler, the framework converts it into a failure result via the provided options["result_function"].
parse_custom_command_args(custom_command_args) -> (script_name, params)¶
Parses arguments for a COMMAND_CUSTOM_COMMAND/RunScript-style payload.
Input assumptions:
custom_command_args[0]is a script name (string).custom_command_args[1]is a list-like container with alternatingkey, value, key, value, ....
Output:
script_name: stringparams: dictionary of parsed key/value pairs (last value wins on duplicate keys)
Raises:
ValueErrorwhen the outer container does not match the expected types/shapes.CommandFailurewhen the arguments list is not pairs (odd length).
CommandModel / ExcludeUnsetMixin¶
These classes support type-safe parsing and validation of structured command parameters.
CommandModelis a PydanticBaseModelconfigured withextra="forbid", and convertsValidationErrorintoCommandFailure.ExcludeUnsetMixinchangesmodel_dump()default behavior toexclude_unset=True(useful when you want to emit only explicitly-provided fields).
See Commands Handling for end-to-end usage patterns.
Note: re-exports via inorbit_connector.connector¶
For backwards compatibility, the connector module re-exports:
CommandFailureCommandResultCodeparse_custom_command_args
New code may import from either module, but the canonical definitions live in inorbit_connector.commands.