air_sdk.endpoints.services
air_sdk.endpoints.services
Classes
Module Contents
Bases: air_sdk.bc.ServiceCompatMixin, air_sdk.bc.BaseCompatMixin, air_sdk.air_model.AirModel
Represents a service in the Air API.
A service exposes a port on a simulation interface to external networks, enabling connectivity between simulations and the outside world.
Example:
Unique identifier
Service name
Port number on the node/interface
Interface object (foreign key relationship)
Type of service (e.g., ‘ssh’, ‘http’, ‘https’)
External port on the worker (assigned by Air)
Fully qualified domain name of the worker
Timestamp when service was created
Timestamp when service was last modified
Delete the service.
After deletion, the service object should not be used.
Example:
Refresh service data from the API.
Example:
Bases: air_sdk.bc.ServiceEndpointAPICompatMixin, air_sdk.endpoints.mixins.ListApiMixin[air_sdk.endpoints.services.Service], air_sdk.endpoints.mixins.CreateApiMixin[air_sdk.endpoints.services.Service], air_sdk.endpoints.mixins.GetApiMixin[air_sdk.endpoints.services.Service], air_sdk.endpoints.mixins.DeleteApiMixin, air_sdk.air_model.BaseEndpointAPI[air_sdk.endpoints.services.Service]
API for managing services.
Services expose ports on simulation interfaces to enable external connectivity.
Example:
List services with optional filtering and pagination.
Parameters:
interface– Filter by interface ID or instancename– Filter by service namenode_port– Filter by node portworker_port– Filter by worker portworker_fqdn– Filter by worker FQDNservice_type– Filter by service type (ssh, http, https, etc.)search– Search term to filter resultsordering– Field to order results by (prefix with ’-’ for descending)limit– Maximum number of results to returnoffset– Number of results to skip
Yields:
Service instances
Example:
Get a service by ID.
Parameters:
pk– Service ID
Returns:
Service instance
Raises:
AirUnexpectedResponse– Service not found or API error
Example:
Create a new service.
Parameters:
name– Service namenode_port– Port number on the node/interfaceinterface– Interface instance or IDservice_type– Service type - ‘SSH’, ‘HTTPS’, ‘HTTP’, or ‘OTHER’
Returns:
Created Service instance
Raises:
AirUnexpectedResponse– Creation failed
Example:
Delete a service.
Parameters:
service– Service instance or ID
Example: