-2

slcli有没有办法使用命令行或任何其他 API 方法从所有裸机服务器收集固件版本?

我已经浏览了以下链接

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

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

但这对我没有多大帮助,因为我是 API 脚本的新手。

4

1 回答 1

1

SLCLI 仅允许更新固件,但您应该能够使用 rest、soap、xmlrpc、python、ruby、java、go 等或任何其他支持的语言通过object-masks检索此数据。

尝试使用以下 REST 调用,它应该检索裸机服务器的固件信息:

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

使用您自己的信息更改 [unserName]、[apiKey] 和 [baremetalID]。

将所有硬件设备纳入账户:

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/

于 2018-05-08T15:02:09.313 回答