How to find location of an EVault using SoftLayer API?

荒凉一梦 提交于 2020-01-11 13:23:14

问题


I see there is SoftLayer_Account::getEvaultNetworkStorage() to get a list of my EVault storages. However, using the information that I have, I cannot figure out the location of a particular EVault. Below is the type of information I get from getEvaultNetworkStorage():

   {
      "accountId" : 7xxx,
      "capacityGb" : 30,
      "createDate" : "2016-xxx",
      "guestId" : 14xxx,
      "hardwareId" : null,
      "hostId" : 14xxx,
      "id" : 83xxx,
      "nasType" : "EVAULT",
      "password" : "Bxxx",
      "serviceProviderId" : 1,
      "serviceResourceBackendIpAddress" : "ev-xxx.service.softlayer.com",
      "serviceResourceName" : "ev-xxx.service.softlayer.com",
      "storageTypeId" : "19",
      "upgradableFlag" : true,
      "username" : "IBMxxx"
   },

I don't see any other useful Object Filter to set either.

Using SoftLayer_Network_Storage_Backup_Evault::getObject() gives same type of information and there are no APIs that gives me the location information. And I need the location ID in order to order an EVault plugin programmatically.

Any ideas?


回答1:


Try the following to get the Evault location using masks:

Option 1:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getEvaultNetworkStorage?objectMask=mask[id, serviceResourceName,guestId,billingItem[id,location]]

Method: GET

Option 2:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage_Backup_Evault/[Evault_id]/getObject?objectMask=mask[billingItem[id,location]]

Method: GET

Also, to get valid locations for Evault orders, I suggest you to use the following request:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/0/getItemPrices?objectMask=mask[id,locationGroupId,item[id,keyName,description],pricingLocationGroup[locations[id, name, longName]]]&objectFilter={   "itemPrices": {     "item": {       "keyName": {         "operation": "*=EVAULT"       }     }   } }

Method: GET

Note: A price id with a locationGroupId = null is considered as "a standard price" and the API will internally switch the prices for the customer. But we recommend first to execute first the verifyOrder in order to see if the wanted order is ok (the fee can vary).

To get more information about prices and locations, please review:

http://sldn.softlayer.com/blog/cmporter/Location-based-Pricing-and-You

References:

http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getItemPrices

I hope this information help you.



来源:https://stackoverflow.com/questions/34641103/how-to-find-location-of-an-evault-using-softlayer-api

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