System and Platform

Show TACACS Server

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

Configure ZTP

Configure Timezone

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

Show FAN Info

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

Configure ZTP

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

Show NTP

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

Configure NTP

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

Deleting NTP

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

Reboot the device

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

Get Startup or running Configuration

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

Get Device Information

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

Get Platform Environment Information

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

Get Reboot Cause

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

Get ZTP status

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

Get System Uptime

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

Get System Clock information

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

Get System Boot information

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

Get SSD Health information

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

Get Memory Utilization

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

Get CPU Utilization

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

Get Docker Information

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

Get System Process Statistics

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

Get System memory info

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

Get EEPROM Status

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

Get Syslog

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