问题描述
我是softlayer的新手.我们需要拥有一个用户的所有性能存储,以便通过选择其中的任何一个,我们可以获取相应的虚拟机ID来授权存储.请帮助我,因为我在过去4-5天中一直在努力.预先感谢.
I am new to softlayer. We need to have all the performance storages for a user so that by selecting any of these we can get corresponding Virtual Machine Id for authorizing with storage. Please help me as I am struggling in same for last 4-5 days. Thanks in advance.
推荐答案
请尝试以下Rest请求:
Please, try the following Rest request:
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
其中:该请求将帮助您获取由type
(块存储(性能))和username
过滤的Network Storage
项.另外,为了获得有效的可用虚拟访客进行授权,在对象掩码中添加了allowedVirtualGuests
属性.
Where:This request will help you to get "Network Storage"
items filtered by type
(Block Storage (Performance)) and "username"
. Also to get valid available virtual guests to authorize, "allowedVirtualGuests"
property was added in the object mask.
一些参考文献:
SoftLayer_Account :: getNetworkStorage
上述请求使您可以根据需要应用多个过滤器.您只需要根据需要添加/删除过滤器.如果仅通过过滤用户"需要关联的存储卷,则应将某些过滤器删除到上一个请求,例如:
The above request allows you to apply several filters according what you want. You only need to add/remove the filters according to your needs.If you need associated storage volumes only by filtering "user", some filters should be removed to the previous request, for example:
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
,则可以添加其他过滤器.
Notice that all associated storage volumes are a set of: File Storage, Block storage, Object Storage, Evault Backup. If you want to a specific Storage type
, you can add an additional filter.
此外,如果您只想列出由 user
过滤的块存储" 项目,则也可以使用其他方法:
Additionally, if you want only list "Block Storage" items filtered by user
, you can use other method too:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getIscsiNetworkStorage?objectFilter={ "iscsiNetworkStorage": { "billingItem": { "orderItem": { "order": { "userRecord": { "username": { "operation": "myUserName" } } } } } } }
Method: GET
列出按用户过滤的"Filke Storage"项目:
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
这篇关于用于为用户列出所有性能存储的API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!