API for Listing All Performance Storages for a user

半腔热情 提交于 2019-12-11 12:20:01

问题


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.


回答1:


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

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.

Some references:

SoftLayer_Account::getNetworkStorage

API for Performance and Endurance storage(Block storage)

Update 1:

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

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.

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

List “Filke Storage” items filtered by user:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNasNetworkStorage?objectFilter={   "nasNetworkStorage": {     "billingItem": {       "orderItem": {         "order": {           "userRecord": {             "username": {               "operation": "myUserName"             }           }         }       }     }   } }

Method: GET

References:

SoftLayer_Account::getIscsiNetworkStorage
SoftLayer_Account::getNasNetworkStorage



来源:https://stackoverflow.com/questions/35838651/api-for-listing-all-performance-storages-for-a-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!