如果您想订购新的“网络存储”并了解此项目可用的“位置”,请参阅以下步骤:
1. 我们需要知道的第一个是用于此订单的“包裹 ID”。
“包 id”对于验证和验证哪些物品、哪些位置目前可用于订购网络存储非常重要。
例如:
Storage Type: Endurance, the package to use is “240”
Storage Type: Performance, the package to use is “222”
要获取所有活动包,请查看:
http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getAllObjects
2.一旦我们知道要使用什么包,我们需要根据LOCATION获取有效的“item price ids”。以下请求可以帮助我们:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/[package_id]/getItemPrices?objectMask=mask[id,item[keyName,description],pricingLocationGroup[locations[id, name, longName]]]
Method: GET
Where:
A price id with a locationGroupId = null is considered "A standard price" and the API will internally switch the prices for the customer. But we recommend to execute first the verifyOrder in order to see if the wanted order is ok (the fee can vary).
参考:http://sldn.softlayer.com/blog/cmporter/Location-based-Pricing-and-You
此外,此方法可以帮助您获取特定包裹的可用位置:
http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getRegions
3.然后您就可以订购新的网络存储,请参阅:
API for Performance and Endurance storage(Block storage)
现在,如果您想列出您帐户的网络存储,请参阅:
http://sldn.softlayer.com/reference/services/SoftLayer_Account/getNetworkStorage
这是一个示例,结果显示如下属性:“位置”和“网络存储类型”。
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[storageType, billingItem[description,location[id,longName]]]
使用过滤器:
按网络存储类型过滤:“Endurance Storage” 或 “Block Storage (Performance)”
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[id,username,nasType,storageType, billingItem[description,location[id,longName]]]&objectFilter={"networkStorage":{"nasType":{"operation":"ISCSI"},"billingItem":{"description":{"operation":"Endurance Storage"}}}}
问候。