此REST调用显示具有CPU,内存,存储的VM列表...如何总计总存储量而不是显示单个磁盘大小?
https://APIID:Key@api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests?objectMask=mask[id,hostname,primaryIpAddress,primaryBackendIpAddress,maxCpu,maxMemory,domain,fullyQualifiedDomainName,createDate,operatingSystem[id,softwareDescription[longDescription]],networkVlans[vlanNumber,primarySubnetId,name],datacenter[name],powerState[keyName],blockDevices[id,mountType,diskImage[capacity]]]
谢谢Behzad
2 回答
考虑到REST请求仅用于检索每个datatype object的数据,这意味着您无法通过REST执行任何计算 .
为了获得总存储空间,我建议您使用SoftLayer支持的语言,如Python,Java,C#,Ruby,Golang等 . 见Softlayer API Overview
这个python应该适合你 .
会输出这样的东西: