使用softlayer api获取系统规格与探测机器和获取相同?

时间:2016-05-05 06:15:51

标签: ibm-cloud-infrastructure

Softlayer已经公开了REST API来获取内存,磁盘等系统规范。当我们运行API时,它会探测机器并获取值,或者它将基于订单模板。我的意思是在机器上运行df -h并使用softlayer API获取相同的内容?我想写一个验证脚本来检查是否按照提供的规范配置了机器。所以我正在寻找使用Softlayer API的选项或在机器上运行命令并获取信息。 感谢

1 个答案:

答案 0 :(得分:0)

API将探测机器并获取值,我可以建议使用以下REST请求来获取有关服务器的信息:

虚拟服务器:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/18078091/getObject?objectMask=mask[blockDevices, billingItem, datacenter, localDiskFlag, controlPanel, firewallServiceComponent, networkComponents, operatingSystem, softwareComponents, evaultNetworkStorage, hourlyBillingFlag, monitoringAgents, networkMonitors, networkStorage, antivirusSpywareSoftwareComponent, bandwidthAllocation, networkVlans]

Method: Get

用您自己的值替换:$ user,$ apiKey和18078091

硬件服务器:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/154931/getObject?objectMask=mask[hardDrives, activeComponents, billingItem, datacenter, controlPanel, components, firewallServiceComponent, networkComponents, operatingSystem, softwareComponents, evaultNetworkStorage, hourlyBillingFlag, monitoringAgents, networkMonitors, networkStorage, antivirusSpywareSoftwareComponent, bandwidthAllocation, networkVlans, driveControllers, memory, motherboard, networkCards, powerComponents, processors, remoteManagementComponent, uplinkNetworkComponents]

Method: Get

使用您自己的值替换:$ user,$ apiKey和154931

参考文献:

我希望它有所帮助