System and Platform
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 |
|
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 |
|
Firmware upgrade
Request URL | /api/config/system |
Description | API to upgrade the firmware os |
Method | POST |
Request Body | { "action": “firmware-upgrade” "protocol":“scp” "serverip":"server ip address", "firmware_file":"file name with path", "username":"", "passwd":"” } |
Response Body | NA |
Status Code |
|
Set Startup Configuration
Request URL | /api/config/system |
Description | Apply configuration |
Method | POST |
Request Body | { "action": "config_save" or “config_upload” "protocol":"tftp" or “scp” or “http”, "serverip":"", "config_file":"", "username":"", "passwd":"” }
|
Response Body | NA |
Status Code |
|
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 |
|
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 |
|
Get Platform Environment Information
Request URL | /api/info/devenvs |
Description | This API is used to retrieve the dev environment information |
Method | GET |
Request Body | NA |
Response Body | { "Temperature": { "Ambient": {}, "CPU": { "Core1": 19.0, "Core0": 19.0, "Core3": 21.0, |
"Core2": 21.0 } }, "Platform": { "ASIC": "mellanox", "SONIC_KERNEL_VERSION": "4.9.0-14-2-amd64", "Platform": "x86_64-mlnx_msn2100-r0", "HwSKU": "ACS-MSN2100", "SONIC_DEBIAN_VERSION": "9.13", "SONIC_VERSION": "SONiC.master.0-dirty-20210401.133254" }, "Fans": {} } | |
Status code |
|
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": "\rUser issued 'reboot' command [User: admin, Time: Thu Apr 8 10:47:12 UTC 2021]\r\n\r" } |
Status code |
|
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 |
|
Get System Uptime
Request URL | /api/info/sysuptime |
Description | Use this GET-API to get the uptime of the system |
Method | GET/ |
Request Body | NA |
Response Body | { "uptime": "up 35 minutes" } |
Status code |
|
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 | { "uptime": "\rThuApr 8 12:08:52 UTC 2021\r\n\r" } |
Status code |
|
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": "\rCurrent: SONiC-OS-master.0-dirty-20210401.133254\r\nNext: SONiC-OS-master.0-dirty-20210401.133254\r\nAvailable: \r\nSONiC-OS-master.0-dirty-20210401.133254\r\n\r\n\r" } |
Status code |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
Get Syslog
Request URL | /api/info/syslog /api/info/syslog?time="matching string" /api/info/syslog?severity=info|notice|warning|err /api/info/syslog?component="matching string" Note: Use ‘%23’ instead of ‘#’ in the component match string Eg:/api/info/syslog?component="syncd%23SDK” to search for string “syncd#SDK” |
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 |
|
Last updated