air_sdk.endpoints.node_instructions
air_sdk.endpoints.node_instructions
Stub file for node instructions endpoint type hints.
Classes
Module Contents
Bases: typing.TypedDict
Data structure for shell executor type (input for create).
Bases: typing.TypedDict
Required fields for FileData.
Bases: air_sdk.endpoints.node_instructions._FileDataRequired
Data structure for file executor type (input for create).
Required: files - List of file dicts, each with ‘path’ and ‘content’ keys. Optional: post_commands - Shell commands to run after creating files.
Bases: typing.TypedDict
Data structure for init executor type (input for create).
Bases: air_sdk.endpoints.node_instructions.ShellData
Data structure for shell executor type (returned from API).
Bases: air_sdk.endpoints.node_instructions._FileDataRequired
Data structure for file executor type (returned from API).
Required: files - List of file dicts, each with ‘path’ and ‘content’ keys. Optional: post_commands - Shell commands to run after creating files. Optional: executor - Executor type (added by API).
Bases: air_sdk.endpoints.node_instructions.InitData
Data structure for init executor type (returned from API).
Bases: air_sdk.air_model.AirModel
Node instruction model representing an automation instruction for a node.
Node instructions are commands or automation scripts that can be executed on simulation nodes. They support various executors and can be configured to run again on rebuild.
Unique identifier for the node instruction
Human-readable name of the node instruction
Node this instruction belongs to
Instruction data (ShellData, FileData, or InitData)
Timestamp when the node instruction was created
Timestamp when the node instruction was last modified
Execution state (e.g., ‘pending’, ‘running’, ‘completed’, ‘failed’)
Whether to re-run this instruction on simulation rebuild
Update the node instruction’s properties.
Parameters:
name– New name for the node instructionrun_again_on_rebuild– Whether to re-run the instruction on simulation rebuild
Example:
Delete this instruction.
Example:
Bases: air_sdk.air_model.BaseEndpointAPI[air_sdk.endpoints.node_instructions.NodeInstruction]
API client for node instructions endpoints.
Create a new node instruction.
Parameters:
node– Node object or ID to execute the instruction onname– Name for the instructionexecutor– Type of executor (‘shell’, ‘init’, ‘file’)data– Instruction data/payload (executor-specific): ShellData - For ‘shell’ executor Contains: ‘commands’ (list of shell commands) FileData - For ‘file’ executor Contains: ‘files’ (list of dicts with ‘path’ and ‘content’) Optional: ‘post_commands’ (shell commands to run after creating files) InitData - For ‘init’ executor Contains: ‘hostname’ (hostname to set for the node)run_again_on_rebuild– Optional whether to run instruction again on rebuild
Returns:
The created NodeInstruction instance
Example:
List all node instructions.
Parameters:
created_by_client– Filter by created by clientexecutor– Filter by executor (‘shell’, ‘init’, ‘file’)name– Filter by namenode– Filter by noderun_again_on_rebuild– Filter by run_again_on_rebuildsimulation– Filter by simulationstate– Filter by statesearch– Search by nameordering– Order by fieldlimit– Limit the number of resultsoffset– Offset the results
Returns:
Iterator of NodeInstruction instances
Example:
Get a specific node instruction by ID.
Parameters:
pk– The node instruction ID (string or UUID)
Returns:
The NodeInstruction instance
Example:
Partially update a node instruction.
Parameters:
pk– The node instruction IDname– New name for the instructionrun_again_on_rebuild– Whether to run again on rebuild
Returns:
The updated NodeInstruction instance
Example:
Delete a node instruction.
Parameters:
pk– The node instruction ID
Example: