air_sdk.endpoints.nodes#

Stub file for simulations endpoint type hints.

Classes#

NodeAttributes

Node attributes for topology organization.

NodeAdvanced

Advanced node configuration options.

NodeCDROM

CD-ROM configuration for a node.

StoragePCIField

Represents a single storage PCI drive configuration.

CloudInitAssignment

Response payload for cloud-init assignment.

Node

Node model representing a network node.

NodeEndpointAPI

API client for simulation endpoints.

Module Contents#

class air_sdk.endpoints.nodes.NodeAttributes#

Bases: TypedDict

Node attributes for topology organization.

group: str | None#
model: str | None#
sku: str | None#
rack_name: str | None#
rack_unit: int | None#
scalable_unit: int | None#
rail_index: int | None#
data_hall: str | None#
tray_index: int | None#
role: str | None#
pod: int | None#
superspine_group: int | None#
plane_id: int | None#
class air_sdk.endpoints.nodes.NodeAdvanced#

Bases: TypedDict

Advanced node configuration options.

secureboot: bool | None#
uefi: bool | None#
tpm: bool | None#
cpu_options: Literal['ssse3', 'sse4.1', 'sse4.2', 'popcnt'] | None#
cpu_mode: Literal['custom', 'host-model', 'host-passthrough']#
boot: Literal['hd', 'network']#
nic_model: Literal['virtio', 'e1000']#
class air_sdk.endpoints.nodes.NodeCDROM#

Bases: TypedDict

CD-ROM configuration for a node.

image: air_sdk.endpoints.images.Image | None#
class air_sdk.endpoints.nodes.StoragePCIField#

Bases: 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.

name: str | None#
size: int | None#
type: Literal['NVME'] | None#
class air_sdk.endpoints.nodes.CloudInitAssignment#

Bases: TypedDict

Response payload for cloud-init assignment.

user_data: air_sdk.endpoints.UserConfig | None#
meta_data: air_sdk.endpoints.UserConfig | None#
class air_sdk.endpoints.nodes.Node[source]#

Bases: air_sdk.air_model.AirModel

Node model representing a network node.

id#

Unique identifier for the node

name#

Human-readable name of the node

created#

Timestamp when the node was created

modified#

Timestamp when the node was last modified

state#

Current state of the node

category#

Category of the node

status_from_worker#

Status of the node from the worker

split_options#

Split options for the node

cpu#

CPU of the node

memory#

Memory of the node

storage#

Storage of the node

pos_x#

X position of the node

pos_y#

Y position of the node

attributes#

Attributes of the node

advanced#

Advanced attributes of the node

cdrom#

CDROM attributes of the node

storage_pci#

Storage PCI attributes of the node

cloud_init#

Cloud-Init assignments of the node

id: str#
created: datetime.datetime#
modified: datetime.datetime#
name: str#
simulation: air_sdk.endpoints.simulations.Simulation#
image: air_sdk.endpoints.images.Image#
state: str#
category: str#
status_from_worker: str#
split_options: list[int] | None#
cpu: int#
memory: int#
storage: int#
pos_x: int#
pos_y: int#
attributes: NodeAttributes | None#
advanced: NodeAdvanced#
cdrom: NodeCDROM | None#
storage_pci: dict[str, StoragePCIField] | None#
classmethod get_model_api() type[NodeEndpointAPI][source]#

Returns the respective AirModelAPI type for this model.

property model_api: NodeEndpointAPI#
update(
*,
name: str | dataclasses._MISSING_TYPE = ...,
image: air_sdk.endpoints.images.Image | dataclasses._MISSING_TYPE = ...,
cpu: int | dataclasses._MISSING_TYPE = ...,
memory: int | dataclasses._MISSING_TYPE = ...,
storage: int | dataclasses._MISSING_TYPE = ...,
pos_x: int | dataclasses._MISSING_TYPE = ...,
pos_y: int | dataclasses._MISSING_TYPE = ...,
attributes: dict[str, Any] | dataclasses._MISSING_TYPE = ...,
advanced: dict[str, Any] | dataclasses._MISSING_TYPE = ...,
storage_pci: dict[str, Any] | dataclasses._MISSING_TYPE = ...,
) None#

Update the node’s properties.

Parameters:
  • name – Name of the node

  • image – Image of the node

  • cpu – CPU of the node

  • memory – Memory of the node

  • storage – Storage of the node

  • pos_x – X position of the node

  • pos_y – Y position of the node

  • attributes – Attributes of the node

  • advanced – Advanced attributes of the node

  • storage_pci – Storage PCI of the node

Example

>>> node = api.nodes.update(
...     name='my-node',
...     image=image,
...     cpu=1,
...     memory=1024,
...     storage=10,
...     pos_x=0,
...     pos_y=0,
...     attributes={'key': 'value'},
...     advanced={'key': 'value'},
...     storage_pci={'key': 'value'},
... )
clear_cloud_init_assignment(**kwargs: Any) None#

Clear cloud-init assignment for this node (V3).

Removes any user_data and meta_data cloud-init configurations from this node.

Example

>>> node.clear_cloud_init_assignment()
property instructions: Any#

Access the instructions endpoint for this node.

Returns:

Any instance scoped to this node

Example

>>> node = api.nodes.instructions.list()
property interfaces: air_sdk.endpoints.interfaces.InterfaceEndpointAPI#

Access the interfaces endpoint for this node.

Returns:

Any instance scoped to this node

Example

>>> for interface in node.interfaces.list():
...     print(interface.name)
property services: air_sdk.endpoints.services.ServiceEndpointAPI#

Query for the related services of the node.

Returns:

ServiceEndpointAPI instance filtered for this node’s services

Example

>>> for service in node.services.list():
...     print(f'{service.name}: {service.worker_fqdn}:{service.worker_port}')
>>>
>>> # Create service by interface ID
>>> service = node.services.create(
...     name='ssh-service',
...     interface='interface-id',
...     node_port=22,
...     service_type='SSH'
... )
create_service(
*,
interface_name: str,
node_port: int,
name: str = ...,
service_type: Literal['SSH', 'HTTPS', 'HTTP', 'OTHER'] = ...,
) air_sdk.endpoints.services.Service[source]#

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/interface

  • name – Service name

  • service_type – Service type - ‘SSH’, ‘HTTPS’, ‘HTTP’, or ‘OTHER’

Returns:

Service object

Raises:

ValueError – If interface not found on this node

Example

>>> service = node.create_service(
...     interface_name='eth0',
...     name='ssh-service',
...     node_port=22,
...     service_type='SSH',
... )
delete_all_node_instructions() None[source]#

Delete all node instructions for this node.

Example

>>> node = api.nodes.delete_all_node_instructions()
property cloud_init: air_sdk.bc.cloud_init.CloudInit#

Get the cloud-init assignment for this node.

Returns:

CloudInit object containing user_data and meta_data assignments

Example

>>> cloud_init = node.cloud_init
>>> print(cloud_init.user_data)
>>> print(cloud_init.meta_data)
reset() None[source]#

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

>>> node.reset()
rebuild() None[source]#

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

>>> node.rebuild()
class air_sdk.endpoints.nodes.NodeEndpointAPI(
api: air_sdk.AirApi,
default_filters: dict[str, Any] | None = None,
)[source]#

Bases: air_sdk.air_model.BaseEndpointAPI[Node]

API client for simulation endpoints.

API_PATH: str#
model: type[Node]#
create(
*,
name: str,
simulation: air_sdk.endpoints.simulations.Simulation,
image: air_sdk.endpoints.images.Image,
cpu: int | None = ...,
memory: int | None = ...,
storage: int | None = ...,
pos_x: int | None = ...,
pos_y: int | None = ...,
attributes: NodeAttributes | None = ...,
advanced: NodeAdvanced | None = ...,
storage_pci: dict[str, StoragePCIField] | None = ...,
) Node#

Create a new node.

Parameters:
  • name – Name of the node

  • simulation – Simulation of the node

  • image – Image of the node

  • cpu – (optional) CPU of the node

  • memory – (optional) Memory of the node

  • storage – (optional) Storage of the node

  • pos_x – (optional) X position of the node

  • pos_y – (optional) Y position of the node

  • attributes – (optional) Attributes of the node

  • advanced – (optional) Advanced attributes of the node

  • storage_pci – (optional) Storage PCI of the node

Returns:

The created node instance

Example

>>> node = api.nodes.create(simulation=sim, image=image, name='my-node')
list(
*,
limit: int | None = ...,
offset: int | None = ...,
ordering: str | None = ...,
search: str | None = ...,
**kwargs: Any,
) Iterator[Node]#

List all nodes.

Parameters:
  • limit – (optional) Limit the number of nodes returned

  • offset – (optional) Offset the number of nodes returned

  • ordering – (optional) Order the nodes by a field

  • search – (optional) Search for nodes by a keyword

Returns:

Iterator of Node instances

Example

>>> for node in api.nodes.list(ordering='name'):
...     print(node.name)
>>> for node in api.nodes.list(search='my-node'):
...     print(node.name)
>>> for node in api.nodes.list(ordering='-name'):
...     print(node.name)
get(pk: air_sdk.air_model.PrimaryKey) Node#

Get a specific node by ID.

Parameters:

pk – The node ID (string or UUID)

Returns:

The Node instance

Example

>>> node = api.nodes.get('node-id')
delete(pk: air_sdk.air_model.PrimaryKey) None#

Delete a specific node by ID.

Parameters:

pk – The node ID (string or UUID)

Example

>>> api.nodes.delete('node-id')
update(
*,
node: Node | air_sdk.air_model.PrimaryKey,
name: str | dataclasses._MISSING_TYPE = ...,
image: air_sdk.endpoints.images.Image | dataclasses._MISSING_TYPE = ...,
cpu: int | dataclasses._MISSING_TYPE = ...,
memory: int | dataclasses._MISSING_TYPE = ...,
storage: int | dataclasses._MISSING_TYPE = ...,
pos_x: int | dataclasses._MISSING_TYPE = ...,
pos_y: int | dataclasses._MISSING_TYPE = ...,
attributes: NodeAttributes | dataclasses._MISSING_TYPE = ...,
advanced: NodeAdvanced | dataclasses._MISSING_TYPE = ...,
storage_pci: dict[str, StoragePCIField] | None = ...,
) Node[source]#

Update a specific node by ID.

Parameters:
  • node – The node to update (Node object or ID)

  • name – Name of the node

  • image – Image of the node (image object or ID)

  • cpu – CPU of the node

  • memory – Memory of the node

  • storage – Storage of the node

  • pos_x – X position of the node

  • pos_y – Y position of the node

  • attributes – Attributes of the node

  • advanced – Advanced attributes of the node

  • storage_pci – Storage PCI of the node

Example

>>> node = api.nodes.update(node=node, name='my-node')
create_from_system_node(
system_node: air_sdk.endpoints.systems.System | air_sdk.air_model.PrimaryKey,
name: str,
simulation: air_sdk.endpoints.simulations.Simulation | air_sdk.air_model.PrimaryKey,
image: air_sdk.endpoints.images.Image | air_sdk.air_model.PrimaryKey | dataclasses._MISSING_TYPE = ...,
cpu: int | dataclasses._MISSING_TYPE = ...,
memory: int | dataclasses._MISSING_TYPE = ...,
storage: int | dataclasses._MISSING_TYPE = ...,
pos_x: int | dataclasses._MISSING_TYPE = ...,
pos_y: int | dataclasses._MISSING_TYPE = ...,
attributes: dict[str, Any] | dataclasses._MISSING_TYPE = ...,
advanced: dict[str, Any] | dataclasses._MISSING_TYPE = ...,
storage_pci: dict[str, StoragePCIField] | dataclasses._MISSING_TYPE = ...,
**kwargs: Any,
) Node[source]#

Create a node from a system node template.

Parameters:
  • system_node – System node template ID to create from

  • name – Name of the new node

  • simulation – Simulation object or ID where the node will be created

  • image – 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 canvas

  • pos_y – Optional Y position on canvas

  • attributes – Optional node attributes

  • advanced – Optional advanced configuration

  • storage_pci – Optional storage PCI configuration

  • **kwargs – Additional parameters

Returns:

The created Node object

Example

>>> node = api.nodes.from_system_node(
...     system_node='system-node-template-id',
...     name='my-node',
...     simulation='simulation-id'
... )
list_system_nodes(
**kwargs: Any,
) list[air_sdk.endpoints.systems.System][source]#

List all available system nodes.

Parameters:
  • limit – (optional) Limit the number of system nodes returned

  • offset – (optional) Offset the number of system nodes returned

  • ordering – (optional) Order the system nodes by a field

  • search – (optional) Search for system nodes by a keyword

  • simulation – (optional) Filter system nodes by simulation

Returns:

List of System objects that can be used to create nodes.

reset(*, node: Node | air_sdk.air_model.PrimaryKey) None[source]#

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

>>> # Reset using node object
>>> api.nodes.reset(node=node)
>>> # Reset using node ID
>>> api.nodes.reset(node='node-uuid-123')
rebuild(*, node: Node | air_sdk.air_model.PrimaryKey) None[source]#

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

>>> # Rebuild using node object
>>> api.nodes.rebuild(node=node)
>>> # Rebuild using node ID
>>> api.nodes.rebuild(node='node-uuid-123')