air_sdk.types#

Attributes#

Classes#

SimState

Simulation state constants.

DockerRunTmpfsParameter

Docker tmpfs mount configuration.

DockerRunParameters

Docker run parameters for simulator containers.

Resources

Resource overhead for a simulator/platform.

Platform

Emulated platform configuration.

EmulationParams

Emulation parameters for a simulator/platform.

NodeAssignmentDataV2

v2 bulk assignment payload format.

NodeAssignmentDataV3

v3 bulk assignment payload format.

NodeResetPayload

Payload for resetting a node.

NodeRebuildPayload

Payload for rebuilding a node.

ResourceBudgetUsage

Current resource usage within an organization's budget.

Functions#

is_typeddict(→ bool)

union_args_are_optional(→ bool)

is_union(→ bool)

is_optional_union(→ bool)

get_optional_arg(→ Type[T])

get_list_arg(→ Type[T])

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.

type_check(→ bool)

Recursively check if the value matches the expected type.

Module Contents#

air_sdk.types.T#
class air_sdk.types.SimState[source]#

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.DockerRunTmpfsParameter[source]#

Bases: TypedDict

Docker tmpfs mount configuration.

path: str#
size_gb: int#
class air_sdk.types.DockerRunParameters[source]#

Bases: TypedDict

Docker run parameters for simulator containers.

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

Bases: TypedDict

Resource overhead for a simulator/platform.

cpu: int#
memory: int#
class air_sdk.types.Platform[source]#

Bases: 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[source]#

Bases: TypedDict

Emulation parameters for a simulator/platform.

max_network_pci: int#
air_sdk.types.UserConfigType#
class air_sdk.types.NodeAssignmentDataV2[source]#

Bases: TypedDict

v2 bulk assignment payload format.

simulation_node: air_sdk.endpoints.nodes.Node | air_sdk.air_model.PrimaryKey#
user_data: UserConfigType#
meta_data: UserConfigType#
class air_sdk.types.NodeAssignmentDataV3[source]#

Bases: TypedDict

v3 bulk assignment payload format.

node: air_sdk.endpoints.nodes.Node | air_sdk.air_model.PrimaryKey#
user_data: air_sdk.endpoints.user_configs.UserConfig | air_sdk.air_model.PrimaryKey | None#
meta_data: air_sdk.endpoints.user_configs.UserConfig | air_sdk.air_model.PrimaryKey | None#
class air_sdk.types.NodeResetPayload[source]#

Bases: TypedDict

Payload for resetting a node.

id: air_sdk.endpoints.nodes.Node | air_sdk.air_model.PrimaryKey#
class air_sdk.types.NodeRebuildPayload[source]#

Bases: TypedDict

Payload for rebuilding a node.

id: air_sdk.endpoints.nodes.Node | air_sdk.air_model.PrimaryKey#
class air_sdk.types.ResourceBudgetUsage[source]#

Bases: TypedDict

Current resource usage within an organization’s budget.

cpu#

Number of CPU cores currently in use

memory#

Memory currently in use, in MiB

disk_storage#

Disk storage currently in use, in GB

image_storage#

Image storage currently in use, in GB

userconfigs#

User configs content currently in use, in bytes

cpu: float#
memory: float#
disk_storage: float#
image_storage: int#
userconfigs: int#
air_sdk.types.is_typeddict(type_: Type[Any]) bool[source]#
air_sdk.types.union_args_are_optional(
args: Tuple[Any | Any, Ellipsis],
) bool[source]#
air_sdk.types.is_union(type_: Type[Any]) bool[source]#
air_sdk.types.is_optional_union(type_: Type[Any]) bool[source]#
air_sdk.types.get_optional_arg(optional_type: Type[T | None]) Type[T][source]#
air_sdk.types.get_list_arg(list_type: Type[List[T]]) Type[T][source]#
air_sdk.types.is_typed_dict(expected_type: Type[Any]) bool[source]#

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[source]#

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.

air_sdk.types.type_check(value: Any, expected_type: Type[Any]) bool[source]#

Recursively check if the value matches the expected type.