REST : suggestions on collecting firmware version details from Softaleyr API

238 Views Asked by At

Is there any way to collect firmware version from all the bare metal servers using slcli command line or using any other API method ?

I have already gone through the following links

https://softlayer.github.io/reference/softlayerapi/

https://softlayer.github.io/reference/datatypes/SoftLayer_Hardware_Component_Firmware/

But it wasn't of much help to me, as I'm new to API scripting.

1

There are 1 best solutions below

1
On BEST ANSWER

The SLCLI allows only to update the firmware, but you should be able to use rest, soap, xmlrpc, python, ruby, java, go, etc., or any other supported language to retrieve this data through object-masks.

Try with the following REST call, it should retrieve the firmware information for a bare metal server:

https://[unserName]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/[baremetalID]/getObject?objectMask=mask[components[hardwareComponentModel[firmwares],revision.firmware]]

Change [unserName], [apiKey], and [baremetalID] with your own information.

For all hardware devices into the account:

https://[userName]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectMask=mask[id,fullyQualifiedDomainName,components[hardwareComponentModel[firmwares],revision.firmware]]

https://softlayer.github.io/reference/services/SoftLayer_Hardware_Server/getObject https://softlayer.github.io/reference/services/SoftLayer_Hardware_Server/getComponents https://softlayer.github.io/reference/services/SoftLayer_Account/getHardware https://softlayer.github.io/reference/datatypes/SoftLayer_Hardware/#components https://softlayer.github.io/reference/datatypes/SoftLayer_Hardware_Server/#components https://softlayer.github.io/reference/datatypes/SoftLayer_Hardware_Component/