Platform

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')

Get/Show Platform Summary

Retrieves system detailed device information

node.execute(['show platform summary'])

Output

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

b'{"mac": "80:a2:XX:XX:XX:a7", "platform": "x86_64-accton_asXXXX_XXx-rX", "hostname": "sonic", "type": "LeafRouter", "hwsku": "Accton-AS7712-32X", "buffer_model": "traditional"}'

The below table lists and describes input and output attributes:

Attribute Values Description
"mac" "80:a2:XX:XX:XX:a7" indicates mac address
"platform" "x86_64-accton_asXXXX_XXx-rX" indicates
"hostname" "sonic" indicates platform hostname
"type" "LeafRouter" indicates router protocol
"hwksu" "Accton-AS7712-32X" indicates
"buffer_model" "traditional" indicates

Get/Show Platform Environment Information

Retrieves system developer environment information

node.execute(['show platform environment information'])

Output

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

b'{"Fans": {"Fan 3 Front": "7900", "Fan 1 Rear": "7100", "Fan 5 Front": "8200", "Fan 2 Rear": "7100", "Fan 1 Front": "7600", "Fan 4 Front": "7900", "Fan 6 Rear": "7000", "Fan 5 Rear": "7500", "Fan 2 Front": "7900", "Fan 6 Front": "7800", "Fan 4 Rear": "7300", "Fan 3 Rear": "7200"}, "Platform": {"SONIC_VERSION": "SONiC.master.192-dirty-20230831.072719", "ASIC": "broadcom", "HwSKU": "Accton-AS7712-32X", "SONIC_KERNEL_VERSION": "4.19.0-12-2-amd64", "OPB_NOS_VERSION": "2.6.0", "SONIC_DEBIAN_VERSION": "10.12", "Platform": "x86_64-accton_as7712_32x-r0"}, "Temperature": {"Ambient": {}, "CPU": {"Core0": 39.0, "Core2": 41.0, "Core1": 39.0, "Core3": 41.0}}}'

The below table lists and describes input and output attributes:

Attribute Values Description
"Fans" "Fan *" indicates dev environment fan information
"Platform" "SONIC_VERSION", "ASIC", "HwSKU" indicates platform information
"Temperature" "" indicates environment temperatures

Get/Show SSD Health information

Retrieves SSD health information

node.execute(['show platform ssdhealth'])

Output

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

b'{"ssdhealth": {"Temperature": "100C", "Health": "N/A", "Device Model": "TS64EPTDE1500"}}'

The below table lists and describes input and output attributes:

Attribute Values Description
"Temperature" "100C" indicates SSD temperature
"Health" "N/A" indicates SSD health status
"Device Model" "TSXXXXX" indicates SSD model number

Get/Show Platform PSU Status

Retrieves system PSU information

node.execute(['show platform psustatus'])

Output

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

b'{"PSU_1": {"voltage": "12.234", "led_status": "green", "temp_threshold": "False", "current": "11.421", "model": "\\bYM-2651Y", "power": "139.0", "is_replaceable": "True", "status": "true", "temp": "31.0", "voltage_min_threshold": "11.625", "voltage_max_threshold": "12.359", "presence": "true"}, "PSU_2": {"voltage": "0.0", "led_status": "red", "temp_threshold": "False", "current": "0.0", "model": "", "power": "0.0", "is_replaceable": "True", "status": "false", "temp": "0.0", "voltage_min_threshold": "0.0", "voltage_max_threshold": "0.0", "presence": "true"}}'

Get/Show Platform EEPROM Status

Retrieves system EEPROM information

node.execute(['show platform syseeprom'])

Output

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

b'{{"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"}}'

The below table lists and describes input and output attributes:

Attribute Values Description
"EEPROM_INFO|0xef" {} indicated EEPROM information
"Value" "1C:34:DA:36:F7:80" indicates
"Name" "Base MAC Adddress" indicates
"Len" or "Total Length" "6" indicates available bytes/total bytes
"Value" "" indicates stored EEPROM values
"Vendor Name" "" indicates stored EEPROM vendor name/value

Note: Output of clock API

API will not produce any output unless the below status code in produced, indicating a server error.

Status : 500 -> Response : b'500'