air_sdk.endpoints.nodes
air_sdk.endpoints.nodes
Stub file for simulations endpoint type hints.
Classes
Module Contents
Bases: typing.TypedDict
Node attributes for topology organization.
Bases: typing.TypedDict
Advanced node configuration options.
Bases: typing.TypedDict
CD-ROM configuration for a node.
Bases: typing.TypedDict
Represents a single storage PCI drive configuration.
Used in storage_pci as: dict[str, StoragePCIField] where keys are dynamic drive names like “drive1”, “drive2”, etc.
Bases: typing.TypedDict
Response payload for cloud-init assignment.
Bases: air_sdk.air_model.AirModel
Node model representing a network node.
Unique identifier for the node
Timestamp when the node was created
Timestamp when the node was last modified
Human-readable name of the node
Current state of the node
Category of the node
Status of the node from the worker
Split options for the node
CPU of the node
Memory of the node
Storage of the node
X position of the node
Y position of the node
Attributes of the node
Custom metadata for the node (JSON string)
Advanced attributes of the node
CDROM attributes of the node
Storage PCI attributes of the node
IPv4 address of the management interface (read-only)
MAC address of the management interface
Update the node’s properties.
Parameters:
name– Name of the nodeimage– Image of the nodecpu– CPU of the nodememory– Memory of the nodestorage– Storage of the nodepos_x– X position of the nodepos_y– Y position of the nodemanagement_mac– MAC address of the management interfaceattributes– Attributes of the nodemetadata– Custom metadata for the node (JSON string)advanced– Advanced attributes of the nodestorage_pci– Storage PCI of the node
Example:
Clear cloud-init assignment for this node (V3).
Removes any user_data and meta_data cloud-init configurations from this node.
Example:
Access the instructions endpoint for this node.
Returns:
NodeInstructionEndpointAPI instance scoped to this node
Example:
Access the interfaces endpoint for this node.
Returns:
InterfaceEndpointAPI instance scoped to this node
Example:
Query for the related services of the node.
Returns:
ServiceEndpointAPI instance filtered for this node’s services
Example:
Create service by resolving interface name (v3 convenience).
Parameters:
interface_name– Interface name on this node (e.g., ‘eth0’, ‘swp1’)node_port– Port number on the node/interfacename– Service nameservice_type– Service type - ‘SSH’, ‘HTTPS’, ‘HTTP’, or ‘OTHER’
Returns:
Service object
Raises:
ValueError– If interface not found on this node
Example:
Delete all node instructions for this node.
Example:
Cloud-Init assignments of the node
Get the cloud-init assignment for this node.
Returns:
CloudInit object containing user_data and meta_data assignments
Example:
Reset this node.
Resetting the node emulates the hardware reset button on physical machines where the machine is immediately restarted without a clean shutdown of the operating system. For nodes that are not currently running, this means simply booting them back up.
Example:
Rebuild this node.
Rebuilding a node means returning the node to the state of its simulation’s current checkpoint. When rebuilding from the initial state, all repeatable instructions for this node will be applied. All existing instructions created for this node which have not yet been completed will be failed. All existing instructions created for this node which have not yet been delivered will be cancelled.
Example:
Bases: air_sdk.air_model.BaseEndpointAPI[air_sdk.endpoints.nodes.Node]
API client for simulation endpoints.
Create a new node.
Parameters:
name– Name of the nodesimulation– Simulation of the nodeimage– Image of the nodecpu– (optional) CPU of the nodememory– (optional) Memory of the nodestorage– (optional) Storage of the nodepos_x– (optional) X position of the nodepos_y– (optional) Y position of the nodeattributes– (optional) Attributes of the nodeadvanced– (optional) Advanced attributes of the nodestorage_pci– (optional) Storage PCI of the nodemanagement_mac– (optional) MAC address of the management interface
Example:
Returns:
The created node instance
List all nodes.
Parameters:
limit– (optional) Limit the number of nodes returnedoffset– (optional) Offset the number of nodes returnedordering– (optional) Order the nodes by a fieldsearch– (optional) Search for nodes by a keyword
Returns:
Iterator of Node instances
Example:
Get a specific node by ID.
Parameters:
pk– The node ID (string or UUID)
Returns:
The Node instance
Example:
Delete a specific node by ID.
Parameters:
pk– The node ID (string or UUID)
Example:
Update a specific node by ID.
Parameters:
node– The node to update (Node object or ID)name– Name of the nodeimage– Image of the node (image object or ID)cpu– CPU of the nodememory– Memory of the nodestorage– Storage of the nodepos_x– X position of the nodepos_y– Y position of the nodeattributes– Attributes of the nodeadvanced– Advanced attributes of the nodestorage_pci– Storage PCI of the nodemanagement_mac– MAC address of the management interface
Example:
Patch a specific node by ID.
Parameters:
pk– The node ID (string or UUID)name– Name of the nodeimage– Image of the nodecpu– CPU of the nodememory– Memory of the nodestorage– Storage of the nodepos_x– X position of the nodepos_y– Y position of the nodeattributes– Attributes of the nodeadvanced– Advanced attributes of the nodestorage_pci– Storage PCI of the nodemetadata– Custom metadata for the node (JSON string)management_mac– MAC address of the management interface
Returns:
The patched Node object
Example:
Create a node from a system node template.
Parameters:
system_node– System node template ID to create fromname– Name of the new nodesimulation– Simulation object or ID where the node will be createdimage– Optional image to use (overrides template)cpu– Optional CPU count (overrides template)memory– Optional memory in MB (overrides template)storage– Optional storage in GB (overrides template)pos_x– Optional X position on canvaspos_y– Optional Y position on canvasattributes– Optional node attributesmetadata– Optional custom metadata for the node (JSON string)advanced– Optional advanced configurationstorage_pci– Optional storage PCI configurationmanagement_mac– Optional MAC address of the management interface**kwargs– Additional parameters
Returns:
The created Node object
Example:
List all available system nodes.
Parameters:
limit– (optional) Limit the number of system nodes returnedoffset– (optional) Offset the number of system nodes returnedordering– (optional) Order the system nodes by a fieldsearch– (optional) Search for system nodes by a keywordsimulation– (optional) Filter system nodes by simulation
Returns:
List of System objects that can be used to create nodes.
Example:
Reset a node.
Resetting the node emulates the hardware reset button on physical machines where the machine is immediately restarted without a clean shutdown of the operating system. For nodes that are not currently running, this means simply booting them back up.
Parameters:
node– The node object or node ID to reset
Example:
Rebuild a node.
Rebuilding a node means returning the node to the state of its simulation’s current checkpoint. When rebuilding from the initial state, all repeatable instructions for the node will be applied. All existing instructions created for the node which have not yet been completed will be failed. All existing instructions created for the node which have not yet been delivered will be cancelled.
Parameters:
node– The node object or node ID to rebuild
Example: