我正在尝试准备一份报告,其中包含在软层上为某个帐户订购的所有存储。是否有API可以检索相同的内容?
答案 0 :(得分:0)
要列出一个帐户在SoftLayer上的所有存储,可以使用以下rest调用示例:
方法:GET
https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[id,username,capacityGb,guestId,hardwareId,hostId,nasType,storageType]
此请求将向您显示所有网络存储,例如:块存储(耐用性,性能),文件存储(耐用性,性能),对象存储,Evault备份。
注意:考虑到Evault Backup项目是连接到虚拟服务器的其他类型的存储,它们能够确保您的数据安全地存储在设备外部,并在丢失时受到保护({{3} }。
如果要单独检索网络存储,例如块存储,文件存储,您可以使用对象过滤器运行以下rest调用示例:
块存储(“ nasType”:“ ISCSI”)
方法:GET
https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[id,username,capacityGb,guestId,hardwareId,hostId,nasType,storageType]&objectFilter={"networkStorage": {"nasType": {"operation": "ISCSI"}}}
文件存储(“ nasType”:“ NAS”)
方法:GET
https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[id,username,capacityGb,guestId,hardwareId,hostId,nasType,storageType]&objectFilter={"networkStorage": {"nasType": {"operation": "NAS"}}}
对象存储(“ nasType”:“ HUB”)
方法:GET
https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[id,username,capacityGb,guestId,hardwareId,hostId,nasType,storageType]&objectFilter={"networkStorage": {"nasType": {"operation": "HUB"}}}
参考:
或者您可以对每个存储选项使用以下特定方法:
https://sldn.softlayer.com/reference/services/SoftLayer_Account/getNetworkStorage/ https://sldn.softlayer.com/reference/services/SoftLayer_Account/getHubNetworkStorage/ https://sldn.softlayer.com/reference/services/SoftLayer_Account/getIscsiNetworkStorage/