[英]How to find out the price details of any offering in softlayer to put it into API
Suppose I want to purchase a replica of Block storage. 假设我要购买块存储的副本。 I have
scheduleId
& data center Id
with me. 我有
scheduleId
和data center Id
。 How I can find out the price details to put into API while purchasing a replica. 购买副本时,如何查找要放入API的价格详细信息。
Here, 这里,
I have parameters like: 我有这样的参数:
placeorder = {
"complextype": "SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
"packageId": 216,
"location": "AMSTERDAM",
"originVolumeScheduleId": 123,
"originVolumeId": 321,
"prices": [
<Which parameters are necessary here & how we can choose those>
]
I need to know how we can find out the price details with SoftLayer_Product_Package::getItems
method, but I am confused while selecting prices for any offering. 我需要知道如何使用
SoftLayer_Product_Package::getItems
方法查找价格详细信息,但是在为任何产品选择价格时我感到困惑。
When ordering a replica
, we need to set the same items than 'Primary' and add a Storage Replication
item. 订购
replica
,我们需要设置与“主要”相同的项目,并添加一个Storage Replication
项目。
For example, we have an Endurance
with following configured items: 例如,我们有一个具有以下配置项目的
Endurance
:
To see these items through API using StorageId
, please execute the following: 要使用
StorageId
通过API查看这些项目,请执行以下操作:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[storageId]/getBillingItem?objectMask=mask[id,orderItem[id,description,itemPrice.id,order[id,items]]]
Method: GET
Now, to order a replica
, we need to add item prices related to above listed items and add a Storage Replication
item according to chosen Location
. 现在,要订购
replica
,我们需要添加与上面列出的项目相关的项目价格 ,并根据选择的Location
添加Storage Replication
项目。
This is an example to order a replica: 这是订购副本的示例:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder
Note:
Please change “verifyOrder” to “placeOrder” when your order is ready.
In my case, the location chosen is `PARIS`
Method: POST
Json Payload:
{
"parameters": [
{
"location": "PARIS",
"packageId": 240,
"complexType": "SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
"originVolumeId": 6465511,
"originVolumeScheduleId": 33641,
"osFormatType": {
"id": 12,
"keyName": "LINUX"
},
"prices": [
{
"id": 147099 # 20 GB Storage Space (Storage Replication)
},
{
"id": 45058 # Endurance Storage
},
{
"id": 45068 # 0.25 IOPS per GB (Storage Tier Level)
},
{
"id": 45098 # Block Storage
},
{
"id": 144009 # 20 GB Storage Space (Storage Space)
},
{
"id": 143449 # 10 GB Storage Space (Storage Snapshot Space)
}
],
"quantity": 1
}
]
}
To get valid prices according to Endurance package
(packageId = 240), please execute: 要根据
Endurance package
(packageId = 240)获得有效价格,请执行以下操作:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItemPrices?objectMask=mask[id,locationGroupId,item[id,keyName,description],pricingLocationGroup[locations[id, name, longName]]]
Method: GET
Some References: 一些参考:
Location-based-Pricing-and-You 基于位置的定价和您
SoftLayer_Product_Order SoftLayer_Product_Order
SoftLayer_Network_Storage:getBillingItem SoftLayer_Network_Storage:getBillingItem
How to fetch LocationID, Storage Package ID, Storage Size ID and SnapShot Space Size ID for placing order in Endurance Storage 如何获取LocationID,存储包ID,存储大小ID和SnapShot空间大小ID以在Endurance Storage中下订单
I hope this information help you. 希望这些信息对您有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.