我正在尝试准备一份报告,其中包含在软层上为帐户订购的所有存储。是否有 API 可以检索相同的内容?
1 回答
要列出一个帐户在 SoftLayer 上的所有存储,您可以使用以下休息调用示例:
方法:获取
https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[id,username,capacityGb,guestId,hardwareId,hostId,nasType,storageType]
此请求将向您显示所有网络存储,例如:块存储(耐力,性能),文件存储(耐力,性能),对象存储,Evault 备份。
注意:考虑到 Evault Backup 项目是附加到虚拟服务器的其他类型的存储,它们能够确保您的数据安全地存储在设备外部并在丢失时受到保护(IBM Cloud Backup)。
如果您想单独检索网络存储,例如块存储、文件存储,您可以使用对象过滤器运行以下其余调用示例:
块存储(“nasType”:“ISCSI”)
方法:获取
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”)
方法:获取
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”)
方法:获取
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/ https://sldn.softlayer.com/reference/services/ SoftLayer_Account/getNasNetworkStorage/