用于列出用户的所有Performance Storages的API

问题描述:

我是softlayer的新用户。我们需要为用户提供所有的性能存储,以便通过选择其中的任何一个,我们可以获得相应的虚拟机ID以用于存储授权。请帮助我,因为我在过去4-5天里一直在挣扎。提前致谢。用于列出用户的所有Performance Storages的API

请尝试以下REST请求:

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)

更新1:

上述要求,您可以根据自己想要的应用几个过滤器。您只需根据需要添加/删除过滤器。 如果你只需要通过过滤“用户”相关联的存储卷,一些过滤器应该被删除以前的请求,例如:

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 Backup。如果你想要一个特定的Storage type,你可以添加一个额外的过滤器。

此外,如果你只想要列表过滤通过user“块存储”项目,您可以使用其他方法太:

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

Method: GET 

列表“Filke存储”项目由用户过滤:

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

+0

我们需要有一个用户的所有存储ID ...请帮助.. –

+0

我添加了一些请求可以帮助你。但是,我以前发给你的第一个请求应该是以'user'过滤所有'存储卷'的基础。 – mcruz