要订购 Endurance,请执行:
配置:
Package to use = 240
Storage Type: Endurance
Location: Dal06
Storage Package: 0.25 IOPS/GB
Storage Size: 20GB
Snapshot Space Size: 0GB
OS Type: Linux
URL:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder
方法:邮寄
Json 有效负载:
{
"parameters": [
{
"location": 154820, //Dallas 06
"packageId": 240,
"osFormatType": {
"id": 12,
"keyName": "LINUX"
},
"complexType": "SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
"prices": [
{
"id": 45058 # Endurance Storage
},
{
"id": 45098 # Block Storage
},
{
"id": 45068 # 0.25 IOPS per GB
},
{
"id": 45118 # 20 GB Storage Space
},
{
"id": 46120 # 5 GB Storage Space - Snapshot
}
],
"quantity": 1
}
]
}
Notes:
- 配置准备好后,从“verifyOrder”方法更改为“placeOrder”
- 删除价格 id 中设置的注释以获取有效的 Json(例如删除 --> # Endurance Storage)
如何获得订购耐久性/性能存储的有效商品价格?
根据要使用的包执行以下操作:
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).
订购性能存储:
配置:
Package to use: 222
Storage Type: Performance
Location: Dallas 06
Storage Size: 20GB – 100 to 1000 IOPS
Specify IOPS: 100
Select OS Type: Linux
URL:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder
方法:邮寄
Json 有效负载:
{
"parameters": [
{
"packageId": 222,
"location": 154820,
"osFormatType": {
"id": 12,
"keyName": "LINUX"
},
"complexType": "SoftLayer_Container_Product_Order_Network_PerformanceStorage_Iscsi",
"prices": [
{
"id": 40672 # Block Storage (Performance)
},
{
"id": 40682 # 20 GB Storage Space
},
{
"id": 40792 # 100 IOPS
}
],
"quantity": 1
}
]
}
要授权/允许主机,请执行:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[Storage_id]/allowAccessFromHostList
方法:邮寄
{
"parameters": [
[
{
"id": 13548553,
"objectType": "SoftLayer_Virtual_Guest"
}
]
]
}
上述请求用于授权“Endurance”和“Performance”
如果您想授权“虚拟访客”,“IP地址” or “Hardware”,“objectType”的有效值为:
“SoftLayer_Virtual_Guest”、“SoftLayer_Network_Subnet_IpAddress”、“SoftLayer_Hardware”分别。
参考:
http://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage/allowAccessFromHostList http://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage/allowAccessFromHostList
“网络存储”和 VSI/Bar Metal/子网必须位于同一位置/数据中心。
这些请求帮助我们获得可以授权特定“网络存储”的可用主机,正如我们在门户中看到的那样:
要获取具有关联 IP 地址的有效可用子网,请执行:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[storage_id]/ getAllowableSubnets?objectMask=mask[id,networkIdentifier,cidr,subnetType,ipAddresses[id,ipAddress]]
Method: GET
要获取有效的可用虚拟访客,请执行:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage_Iscsi/[storage_id]/getAllowableVirtualGuests?objectMask=mask[id,fullyQualifiedDomainName]
Method: GET
可用金属棒:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[storage_id]/getAllowableHardware
Method: GET
更新1:
另外,为了得到网络存储名单请见:SoftLayer_Account::getNetworkStorage http://sldn.softlayer.com/reference/services/SoftLayer_Account/getNetworkStorage
这是一个示例,其中结果显示如下属性:“地点” and “网络存储类型” using object Masks
.
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[storageType, billingItem[description,location[id,longName]]]
Method: GET
使用过滤器:
按网络存储类型过滤:“Endurance Storage”
or “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"}}}}
Method: GET
其他链接可能对您有帮助:
用于列出用户的所有性能存储的 API https://stackoverflow.com/questions/35838651/api-for-listing-all-performance-storages-for-a-user