Skip to main content

Aggregate Interface

The AggregateInterface class manages aggregate ethernet interface (ae) objects in Palo Alto Networks' Strata Cloud Manager. Aggregate interfaces bundle multiple physical interfaces into a single logical interface for link redundancy and increased bandwidth. They support Layer 2 and Layer 3 modes with LACP (Link Aggregation Control Protocol) configuration.

Class Overview

from scm.client import Scm

# Initialize client
client = Scm(
client_id="your_client_id",
client_secret="your_client_secret",
tsg_id="your_tsg_id"
)

# Access aggregate interfaces via the client
aggregate_interfaces = client.aggregate_interface
MethodDescriptionParametersReturn Type
create()Creates a new aggregate interfacedata: Dict[str, Any]AggregateInterfaceResponseModel
get()Retrieves an aggregate interface by IDobject_id: strAggregateInterfaceResponseModel
update()Updates an existing aggregate interfaceaggregate: AggregateInterfaceUpdateModelAggregateInterfaceResponseModel
list()Lists aggregate interfaces with optional filteringfolder, snippet, device, plus filtersList[AggregateInterfaceResponseModel]
fetch()Fetches a single aggregate interface by name within a containername: str, folder, snippet, deviceAggregateInterfaceResponseModel
delete()Deletes an aggregate interface by IDobject_id: strNone

Aggregate Interface Model Attributes

AttributeTypeRequiredDefaultDescription
namestrYesNoneInterface name (e.g., "ae1")
idUUIDYes*NoneUnique identifier (*response/update only)
commentstrNoNoneDescription. Max 1023 chars
layer2AggregateLayer2No**NoneLayer 2 mode configuration
layer3AggregateLayer3No**NoneLayer 3 mode configuration
folderstrNo***NoneFolder location. Max 64 chars
snippetstrNo***NoneSnippet location. Max 64 chars
devicestrNo***NoneDevice location. Max 64 chars

* Only required for update and response models ** Only one mode (layer2/layer3) can be configured at a time *** Exactly one container must be provided for create operations

LACP Configuration Options

AttributeTypeDefaultDescription
enableboolFalseEnable LACP
fast_failoverboolFalseEnable fast failover
modestr"passive"LACP mode (passive/active)
transmission_ratestr"slow"Transmission rate (fast/slow)
system_priorityint32768System priority (1-65535)
max_portsint8Maximum ports (1-8)

Interface Modes

Layer 2 Mode

Layer 2 mode with VLAN tagging and LACP support.

interface_data = {
"name": "ae1",
"layer2": {
"vlan_tag": "100",
"lacp": {
"enable": True,
"mode": "active"
}
},
"folder": "Interfaces"
}

Layer 3 Mode with Static IP

Layer 3 mode with static IP addresses.

interface_data = {
"name": "ae1",
"layer3": {
"ip": [{"name": "10.0.0.1/24"}],
"mtu": 9000,
"lacp": {
"enable": True,
"mode": "active",
"fast_failover": True
}
},
"folder": "Interfaces"
}

Layer 3 Mode with DHCP

Layer 3 mode using DHCP for dynamic IP assignment.

interface_data = {
"name": "ae1",
"layer3": {
"dhcp_client": {
"enable": True,
"create_default_route": True
},
"lacp": {"enable": True}
},
"folder": "Interfaces"
}

Exceptions

ExceptionHTTP CodeDescription
InvalidObjectError400Invalid data or parameters
MissingQueryParameterError400Missing required parameters
ObjectNotPresentError404Interface not found
AuthenticationError401Authentication failed
ServerError500Internal server error

Methods

List Aggregate Interfaces

# List all aggregate interfaces
interfaces = client.aggregate_interface.list(folder="Interfaces")

for iface in interfaces:
print(f"Name: {iface.name}")
if iface.layer2:
print(f" Mode: Layer 2")
elif iface.layer3:
print(f" Mode: Layer 3")
if iface.layer3.lacp:
print(f" LACP: {iface.layer3.lacp.mode}")

# Filter by mode
layer3_only = client.aggregate_interface.list(
folder="Interfaces",
mode="layer3"
)

Fetch an Aggregate Interface

# Fetch by name
interface = client.aggregate_interface.fetch(
name="ae1",
folder="Interfaces"
)
print(f"Found aggregate interface: {interface.name}")

# Get by ID
interface_by_id = client.aggregate_interface.get(interface.id)

Create an Aggregate Interface

# Create Layer 3 aggregate with LACP
layer3_aggregate = {
"name": "ae1",
"comment": "Primary link aggregation",
"layer3": {
"ip": [{"name": "10.0.0.1/24"}],
"mtu": 9000,
"lacp": {
"enable": True,
"mode": "active",
"fast_failover": True,
"transmission_rate": "fast",
"max_ports": 4
}
},
"folder": "Interfaces"
}

result = client.aggregate_interface.create(layer3_aggregate)
print(f"Created aggregate interface: {result.id}")

# Create Layer 2 aggregate
layer2_aggregate = {
"name": "ae2",
"layer2": {
"vlan_tag": "200",
"lacp": {"enable": True, "mode": "passive"}
},
"folder": "Interfaces"
}

result = client.aggregate_interface.create(layer2_aggregate)

Update an Aggregate Interface

# Fetch existing interface
existing = client.aggregate_interface.fetch(
name="ae1",
folder="Interfaces"
)

# Modify LACP settings
if existing.layer3 and existing.layer3.lacp:
existing.layer3.lacp.fast_failover = True
existing.layer3.lacp.max_ports = 8

# Update
updated = client.aggregate_interface.update(existing)

Delete an Aggregate Interface

client.aggregate_interface.delete("123e4567-e89b-12d3-a456-426655440000")

Use Cases

Managing Configuration Changes

result = client.commit(
folders=["Interfaces"],
description="Updated aggregate interfaces",
sync=True
)

print(f"Commit job ID: {result.job_id}")

Error Handling

from scm.exceptions import InvalidObjectError, MissingQueryParameterError

try:
interface = client.aggregate_interface.create({
"name": "ae1",
"layer2": {"vlan_tag": "100"},
"layer3": {"ip": [{"name": "10.0.0.1/24"}]}, # Error: both modes
"folder": "Interfaces"
})
except InvalidObjectError as e:
print(f"Invalid configuration: {e.message}")