air_sdk.endpoints.interfaces
air_sdk.endpoints.interfaces
Stub file for interfaces endpoint type hints.
Classes
Module Contents
Bases: air_sdk.air_model.AirModel
Interface model representing a network interface.
Unique identifier for the interface
Human-readable name of the interface
Timestamp when the interface was created
Timestamp when the interface was last modified
Node that the interface is related to
Type of the interface
MAC address of the interface
Interface that the interface is connected to
Whether the interface is outbound
Attributes of the interface
Update the interface’s properties.
Parameters:
name– New name for the interfaceinterface_type– New type for the interfaceoutbound– New outbound status for the interfaceattributes– New attributes for the interface
Example:
Delete the interface.
Example:
Connect the interface to another interface.
Parameters:
target– Interface or primary key of the interface to connect to
Example:
Disconnect the interface from its connection.
Example:
Break out this interface into multiple sub-interfaces.
Parameters:
split_count– Number of interfaces to create from the breakout. Must be supported by the node’s split_options.
Returns:
List of created breakout interfaces
Example:
Revert this breakout interface back to a single interface.
Can be called on any of the breakout interfaces - they will all be reverted and deleted except the first one (s0), which will be renamed back to the original name.
Returns:
The reverted interface
Example:
- All breakout interfaces will be deleted except the first one (s0)
- The s0 interface will be renamed back to the original name
- Any existing connections on the breakout interfaces are automatically removed
- Cannot revert if any breakout interface has services attached
Query for the related services of the interface.
Returns:
ServiceEndpointAPI instance filtered for this interface’s services
Example:
Bases: air_sdk.air_model.BaseEndpointAPI[air_sdk.endpoints.interfaces.Interface]
API client for interface endpoints.
Create a new interface.
Parameters:
name– Name of the interfacenode– Node to create the interface on
Returns:
The created Interface instance
Example:
List all interfaces with optional filtering.
Parameters:
interface_type– Filter by interface typemac_address– Filter by MAC addressname– Filter by namenode– Filter by nodeoutbound– Filter by outbound statussimulation– Filter by simulationlimit– Number of results to return per pageoffset– The initial index from which to return the resultssearch– Search by nameordering– Order by field
Returns:
Iterator of Interface instances
Example:
Update the interface’s properties.
Parameters:
interface– Interface or primary key of the interface to updatename– New name for the interfaceinterface_type– New type for the interfaceoutbound– New outbound status for the interfaceattributes– New attributes for the interface
Returns:
The updated Interface instance
Example:
Get a specific interface by ID.
Parameters:
pk– The interface ID (string or UUID)
Returns:
The Interface instance
Example:
Delete a specific interface by ID.
Parameters:
pk– The interface ID (string or UUID)
Example:
Connect the interface to another interface.
Parameters:
interface– Interface or primary key of the interface to connecttarget– Interface or primary key of the interface to connect to
Returns:
The source interface instance
Example:
Disconnect the interface from its connection.
Parameters:
interface– Interface or primary key of the interface to disconnect
Returns:
The source interface instance
Example:
Break out an interface into multiple sub-interfaces.
Breaks out a data plane interface into multiple sub-interfaces. For example, breaking out “swp1” with a 4-way split creates “swp1s0”, “swp1s1”, “swp1s2”, “swp1s3”.
Parameters:
interface– The interface to break outsplit_count– Number of interfaces to create from the breakout. Must be supported by the node’s split_options (typically 2, 4, or 8).
Returns:
List of all created breakout interfaces
Example:
- Only data plane interfaces can be broken out
- Any existing connection on the interface will be automatically removed
- The original interface is renamed to <name>s0 and keeps its MAC address
- New interfaces are created with allocated MAC addresses
Revert a broken out interface back to a single interface.
Reverts broken out interfaces back to a single interface. For example, reverting “swp1s0” (along with “swp1s1”, “swp1s2”, “swp1s3”) back to “swp1”. This can be called on any of the breakout interfaces.
Parameters:
interface– One of the breakout interfaces (e.g., swp1s0, swp1s1, etc.)
Returns:
The reverted interface with its original name
Example:
- All breakout interfaces will be deleted except the first one (s0)
- The s0 interface will be renamed back to the original name
- Any existing connections on the breakout interfaces are automatically removed
- Cannot revert if any breakout interface has services attached