Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
SONIC PBNOS 1.3
This REST Application Programming Interface (API) enables you to remotely configure and manage a AVIZ OPBNOS REST, HyperText Transfer Protocol Secure(HTTPs). The REST (Representational State Transfer) architecture has six constraints - Uniform Interface, Stateless, Cacheable, Client-Server, Layered Systems, and Code on Demand. The REST API is a JavaScript Object Notation-based (JSON) wrapper around Python On-Box backend.
REST APIs can be used to perform CRUD
Create: This is a POST https request
Read: This is a GET https request
Update: This is a PUT https request
Delete: This is a DELETE https request
The table below shows the convention to map Python object API to RESTful API:
Operation
RESTful API
Create
[POST] https://<IP_addreess>/api/<resource> params={…}
Delete
[DELETE] https://<IP_addreess>/api/<resource>/<id>
Get
[GET] https://<IP_addreess>/api/info/<resource>/<id>
GetAll
[GET] https://<IP_addreess>/api/info/
Update
[PUT] https://<IP_addreess>/api/<resource>/<id> params={…}
Physical Interfaces are switch front panel ethernet ports which are ASIC ports. The physical ports are created by default and cannot be deleted.
Request URL
/api/config/opbinterfaces/<Interface-name>
Description
Use this API to configure the opb-interface specific parameters
Method
POST
Request Body
Nvidia:
{
"name" : "Ethernet1_1"
"type" : "network | tool",
"comment" : "test",
"mode" : "vlan-aware | vlan-unaware"
"hybrid" : "enable | disable",
"ingress-vlan" : "100",
"egress-tagging" : "enable | disable",
"truncate-offset": "0(disable) | 32-4088 (multiple of 4)"
}
Broadcom:
{
"name":"Ethernet1_1",
"ingress-vlan":"700",
"egress-tagging":"enable | disable"
}
Response Body
NA
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/opbinterfaces
/api/info/opbinterfaces/<interface-name>
Description
Use this API to get the interface configuration
Method
GET
Request Body
NA
Response Body
Nvidia:
{
"name": "Ethernet1_1",
"comment": "test",
"type": "network",
"mode" : "vlan-aware"
"egress-tagging": "disable",
"ingress-vlan": "100",
"truncate-offset": "0"
}
Broadcom:
{
"name": "Ethernet1_1",
"egress-tagging": "disable",
"ingress-vlan": "100",
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
api/config/interfaces/config/<Interface-name>
Description
Use this API to configure the generic interface parameters
Method
POST
Request Body
{
"admin_status": "up",
"speed": "100000",
"mtu": "9100",
"fec": "rs"
}
Response Body
NA
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/interfaces
/api/info/interfaces/<interface_name>
Description
Use this GET-API to fetch the interface related information in the system
Method
GET
Request Body
NA
Response Body
{
"Ethernet1_1": {
"lanes": "13",
"alias": "tenGigE1",
"oper_status": "down",
"admin_status": "up",
"speed": "10000",
"mtu": "9100",
"description": "N/A",
"autoneg": "N/A",
"TRANSCEIVER": "Present"
}
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/interfaces/stats or /api/info/interfaces/stats/Ethernet1_1
Description
Use this API to get the interface statistics related information
Method
GET
Request Body
NA
Response Body
{
"Ethernet1_1": {
"IF_IN_OCTETS": 0,
"IF_IN_UCAST_PKTS": 0,
"IF_IN_NON_UCAST_PKTS": 0,
"IF_IN_DISCARDS": 0,
"IF_IN_ERRORS": 0,
"IF_IN_UNKNOWN_PROTOS": 0,
"IF_OUT_OCTETS": 0,
"IF_OUT_UCAST_PKTS": 0,
"IF_OUT_NON_UCAST_PKTS": 0,
"IF_OUT_DISCARDS": 0,
"IF_OUT_ERRORS": 0,
"IF_OUT_QLEN": "N/A",
"IF_IN_MULTICAST_PKTS": 0,
"IF_IN_BROADCAST_PKTS": 0,
"IF_OUT_MULTICAST_PKTS": 0,
"IF_OUT_BROADCAST_PKTS": 0,
"ETHER_RX_OVERSIZE_PKTS": 0,
"ETHER_TX_OVERSIZE_PKTS": 0,
"ETHER_STATS_TX_NO_ERRORS": 0,
"IP_IN_UCAST_PKTS": "N/A",
"ETHER_IN_PKTS_128_TO_255_OCTETS": 0,
"PFC_0_TX_PKTS": 0,
"PFC_1_TX_PKTS": 0,
"PFC_2_TX_PKTS": 0,
"PFC_3_TX_PKTS": 0,
"PFC_4_TX_PKTS": 0,
"PFC_5_TX_PKTS": 0,
"PFC_6_TX_PKTS": 0,
"PFC_7_TX_PKTS": 0,
"PFC_0_RX_PKTS": 0,
"PFC_1_RX_PKTS": 0,
"PFC_2_RX_PKTS": 0,
"PFC_3_RX_PKTS": 0,
"PFC_4_RX_PKTS": 0,
"PFC_5_RX_PKTS": 0,
"PFC_6_RX_PKTS": 0,
"PFC_7_RX_PKTS": 0
},
…
…
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/interfaces/transceivers
/api/info/interfaces/transceivers/Ethernet1_1
Description
Get interface transceivers information using this API
Method
GET
Request Body
NA
Response Body
{
"Ethernet1_1": {
"type": "SFP/SFP+/SFP28",
"hardware_rev": "A",
"serial": "16CN48200170",
"manufacturer": "Volex Inc.",
"model": "700512588", "specification_compliance": "{'SFP+CableTechnology': 'Passive Cable'}"
}
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
The below API's are used to configure flows with rules. It creates a traffic stream between the network and tool port, the traffic can be managed by configuring rule(s) to permit/deny matching traffic
Request URL
/api/config/flows
Description
Use this API to configure flow parameters for the open packet broker
Method
POST
Request Body
{
"alias" : "flow1",
"status" : "enable | disable",
"comment" : "test string",
"from" : ["Ethernet45_1"],
"to" : ["Ethernet46_1"],
"push-vlan" : "vlan-id",
"pop-vlan" : "enable | disable"
}
Response Body
NA
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/info/flows
Description
Use this API to get the configured flow parameters
Method
GET
Request Body
NA
Response Body
{
"flow1": {
"name": "flow1",
"status": "enable",
"config_mgr": "Rest-API",
"to": [ "Ethernet46_1" ],
"comment": "vlan traffic test",
"from": [ "Ethernet45_1" ]
}
}
Status code
SERVER_ERROR(500) if there is any error with the server
Response status in the pretty output format shown above
Request URL
/api/config/flow/<flow-name>/rules
Description
Use this API to configure the OPB rule specific parameters
Method
POST
Request Body
{
"rule_id" : "10",
"action" : "permit",
"comment" : "test",
"vlan" : "100",
"ethertype" : "0x8100",
"src_ip" : "1.1.1.1",
"src_mask" : "255.255.255.0",
"dst_ip" : "2.2.2.2",
"dst_mask" : "255.255.255.0",
"dscp" : "5",
"ttl" : "4",
"protocol" : "6",
"src_l4port" : "56",
"dst_l4port" : "78",
"tcpctl" : "0x5",
"tcpctl_mask" : "0xff",
"tosval" : "3",
"match_all" : "disable",
"counters" : "enable"
}
Response Body
NA
Status code
SERVER_ERROR(500) if there is any error with the server
Response status in the pretty output format shown above
Get Flow Rule Information
Request URL
/api/info/flows/<flow-name>/rules
Or
/api/info/flows/<flow-name>/rules/<rule-id>
Description
Use this API to get the configured rules from the system
Method
GET
Request Body
NA
Response Body
{
"flow1|355": {
"ipdst": "2.2.2.2",
"src_mask": "255.255.255.0",
"match_all": "disable",
"comment": "Example-rule-created",
"ipsrc": "1.1.1.1",
"dst_mask": "255.255.255.0",
"map_name": "flow1",
"rule_id": "355",
"action": "permit",
"counters": "enable"
}
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/flows/<flow-name>/rules/<rule-id>/status
Description
Use this API to get the configured rules hardware status and packets from the system
Method
GET
Request Body
NA
Response Body
{
"map_name": "flow1",
"rule_id": "2",
"status": "Active",
"Total-packets": "0"
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/config/flows/<flow-name>/rules/<rule-id>/override
Description
Use this API to configure the OPB rule override actions
Method
POST
Request Body
{
"override-to": ["Ethernet12", "Ethernet4", "Ethernet8"],
"override-push-vlan-tag": "100",
"override-pop-vlan": "disable"
}
Response Body
NA
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/flows/<flow-name>/rules/<rule-id>/override
Description
Use this API to get the configured rules override actions from the system
Method
GET
Request Body
NA
Response Body
{
"override-to": ["Ethernet12", "Ethernet4", "Ethernet8"],
"override-push-vlan-tag": "100",
"override-pop-vlan": "disable"
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/config/flows/<flow-name>/rules/<rule-id>
Description
Use this API to delete the configured rule with id <rule-id> inside <flow-name>
Method
DELETE
Request Body
NA
Response Body
NA
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/config/flows/<flow-name>/rules/<rule-id>/override
Description
Use this API to delete the overrides configured on the map rule
Method
DELETE
Request Body
NA
Response Body
NA
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Delete Flow
Request URL
/api/config/flows/<flow-name>
Description
Use this API to delete the configured <flow-name> in the system
Method
DELETE
Request Body
NA
Response Body
NA
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
The below API's are used to configure and manage the LLDP, which allows network management applications to extend their awareness of the network by discovering devices that are direct neighbours
Request URL
/api/info/lldp/neighbors
Description
Use this API to get the LLDP-neighbor information in the system
Method
GET
Request Body
NA
Response Body
{
"time_stamp": "08:04:21 12:30:55Z",
"Ethernet8_1": {
"rid": "2",
"age": "0 day, 00:13:54",
"port": {
"id": {
"type": "local",
"value": "etp3"
},
"descr": "Ethernet8_1"
},
"via": "LLDP",
"chassis": {
"sonic": {
"id": {
"type": "mac",
"value": "04:3f:72:da:74:ee"
},
"ttl": "120",
"descr": "Debian GNU/Linux 9 (stretch) Linux 4.9.0-11-2-amd64 #1 SMP Debian
4.9.189-3+deb9u2 (2019-11-11) x86_64",
"capability": [
{
"enabled": true,
"type": "Bridge"
},
{
"enabled": true,
"type": "Router"
},
{
"enabled": false,
"type": "Wlan"
},
{
"enabled": false,
"type": "Station"
}
],
"mgmt-ip": "192.168.0.12"
}
}
}
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/tacacs-server
Description
Use this API to show TACACS Server
Method
POST
Request Body
{
"version":2,
"server_id":1,
"community":"public",
"ip_address":"10.4.4.11"
}
Response Body
NA
Status Code
OK(200) if the request completes successfully
SERVER_ERROR(500) if there is any error with the server
Request URL
api/info/clock/timezone
Description
Use this API to get the timezone.
Method
GET
Request Body
NA
Response Body
{"timezone": "UTC"}
Status Code
OK(200) if the request completes successfully
SERVER_ERROR(500) if there is any error with the server
Request URL
api/info/fans
Description
Use this API to get the fans info.
Method
GET
Request Body
NA
Response Body
{"fan4": {"presence": "True", "drawer_name": "N/A", "model": "N/A", "serial": "N/A", "status": "True", "direction": "intake", "speed": "28", "speed_tolerance": "50", "speed_target": "20", "is_replaceable": "False", "timestamp": "20230707 04:12:52", "led_status": "green", "rpm": "6931"}, "fan2": {"presence": "True", "drawer_name": "N/A", "model": "N/A", "serial": "N/A", "status": "True", "direction": "intake", "speed": "28", "speed_tolerance": "50", "speed_target": "20", "is_replaceable": "False", "timestamp": "20230707 04:12:52", "led_status": "green", "rpm": "6967"}, "fan1": {"presence": "True", "drawer_name": "N/A", "model": "N/A", "serial": "N/A", "status": "True", "direction": "intake", "speed": "27", "speed_tolerance": "50", "speed_target": "20", "is_replaceable": "False", "timestamp": "20230707 04:12:52", "led_status": "green", "rpm": "7004"}, "fan3": {"presence": "True", "drawer_name": "N/A", "model": "N/A", "serial": "N/A", "status": "True", "direction": "intake", "speed": "28", "speed_tolerance": "50", "speed_target": "20", "is_replaceable": "False", "timestamp": "20230707 04:12:52", "led_status": "green", "rpm": "6931"}}
Status Code
OK(200) if the request completes successfully
SERVER_ERROR(500) if there is any error with the server
Request URL
/api/config/ztp
Description
Configure ZTP enable or disable on the system
Method
POST
Request Body
{"ztp_status": "enable | disable"}
Response Body
NA
Status Code
OK(200) if the request completes successfully
SERVER_ERROR(500) if there is any error with the server
Request URL
/api/info/ntp
Description
Show NTP server
Method
POST
Request Body
{
"version":2,
"server_id":1,
"community":"public",
"ip_address":"10.4.4.11"
}
Response Body
NA
Status Code
OK(200) if the request completes successfully
SERVER_ERROR(500) if there is any error with the server
Request URL
/api/config/ntp
Description
Configure NTP server
Method
POST
Request Body
{"ipv4":"128.138.141.172"}
Response Body
NA
Status Code
OK(200) if the request completes successfully
SERVER_ERROR(500) if there is any error with the server
Request URL
/api/config/ntp/<server-ip>
Description
Deleting the NTP server
Method
Delete
Request Body
NA
Response Body
NA
Status Code
OK(200) if the request completes successfully
SERVER_ERROR(500) if there is any error with the server
Request URL
/api/config/reboot
Description
API to reboot the system
Method
POST and PUT
Request Body
{"reboot": "yes"}
Response Body
NA
Status Code
OK(200) if the request completes successfully
SERVER_ERROR(500) if there is any error with the server
Request URL
/api/config/system?cfgblk=<cfgblk>'
<cfgblk>: Configuration blocks. Valid values are "running" and "bootup"
Running – Read and build from database
Bootup – config_db.json
Description
Get system configuration
Method
GET
Request Body
NA
Response Body
JSON format
Status Code
OK(200) if the request completes successfully
SERVER_ERROR(500) if there is any error with the server
Request URL
/api/info/devices
Description
Use this API to get the detailed device information
Method
GET
Request Body
NA
Response Body
{
"mac": "1c:34:da:36:f7:80",
"hwsku": "ACS-MSN2100",
"type": "LeafRouter",
"hostname": "sonic",
"platform": "x86_64-mlnx_msn2100-r0"
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/environment
Description
This API is used to retrieve the dev environment information
Method
GET
Request Body
NA
Response Body
{
"Fans": {
"Fan 5 Rear": "7400",
"Fan 1 Front": "7600",
"Fan 4 Rear": "7300",
"Fan 3 Front": "7900",
"Fan 6 Front": "7700",
"Fan 4 Front": "7900",
"Fan 6 Rear": "7100",
"Fan 1 Rear": "7100",
"Fan 3 Rear": "7200",
"Fan 2 Front": "7900",
"Fan 2 Rear": "7200",
"Fan 5 Front": "8200" },
"Platform": {
"ASIC": "broadcom",
"HwSKU": "Accton-AS7712-32X", "SONIC_DEBIAN_VERSION": "10.13", "Platform": "x86_64-accton_as7712_32x-r0", "OPB_NOS_VERSION": "2.4.0", "SONIC_KERNEL_VERSION": "4.19.0-12-2-amd64",
"SONIC_VERSION": "SONiC.master.127-dirty-20230410.121347" },
"Temperature": {
"CPU": {
"Core3": 41.0,
"Core0": 39.0,
"Core2": 41.0,
"Core1": 39.0 },
"Ambient": {}
}
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/reboot-cause
Description
Use the above API to get the last reboot-cause of he system
Method
GET
Request Body
NA
Response Body
{
"reboot-cause": "User issued 'reboot' command [User: admin, Time: Tue 11 Apr 2023 03:20:05 AM UTC]"
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/ztp-status
Description
Get the ZTP-status of the system using this API
Method
GET
Request Body
NA
Response Body
{
"ztp-status": "disabled"
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/uptime
Description
Use this GET-API to get the uptime of the system
Method
GET
Request Body
NA
Response Body
{
"uptime": "11:50:39 up 8:29, 2 users, load average: 0.55, 0.48, 0.53"
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/clock
Description
Use this GET-API to get the clock information of the system
Method
GET
Request Body
NA
Response Body
{
"currentTime": "\rTue 11 Apr 2023 11:51:38 AM UTC\r\n\r"
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/boot
Description
Use the above GET-API to get the system boot-information
Method
GET
Request Body
NA
Response Body
{
"BootInfo": {
"Available": "OPBNOS-master.127-dirty-20230410.121347",
"Next": "OPBNOS-master.127-dirty-20230410.121347",
"Current": "OPBNOS-master.127-dirty-20230410.121347"
}
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/ssdhealth
Description
Get SSD health information using this API
Method
GET
Request Body
NA
Response Body
{
"ssdhealth": "Device Model : M.2 (S42) 3IE3\r\nHealth : 99.510%\r\nTemperature : 30C\r\n"
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/memutil
Description
Get system memory information using this API
Method
GET
Request Body
NA
Response Body
{
"%MEM_Util": "63.5"
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/cpuutil
Description
GET system CPU utilzation
Method
GET
Request Body
NA
Response Body
{
"%CPU_Util": "11.25"
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/docker/stats
Description
Get docker statistics information
Method
GET
Request Body
NA
Response Body
{
"syncd": {
"CPU%": "0.04",
"NET_OUT_BYTES": "0",
"BLOCK_OUT_BYTES": "168000",
"MEM%": "0.36",
"MEM_BYTES": "3036676096",
"MEM_LIMIT_BYTES": "8336531521536",
"BLOCK_IN_BYTES": "696000",
"NET_IN_BYTES": "0",
"NAME": "syncd",
"PIDS": "9"
},
"s3helper": {
"CPU%": "2.96",
"NET_OUT_BYTES": "0",
"BLOCK_OUT_BYTES": "0",
"MEM%": "0.67",
"MEM_BYTES": "556793856",
"MEM_LIMIT_BYTES": "8336531521536",
"BLOCK_IN_BYTES": "0",
"NET_IN_BYTES": "0",
"NAME": "s3helper",
"PIDS": "259"
},
"pmon": {
"CPU%": "1.70",
"NET_OUT_BYTES": "0",
"BLOCK_OUT_BYTES": "131000",
"MEM%": "0.91",
"MEM_BYTES": "7554990080",
"MEM_LIMIT_BYTES": "8336531521536",
"BLOCK_IN_BYTES": "0",
"NET_IN_BYTES": "0",
"NAME": "pmon",
"PIDS": "12"
},
"null": {
"lastupdate": "2021-04-07 23:19:00.908929"
},
"nagr": {
"CPU%": "4.95",
"NET_OUT_BYTES": "0",
"BLOCK_OUT_BYTES": "604000000",
"MEM%": "0.96",
"MEM_BYTES": "7973371904",
"MEM_LIMIT_BYTES": "8336531521536",
"BLOCK_IN_BYTES": "712000000",
"NET_IN_BYTES": "0",
"NAME": "nagr",
"PIDS": "17"
},
"snmp": {
"CPU%": "0.15",
"NET_OUT_BYTES": "0",
"BLOCK_OUT_BYTES": "983000",
"MEM%": "0.67",
"MEM_BYTES": "5625610240",
"MEM_LIMIT_BYTES": "8336531521536",
"BLOCK_IN_BYTES": "139000",
"NET_IN_BYTES": "0",
"NAME": "snmp",
"PIDS": "9"
},
"database": {
"CPU%": "0.28",
"NET_OUT_BYTES": "0",
"BLOCK_OUT_BYTES": "680000",
"MEM%": "0.43",
"MEM_BYTES": "3611295744",
"MEM_LIMIT_BYTES": "8336531521536",
"BLOCK_IN_BYTES": "331000000",
"NET_IN_BYTES": "0",
"NAME": "database",
"PIDS": "12"
},
"swss": {
"CPU%": "0.00",
"NET_OUT_BYTES": "0",
"BLOCK_OUT_BYTES": "0",
"MEM%": "0.00",
"MEM_BYTES": "0",
"MEM_LIMIT_BYTES": "0",
"BLOCK_IN_BYTES": "0",
"NET_IN_BYTES": "0",
"NAME": "swss",
"PIDS": "0"
},
"lldp": {
"CPU%": "0.05",
"NET_OUT_BYTES": "0",
"BLOCK_OUT_BYTES": "115000",
"MEM%": "0.59",
"MEM_BYTES": "4893704192",
"MEM_LIMIT_BYTES": "8336531521536",
"BLOCK_IN_BYTES": "612000000",
"NET_IN_BYTES": "0",
"NAME": "lldp",
"PIDS": "11"
},
"run_dockers": 9
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/process/stats
Description
Use this API to retrieve the process related information from system
Method
GET
Request Body
NA
Response Body
{
"/usr/bin/python /usr/bin/thermalctld": {
"TIME": "00:03:57",
"UID": "0",
"CMD": "/usr/bin/python /usr/bin/thermalctld",
"%CPU": "0.1",
"PPID": "4242",
"TT": "pts/0",
"STIME": "Apr06",
"%MEM": "0.2"
},
"[kworker/1:0H]": {
"TIME": "00:00:00",
"UID": "0",
"CMD": "[kworker/1:0H]",
"%CPU": "0.0",
"PPID": "2",
"TT": "?",
"STIME": "Apr05",
"%MEM": "0.0"
},
"[bioset]": {
"TIME": "00:00:00",
"UID": "0",
"CMD": "[bioset]",
"%CPU": "0.0",
"PPID": "2",
"TT": "?",
"STIME": "Apr05",
"%MEM": "0.0"
},
"/etc/sonic/iscli/iscli_startup": {
"TIME": "00:00:00",
"UID": "0",
"CMD": "/etc/sonic/iscli/iscli_startup",
"%CPU": "0.0",
"PPID": "1",
"TT": "?",
"STIME": "Apr05",
"%MEM": "0.0"
},
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/sysmemory
Description
Use this API to retrieve the memory related information from system
Method
GET
Request Body
NA
Response Body
{"system_memory": {"swap": {"total": 0}, "memory": {"total": 7}}}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/eeprom/stats
Description
Use this API to retrieve the EEPROM information from system
Method
GET
Request Body
NA
Response Body
{
"EEPROM_INFO|0x24": {
"Value": "1C:34:DA:36:F7:80",
"Name": "Base MAC Address",
"Len": "6"
},
"EEPROM_INFO|State": {
"Initialized": "1"
},
"EEPROM_INFO|0xfd": {
"Value_4": "",
"Value_1": "",
"Len_0": "36",
"Value_2": "",
"Len_2": "36",
"Name_4": "Vendor Extension",
"Len_1": "164",
"Name_0": "Vendor Extension",
"Value_0": "",
"Name_2": "Vendor Extension",
"Name_3": "Vendor Extension",
"Num_vendor_ext": "5",
"Len_3": "36",
"Len_4": "36",
"Value_3": "",
"Name_1": "Vendor Extension"
},
"EEPROM_INFO|0xfe": {
"Value": "0x0B12CEA5",
"Name": "CRC-32",
"Len": "4"
},
"EEPROM_INFO|0x28": {
"Value": "x86_64-mlnx_x86-r0",
"Name": "Platform Name",
"Len": "64"
},
"EEPROM_INFO|0x29": {
"Value": "2019.08-5.2.0016-115200",
"Name": "ONIE Version",
"Len": "23"
},
"EEPROM_INFO|0x2a": {
"Value": "128",
"Name": "MAC Addresses",
"Len": "2"
},
"EEPROM_INFO|0x25": {
"Value": "12/17/2019 06:08:31",
"Name": "Manufacture Date",
"Len": "19"
},
"EEPROM_INFO|0x21": {
"Value": "MSN2100",
"Name": "Product Name",
"Len": "64"
},
"EEPROM_INFO|0x26": {
"Value": "16",
"Name": "Device Version",
"Len": "1"
},
"EEPROM_INFO|0x2b": {
"Value": "Mellanox",
"Name": "Manufacturer",
"Len": "8"
},
"EEPROM_INFO|Checksum": {
"Valid": "1"
},
"EEPROM_INFO|0x23": {
"Value": "MT1950X05001",
"Name": "Serial Number",
"Len": "24"
},
"EEPROM_INFO|0x22": {
"Value": "MSN2100-CB2FO",
"Name": "Part Number",
"Len": "20"
},
"EEPROM_INFO|TlvHeader": {
"Version": "1",
"Id String": "TlvInfo",
"Total Length": "575"
}
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/syslog
Description
Use this API to retrieve the syslogs from system
Method
GET
Request Body
NA
Response Body
{
"1":{
"time":"Oct 5 06:22:26.453866"
"severity":"INFO"
"component":"syncd#/broadcom_nagg_asic.py"
"msg":"[nagr]:Stat Poll-Table Handler Key map6 Data{'clear-all': 'false'}"
},
"2":{
"time":"Oct 5 06:22:19.109499"
"severity":"INFO"
"component":"syncd#/broadcom_nagg_asic.py"
"msg":"[nagr]: execute command - bcmcmd 'fp stat set StatId=15 type=Packets val=0x0000'"
}, ...
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
The below API's are used to create groups of tool ports as port-channel and provide traffic load-balancing. By default, symmetric hashing is enabled for IPv4 and IPv6 traffic.
Request URL
/api/config/portchannel/<port-channel-id>
Description
Use this API to add the members from a port-channel
Note: Edit port-channel not supported. Please delete and add the port-channel to change the member ports
Method
POST
Request Body
{
"add_member" :["Ethernet1_1", "Ethernet2_1", "Ethernet3_1"],
"description": "test"
}
Response Body
NA
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/config/portchannel/<port-channel-id>
Description
Use this API to delete all the members from a port-channel
Method
DELETE
Request Body
NA
Response Body
NA
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/portchannel/<port-group-id>
Description
Use this API to get the portchannel related information from the system
Method
GET
Request Body
NA
Response Body
{
{
"ports": [ "Ethernet46_1", "Ethernet47_1" ], "comment": "test"
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/portchannel
Description
Use this API to get all the portchannel related information from the system
Method
GET
Request Body
NA
Response Body
{
"1": {
"ports": [ "Ethernet46_1", "Ethernet47_1" ], "comment": "test"
}
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
api/info/opbport/stats
Description
Use this API to get abridged port statistics.
Method
GET
Request Body
NA
Response Body
{"Ethernet1_1": {"IF_IN_OCTETS": 0, "IF_IN_UCAST_PKTS": 0, "IF_IN_NON_UCAST_PKTS": 0, "IF_IN_DISCARDS": 0, "IF_IN_ERRORS": 0, "IF_OUT_OCTETS": 0, "IF_OUT_UCAST_PKTS": 0, "IF_OUT_NON_UCAST_PKTS": 0, "IF_OUT_DISCARDS": 0, "IF_OUT_ERRORS": 0, "IF_IN_MULTICAST_PKTS": 0, "IF_OUT_MULTICAST_PKTS": 0}, "Ethernet2_1":
<.........>
"Ethernet22_1": {"IF_IN_OCTETS": 0, "IF_IN_UCAST_PKTS": 0, "IF_IN_NON_UCAST_PKTS": 0, "IF_IN_DISCARDS": 0, "IF_IN_ERRORS": 0, "IF_OUT_OCTETS": 0, "IF_OUT_UCAST_PKTS": 0, "IF_OUT_NON_UCAST_PKTS": 0, "IF_OUT_DISCARDS": 0, "IF_OUT_ERRORS": 0, "IF_IN_MULTICAST_PKTS": 0, "IF_OUT_MULTICAST_PKTS": 0}}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
api/info/opbport/stats/<eth_name>
Description
Use this API to get abridged port statistics for specific port.
Method
GET
Request Body
NA
Response Body
{"Ethernet12_1": {"IF_IN_OCTETS": 0, "IF_IN_UCAST_PKTS": 0, "IF_IN_NON_UCAST_PKTS": 0, "IF_IN_DISCARDS": 0, "IF_IN_ERRORS": 0, "IF_OUT_OCTETS": 0, "IF_OUT_UCAST_PKTS": 0, "IF_OUT_NON_UCAST_PKTS": 0, "IF_OUT_DISCARDS": 0, "IF_OUT_ERRORS": 0, "IF_IN_MULTICAST_PKTS": 0, "IF_OUT_MULTICAST_PKTS": 0}}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/info/flows/<flow-name>/rules/<rule-id>/statistics
Description
Use this API to get the statistics details for the specified flow and rule.
Method
GET
Request Body
NA
Response Body
{
"map_name": "flow1",
"ASIC-Stat-Id": "27",
"rule_id": "1",
"Total-packets-mirrored": "0"
}
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
Request URL
/api/config/stats/clear/all or /api/config/stats/clear/flows/flow1 or /api/config/stats/clear/flows/flow1/rules/10
Description
Use this API to clear the opb flow/rule/all counters
Method
POST
Request Body
NA
Response Body
NA
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successful
Request URL
/api/interfaces/config/stats/clear
Description
Use this API to clear the interface counters
Method
POST
Request Body
NA
Response Body
NA
Status code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request completes successfully
The below APIs are used to configure and validate the SNMP, which allows users to manage the Traps, Community, Threshold, SNMPV3 user creation and deletion.
Request URL
/api/info/snmp/trapstatus
Description
Use this API to show snmp trap status
Method
POST
Request Body
{
"version":2,
"server_id":1,
"community":"public",
"ip_address":"10.4.4.11"
}
Response Body
NA
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/info/snmp/users
Description
Use this API to show snmp users
Method
POST
Request Body
{
"version":2,
"server_id":1,
"community":"public",
"ip_address":"10.4.4.11"
}
Response Body
NA
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/config/snmp-community
Description
Use this API to configure the SNMP community
Method
POST
Request Body
{"community":"Aviz"}
Response Body
NA
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/config/snmptrap
Description
Use this API to enable the SNMP Trap
Method
POST
Request Body
{
"version":2,
"server_id":1,
"community":"public",
"ip_address":"10.4.4.11"
}
Response Body
NA
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/config/snmp/threshold
Description
Use this API to configure threshold for trap generation of mem_util, cpu_util and disk_util
Method
POST
Request Body
{
"mem_util_threshold":"5",
"cpu_util_threshold":"8",
"disk_util_threshold":"10"
}
Response Body
NA
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/config/snmp/users
Description
Use this API to create the SNMPv3 user
Method
POST
Request Body
{
"username":"testuser6",
"priv_type":"Priv",
"auth":"MD5",
"auth_pwd":"testuser4_auth_pass",
"enc":"AES",
"enc_pwd":"testuser3_encrypt_pass",
"access":"RO"
}
Response Body
NA
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/info/snmp-community
Description
Use this API to get the community details
Method
GET
Request Body
NA
Response Body
{
"public": {
"TYPE": "RO"
}
}
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/info/snmptrap
Description
Use this API to get the SNMP trap details
Method
GET
Request Body
NA
Response Body
{
"1": {
"DestPort": "161",
"v2TrapDest": "Null",
"DestIp": "10.4.4.11",
"vrf": "None",
"Community": "public"
}
}
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/info/snmp/threshold
Description
Use this API to get the details of threshold value for mem_utils, cpu_utils and disk_utils trap generation
Method
GET
Request Body
NA
Response Body
{
"disk_util_threshold": "5", "cpu_util_threshold": "8", "mem_util_threshold": "10"
}
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/info/snmp/users or. /api/info/snmp/users/<user-name>
Description
Use this API to get the SNMPv3 user details
Method
GET
Request Body
NA
Response Body
{
"authuser": {
"SNMP_USER_TYPE": "AuthNoPriv", "SNMP_USER_AUTH_PASSWORD": "authuser", "SNMP_USER_PERMISSION": "RW", "SNMP_USER_ENCRYPTION_TYPE": "", "SNMP_USER_AUTH_TYPE": "MD5", "SNMP_USER_ENCRYPTION_PASSWORD": ""
}
}
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/config/snmp-community/<community-name>
Description
Use this API to delete the configured SNMP community
Method
DELETE
Request Body
NA
Response Body
{
"Info": "SNMP-Community deleted successfully"
}
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/config/snmptrap/<server-id>
Description
Use this API to delete the SNMP trap configured
Method
DELETE
Request Body
NA
Response Body
{
"Info": "SNMP-Trap deleted successfully"
}
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/config/snmp/threshold/disk_util_threshold
/api/config/snmp/threshold/mem_util_threshold
/api/config/snmp/threshold/cpu_util_threshold
Description
Use this API to reset the threshold value for trap generation of mem_utils, cpu_utils and disk_utils
Method
DELETE
Request Body
NA
Response Body
{
"INFO": [
"disk utilization threshold deleted. Default threshold set"
]
}
{
"INFO": [
"memory utilization threshold deleted. Default threshold set"
]
}
{
"INFO": [
"cpu utilization threshold deleted. Default threshold set"
]
}
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully
Request URL
/api/config/snmp/users/<user-name>
Description
Use this API to delete the SNMPv3 user configured
Method
DELETE
Request Body
NA
Response Body
{
"Info": "SNMP User deleted successfully"
}
Status Code
SERVER_ERROR(500) if there is any error with the server
OK(200) if the request is processed successfully