我是softlayer的新手。我们需要为用户提供所有性能存储,以便通过选择其中任何一个,我们可以获得相应的虚拟机ID以进行存储授权。请帮助我,因为我在过去的4-5天内一直在努力。提前谢谢。
答案 0 :(得分:1)
请尝试以下休息请求:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[id,username,nasType,storageType, allowedVirtualGuests,billingItem[orderItem[id,order[id,userRecord.username]],description,location[id,longName]]]&objectFilter={ "networkStorage": { "nasType": { "operation": "ISCSI" }, "billingItem": { "description": { "operation": "Block Storage (Performance)" }, "orderItem": { "order": { "userRecord": { "username": { "operation": "myUsername" } } } } } } }
Method: GET
其中:
此请求将帮助您获取按”Network Storage”
(块存储(性能))和type
过滤的”username”
项。另外,为了获得有效的可用虚拟客户端进行授权,在对象掩码中添加了”allowedVirtualGuests”
属性。
一些参考文献:
SoftLayer_Account::getNetworkStorage
API for Performance and Endurance storage(Block storage)
上述请求允许您根据需要应用多个过滤器。您只需根据需要添加/删除过滤器。 如果仅通过过滤“user”需要关联的存储卷,则应将某些过滤器移除到先前的请求,例如:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[id,username,nasType,storageType, billingItem[orderItem[id,order[id,userRecord.username]],description,location[id,longName]]]&objectFilter={ "networkStorage": { "billingItem": { "orderItem": { "order": { "userRecord": { "username": { "operation": "myUsername" } } } } } } }
Method: GET
请注意,所有关联的存储卷都是一组:文件存储,块存储,对象存储,Evault备份。如果您想要特定的Storage type
,则可以添加其他过滤器。
此外,如果您只想列出 user
过滤的“Block Storage”项目,您也可以使用其他方法:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getIscsiNetworkStorage?objectFilter={ "iscsiNetworkStorage": { "billingItem": { "orderItem": { "order": { "userRecord": { "username": { "operation": "myUserName" } } } } } } }
Method: GET
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNasNetworkStorage?objectFilter={ "nasNetworkStorage": { "billingItem": { "orderItem": { "order": { "userRecord": { "username": { "operation": "myUserName" } } } } } } }
Method: GET
参考文献:
SoftLayer_Account::getIscsiNetworkStorage
SoftLayer_Account::getNasNetworkStorage