air_sdk.types

View as Markdown

Attributes

Classes

NameDescription
SimStateSimulation state constants.
InstructionExportChoiceWhich instructions to include when exporting a simulation.
DockerRunTmpfsParameterDocker tmpfs mount configuration.
DockerRunParametersDocker run parameters for simulator containers.
ResourcesResource overhead for a simulator/platform.
PlatformEmulated platform configuration.
EmulationParamsEmulation parameters for a simulator/platform.
NodeAssignmentDataV2v2 bulk assignment payload format.
NodeAssignmentDataV3v3 bulk assignment payload format.
NodeResetPayloadPayload for resetting a node.
NodeRebuildPayloadPayload for rebuilding a node.
NodeManagementInterfaceInfoPer-interface management address info returned by the Node API.
ResourceBudgetUsageCurrent resource usage within an organization’s budget.
OSImageManifestPlatformPer-model platform information and OS template pins.
OSImageCapabilitiesOS image capability flags; key presence means supported.
_OSImageManifestSpecRequiredRequired fields for OSImageManifestSpec.
OSImageManifestSpecOS image manifest payload for api.images.upload() (no image).
HistoryEntryA single history entry from a resource’s nested history endpoint.
HistoryFiltersDistinct history filter values available for a single resource.
SimRequiredResourcesRequired resources for a simulation.

Functions

NameDescription
is_typeddict(→ bool)None
union_args_are_optional(→ bool)None
is_union(→ bool)None
is_optional_union(→ bool)None
get_optional_arg(→ Type[T])None
get_list_arg(→ Type[T])None
is_typed_dict(→ bool)Determine if the expected_type provided is a subclass of TypedDict.
type_check_typed_dict(→ bool)Perform type checking when the expected_type is a subclass of TypedDict.
_evaluate_forward_ref(→ Any)Resolve a ForwardRef in a way that works across Python versions.
type_check(→ bool)Recursively check if the value matches the expected type.

Module Contents

T = TypeVar(...)
class air_sdk.types.SimState

Bases: str, enum.Enum

Simulation state constants.

Use these instead of raw strings for type safety and IDE autocomplete.

Example:

>>> from air_sdk import SimState
>>> while sim.state != SimState.ACTIVE:
... sleep(5)
... sim.refresh()
CLONING = CLONING
CREATING = CREATING
IMPORTING = IMPORTING
INVALID = INVALID
INACTIVE = INACTIVE
REQUESTING = REQUESTING
PROVISIONING = PROVISIONING
PREPARE_BOOT = PREPARE_BOOT
BOOTING = BOOTING
ACTIVE = ACTIVE
PREPARE_SHUTDOWN = PREPARE_SHUTDOWN
SHUTTING_DOWN = SHUTTING_DOWN
SAVING = SAVING
PREPARE_TEARDOWN = PREPARE_TEARDOWN
TEARING_DOWN = TEARING_DOWN
DELETING = DELETING
PREPARE_PURGE = PREPARE_PURGE
PURGING = PURGING
DEMO = DEMO
TRAINING = TRAINING
PREPARE_REBUILD = PREPARE_REBUILD
REBUILDING = REBUILDING
class air_sdk.types.InstructionExportChoice

Bases: str, enum.Enum

Which instructions to include when exporting a simulation.

Passed as the include_instructions parameter to export. Use these instead of raw strings for type safety and IDE autocomplete. The name matches the air-api InstructionExportChoice constant.

Example:

>>> from air_sdk import InstructionExportChoice
>>> choice = InstructionExportChoice.REPEATABLE
>>> export_data = sim.export(include_instructions=choice)
NONE = NONE
REPEATABLE = REPEATABLE
REPEATABLE_OR_NOT_READY = REPEATABLE_OR_NOT_READY
DEMO_SIMULATION_STATE: TypeAlias
PAR_STATUS: TypeAlias
class air_sdk.types.DockerRunTmpfsParameter

Bases: typing.TypedDict

Docker tmpfs mount configuration.

path: str
size_gb: int
class air_sdk.types.DockerRunParameters

Bases: typing.TypedDict

Docker run parameters for simulator containers.

cap_add: list[str]
devices: list[str]
volumes: list[str]
environment: dict[str, str]
class air_sdk.types.Resources

Bases: typing.TypedDict

Resource overhead for a simulator/platform.

cpu: int
memory: int
class air_sdk.types.Platform

Bases: typing.TypedDict

Emulated platform configuration.

cpu: int
memory: int
default_port_type: str
default_port_count: int
port_count_options: list[int]
class air_sdk.types.EmulationParams

Bases: typing.TypedDict

Emulation parameters for a simulator/platform.

direct_link_emulation: bool
max_network_pci: int
UserConfigType
class air_sdk.types.NodeAssignmentDataV2

Bases: typing.TypedDict

v2 bulk assignment payload format.

