如何获得给定软件包的SoftLayer数据中心的正确列表? [英] How to get the proper list of SoftLayer datacenters for a given package?
问题描述
我正在构建用于订购硬件的应用程序,但我发现对于给定的包ID,无法获得相同的可用数据中心列表.我当前正在使用getRegions()
,它应该返回给定包可用的数据中心列表.但是,我发现它与在SoftLayer门户中看到的有所不同.例如,对于253程序包,我得到28个数据中心.但是,如果我尝试从SL门户手动下订单和订购,则不存在这28个(只是其中的一部分).
I'm building an application for ordering hardware and I've seen that I can't get the same list of available datacenters for a given package id. I'm currently using getRegions()
which it is supposed to return the list of datacenter where the given package is available. However, I have seen that it differs from what I can see in the SoftLayer portal. For instance, for the package 253, I get 28 datacenters. However, if I try to place and order manually from the SL portal, those 28 are not present (just a subset of them).
我以为我必须查询其他内容,例如isAvailable
或deliveryTimeInformation.在所有情况下,isAvailable
看起来都是1,除了空列表之外,我没有得到deliveryTimeInformation
的值.
I imagined that I had to query something else like isAvailable
or deliveryTimeInformation. isAvailable
looks to be 1 in all cases and I can't get a value for deliveryTimeInformation
other than an empty list.
我的问题是:有什么方法可以使用API获得与您在SL门户中显示的数据中心列表相同的数据?
My question is: is there any way to get the same datacenter list you guys show in the SL portal using the API?
推荐答案
您使用的方法是正确的,但是您必须考虑到不同的包装可能具有相同的产品名称,而一个包装可能是每月包装还有一个每小时一包.
The method that you’re using is correct, but you have to consider that different packages might have the same product item names, whereas one might be a monthly package and another one an hourly package.
确保您正在通过UI查看正确的商品和包装.您可以在用户界面列表中单击价格,然后检查是否正确将您重定向到包含253号的URL,以验证此价格.
Make sure you're viewing the correct item and package through UI. You could verify this clicking a price in the UI list and checking if it correctly redirects you to a URL that contains a 253 number.
此外,在27个数据中心中允许使用253软件包,您可以使用下一个请求进行验证:
Furthermore, package 253 is allowed in 27 data centers, you can verify using the next request:
https://$username:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package_Server/getAllObjects.json?objectFilter={"packageId":{"operation":253}}
下一个请求可以帮助您验证是否在多个软件包中包含processorName"Intel Xeon E5-2650 v3",其中一个是253.
The next request could help you to verify that the processorName "Intel Xeon E5-2650 v3" is contained in more than a single package, one of them is the 253.
https://$username:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package_Server/getAllObjects.json?objectFilter={"processorName":{"operation":"Intel Xeon E5-2650 v3"}}
此外,此链接也可能对您有帮助:
Additionally this link might help you as well:
这篇关于如何获得给定软件包的SoftLayer数据中心的正确列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!