首页 > 解决方案 > SoftLayer_Location/getDatacenters API 对不同数据中心的响应不一致

问题描述

SoftLayer_Location getDatacenter API 及其对Dallas 09San Jose 04数据中心的响应粘贴在下面:

https://api.softlayer.com/rest/v3.1/SoftLayer_Location/getDatacenters.json?objectFilter={"name":{"operation":"dal09"}}&objectMask=mask[groups]

[{ "id": 449494, "longName": "Dallas 9", "name": "dal09", "statusId": 2, "groups": [{ "description": "All Datacenters in the USA", "id": 1, "locationGroupTypeId": 1, "name": "US", "securityLevelId": null, "locationGroupType": { "name": "VDR" } }, { "description": "na-usa-central-1", "id": 22, "locationGroupTypeId": 42, "name": "na-usa-central-1", "securityLevelId": null, "locationGroupType": { "name": "REGIONAL" } }, { "description": "COS Cross Region - US", "id": 1307, "locationGroupTypeId": 82, "name": "us", "securityLevelId": null, "locationGroupType": { "name": "PRICING" } }] }]


https://api.softlayer.com/rest/v3.1/SoftLayer_Location/getDatacenters.json?objectFilter= {"name":{"operation":"sjc04"}}&objectMask=mask[groups]

[{ "id": 2178495, "longName": "San Jose 4", "name": "sjc04", "statusId": 2, "groups": [{ "description": "All Datacenters in the USA", "id": 1, "locationGroupTypeId": 1, "name": "US", "securityLevelId": null, "locationGroupType": { "name": "VDR" } }, { "description": "na-usa-west-2", "id": 64, "locationGroupTypeId": 42, "name": "na-usa-west-2", "securityLevelId": null, "locationGroupType": { "name": "REGIONAL" } }] }]

正如我们所见,这"locationGroupType": {"name": "PRICING"}不是San Jose 04数据中心响应的一部分。华盛顿数据中心也出现了这种情况。

这是我们用来获取与locationGroupId相关的定价的过滤器。但由于此属性不适用于某些数据中心,我们的代码无法获取这些数据中心的定价。这是预期的还是 API 中的某些内容已更改

也提到了Softlayer API 验证订单失败问题,但是在 SoftLayer_Product_Package 的 getItems API 调用中没有看到定价位置组属性。

标签: ibm-cloud-infrastructure

解决方案


推荐阅读