simulation_node: Union[Node, PrimaryKey]
user_data: UserConfigType
meta_data: UserConfigType
class air_sdk.types.NodeAssignmentDataV3

Bases: typing.TypedDict

v3 bulk assignment payload format.

node: Node | PrimaryKey
user_data: UserConfig | PrimaryKey | None
meta_data: UserConfig | PrimaryKey | None
class air_sdk.types.NodeResetPayload

Bases: typing.TypedDict

Payload for resetting a node.

id: Node | PrimaryKey
class air_sdk.types.NodeRebuildPayload

Bases: typing.TypedDict

Payload for rebuilding a node.

id: Node | PrimaryKey
class air_sdk.types.NodeManagementInterfaceInfo

Bases: typing.TypedDict

Per-interface management address info returned by the Node API.

ip may be None when the interface opts out of OOB-managed DHCP while remaining wired to the leaf switch.

ip: str | None
mac_address: str | None
class air_sdk.types.ResourceBudgetUsage

Bases: typing.TypedDict

Current resource usage within an organization’s budget.

cpu: float

Number of CPU cores currently in use

memory: float

Memory currently in use, in MiB

disk_storage: float

Disk storage currently in use, in GB

image_storage: int

Image storage currently in use, in GB

userconfigs: int

User configs content currently in use, in bytes

class air_sdk.types.OSImageManifestPlatform

Bases: typing.TypedDict

Per-model platform information and OS template pins.

platform_information_version: str | None
os_template_version: str | None
class air_sdk.types.OSImageCapabilities

Bases: typing.TypedDict

OS image capability flags; key presence means supported.

vsock: dict[str, Any]
class air_sdk.types._OSImageManifestSpecRequired

Bases: typing.TypedDict

Required fields for OSImageManifestSpec.

os_type: str
class air_sdk.types.OSImageManifestSpec

Bases: air_sdk.types._OSImageManifestSpecRequired

OS image manifest payload for api.images.upload() (no image).

capabilities: OSImageCapabilities
os_template_partition: str | None
class air_sdk.types.HistoryEntry

Bases: typing.TypedDict

A single history entry from a resource’s nested history endpoint.

Read-only and immutable - returned by list_history() on simulations, images, and marketplace demos. This is distinct from the legacy History model returned by the deprecated flat histories endpoint.

object_id: str

ID of the entity this entry is about (e.g. a simulation ID)

model: str

Type of entity being tracked (e.g. ‘simulation’)

When the entry was recorded

actor: str

Email or identifier of the user who performed the action

description: str

Human-readable description of what happened

severity: str

Event severity. Values: ‘INFO’, ‘ERROR’

labels: list[str]

Backend-assigned labels (e.g. ‘publishing’), used for filtering

class air_sdk.types.HistoryFilters

Bases: typing.TypedDict

Distinct history filter values available for a single resource.

Returned by the nested history-filters endpoint on a resource (e.g. a simulation, image, or marketplace demo). The values span all of that resource’s history and are intended to populate filter dropdowns.

actors: list[str]

Distinct actor values present on the resource’s history entries

severities: list[str]

Distinct severity values (e.g. ‘INFO’, ‘ERROR’)

labels: list[str]

Distinct label values (e.g. ‘publishing’)

class air_sdk.types.SimRequiredResources

Bases: typing.TypedDict

Required resources for a simulation.

cpu: int | float
memory: int | float
storage: int | float
compute_hours: float
air_sdk.types.is_typeddict(type_: Type[Any]) -> bool
air_sdk.types.union_args_are_optional(args: Tuple[Union[Any, Any], ...]) -> bool
air_sdk.types.is_union(type_: Type[Any]) -> bool
air_sdk.types.is_optional_union(type_: Type[Any]) -> bool
air_sdk.types.get_optional_arg(optional_type: Type[T | None]) -> Type[T]
air_sdk.types.get_list_arg(list_type: Type[List[T]]) -> Type[T]
air_sdk.types.is_typed_dict(expected_type: Type[Any]) -> bool

Determine if the expected_type provided is a subclass of TypedDict.

air_sdk.types.type_check_typed_dict(
value: Any,
expected_type: Type[Any]
) -> bool

Perform type checking when the expected_type is a subclass of TypedDict.

This currently does not work if the expected_type is also a dataclass.

_FORWARD_REF_EVALUATE_HAS_TYPE_PARAMS
air_sdk.types._evaluate_forward_ref(ref: ForwardRef) -> Any

Resolve a ForwardRef in a way that works across Python versions.

Passing recursive_guard positionally (as older code did) raises TypeError on Python 3.13, which surfaces to users as a spurious UserWarning and silently skips type validation. Pass it by keyword (valid on 3.10-3.13) and supply type_params only when the running interpreter expects it (see _FORWARD_REF_EVALUATE_HAS_TYPE_PARAMS).

air_sdk.types.type_check(
value: Any,
expected_type: Type[Any]
) -> bool

Recursively check if the value matches the expected type.