【发布时间】:2019-08-11 22:40:41
【问题描述】:
我正在尝试准备一份报告,其中包含在软层上为一个帐户订购的所有存储空间。是否有 API 可以检索相同的内容?
【问题讨论】:
标签: ibm-cloud-infrastructure ibm-cloud-storage
我正在尝试准备一份报告,其中包含在软层上为一个帐户订购的所有存储空间。是否有 API 可以检索相同的内容?
【问题讨论】:
标签: ibm-cloud-infrastructure ibm-cloud-storage
要列出一个帐户在 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/
【讨论】: