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
Labels of the interface
The role of the interface
The scalable unit number of the interface
The breakout (split) factor 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 interfacelabels– New labels for the interfaceinterface_role– New role for the interfacescalable_unit– New scalable unit for the interface
Example:
Delete the interface.
Example:
Access the links endpoint for this interface.
Returns:
LinkEndpointAPI instance filtered for this interface’s links
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:
- Not available for nodes managed by a platform; use
node.bulk_breakout()instead
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
- Not available for nodes managed by a platform; use
node.bulk_breakout()instead
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 oninterface_type– Type of the interfacemac_address– MAC address of the interfaceoutbound– Outbound status of the interfacelabels– Labels for the interfaceinterface_role– Role of the interfacescalable_unit– Scalable unit of the interfacesplit– Breakout factor of the physical port this interface belongs to (‘1x’ = un-split, e.g. ‘2x’, ‘4x’). Only meaningful for nodes managed by a platform where thename/splitpair must match the platforms specifications; when unset, the interface is created at the platform’s default split.
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:
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:
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
- Not available for nodes managed by a platform; use
bulk_breakout()instead
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
- Not available for nodes managed by a platform; use
bulk_breakout()instead
Re-split several physical ports of a platform-managed node at once.
Each entry names a port by any interface it currently carries and the split factor to move it to. The whole port is re-laid out from the platform’s specification: every interface it carries is deleted and the interfaces the platform defines at the target split are created in their place. Sending the un-split factor (e.g. ‘1x’) reverts a port.
Read each port’s current split, supported splits and interface IDs
with node.breakout_options().
Parameters:
node– The node the interfaces are stored on.interfaces– The ports to re-split, as\{'id': ..., 'split': ...\}entries.idmay be an Interface or an interface ID.
Returns:
Every interface the request created, in name order
Example:
- The request is applied in full or not at all
- Each port that changes split has all of its interfaces replaced: the interfaces it carried, including the one passed in, no longer exist, so use the returned interfaces instead
- A port already at the requested split is left as it is: its interfaces keep their IDs and are not returned
- Links on affected interfaces are removed, along with any services on them