Softlayer Evault Price Ids

元气小坏坏 提交于 2019-12-12 04:27:34

问题


I am trying to create an evault backup programmatically using soflayer API. I have everything I need except for how to obtain the price id for the evault backup size we need. How can I do that dynamically, or if its not available, just the list of price ids for evault storage sizes?

Ive already looked in documentation and also contacted support which they suggested SO with Softlayer tag.


回答1:


A quick view, perhaps using an object filter through the server's datacenter could work:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/0/getItemPrices?objectMask=mask[categories, pricingLocationGroup[locations]]&objectFilter={"itemPrices":{"categories":{"categoryCode":{"operation":"evault"}}, "pricingLocationGroup":{"locations":{"name":{"operation":"sao01"}}}}}

Method: Get

Replace: "sao01" with the server's datacenter name that you wish to order an evault. In case that it doesn't return any response

Updated

My apologies, we should know that the prices are based on the locations, see the below article to get more information about it:

  • Location-based Pricing and You

The below rest request, will help you to get standard prices for datacenters based on these kind of prices:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/0/getItemPrices?objectMask=mask[categories, pricingLocationGroup[locations]]&objectFilter={"itemPrices":{"categories":{"categoryCode":{"operation":"evault"}}, "locationGroupId":{"operation":"is null"}}}

Method: Get

Also, I can provide a rest request to identify which datacenter is based on standard or location prices:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Location/getDatacenters?objectMask=mask[priceGroups]

Method: Get

The standard prices should be applied for the datacenters which don't have "priceGroups" property/information, for the other datacenters (which have priceGroups), you should use the first request that I provided.



来源:https://stackoverflow.com/questions/38754098/softlayer-evault-price-ids

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