OPB Interface

Import OPBNOS API

from opbclient import opb_api as opbapi

Initialize client

Use the appropriate JSON file that corresponds to the targetted device name. This JSON file should contain request body parameters corresponding to any potential configuration/post requests.

node = opbapi.connect_to('SN2010')

Configure OPB Interfaces

The API configInterfaceNPB() requires parameters that will serve as the request body.

node.configInterfaceNPB(intf_name="Ethernet16_1", igr_vlan="1000")

The below table is a list of attributes that can be considered by clients as parameters for the OPB interface API:

Nvidia

Attribute Values Description
"name" "Ethernet1_1" interface name
"type" "network|tool" mode of exporting device functionality
"comment" "test" comments regarding interface
"mode" "vlan-aware|vlan-unaware" indicates if the device is VLAN aware/enforces VLAN tagging
"hybrid" "enable|disable" indicates whether the device is hybrid
"ingress-vlan" "500 to 4094" adding VLAN tags to ingress packets per port
"egress-tagging" "enable|disable" indicates whether the egress port is a tagged member of a VLAN
"truncate-offset" "0(disable)|32-4088(multiples of 4)" truncates based on specified offset

Broadcom

Attribute Values Description
"name" "Ethernet1_1" check device activity
"ingress-vlan" "100" adding VLAN tags to ingress packets per port
"egress-tagging" "enable|disable" indicates whether the egress port is a tagged member of a VLAN

Get/Show OPB Interface

Retrieves device interface elements

node.execute(['show interface npb <Ethernet16_1>'])

Output

This is an example of the output of the above command.

b'{"ingress-vlan": "10", "name": "Ethernet16_1", "intf_name": "Ethernet16_1"}'

the below table contains a list of attributes that will be listed in output:

Nvidia

Attribute Values Description
"name" "Ethernet1_1" interface name
"type" "network|tool" mode of exporting device functionality
"comment" "test" comments regarding interface
"mode" "vlan-aware" indicates if the device is VLAN aware/enforces VLAN tagging
"ingress-vlan" "100" adding VLAN tags to ingress packets per port
"egress-tagging" "enable|disable" indicates whether the egress port is a tagged member of a VLAN
"truncate-offset" "0(disable)" truncates based on specified offset

Broadcom

Attribute Values Description
"name" "Ethernet1_1" interface name
"ingress-vlan" "100" adding VLAN tags to ingress packets per port