Considerations for ports and interfaces
The REST
v10.04 API provides the
interfaces
resource to configure and get information about switch ports and interfaces of all types. You do not use the ports resource to manage ports.
Hardware (system) interfaces
Hardware interfaces are of type
system
.Hardware interfaces are included in the database automatically.
Interfaces of type
system
cannot be added or deleted.
LAG interfaces
LAG interfaces are of type
lag
.You can use the DELETE method to delete a LAG interface.
Example of creating a LAG interface:
Method and URI:
POST "/rest/v10.04/system/interfaces"
Request body:
{
"name": "lag50",
"vrf": "/rest/v10.04/system/vrfs/default",
"type": "lag",
"interfaces": [
"/rest/v10.04/system/interfaces/1%2F1%2F1",
"/rest/v10.04/system/interfaces/1%2F1%2F2"
]
}
VLAN interfaces
VLAN interfaces are of type
vlan
.You can use the DELETE method to delete a VLAN interface.
Example of creating a VLAN interface:
Method and URI:
POST "/rest/v10.04/system/interfaces"
Request body:
{
"name": "vlan2",
"vlan_tag": "/rest/v10.04/system/vlans/2",
"vrf": "/rest/v10.04/system/vrfs/default",
"type": "vlan"
}