-->

How to find location of an EVault using SoftLayer

2019-03-05 05:39发布

问题:

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.