我们是 DST India 团队的一员,目前我们正在为客户提供一项产品,我们正在尝试使用 SoftLayer 提供的 REST API 将性能和耐久性存储功能(SoftLayer)集成到 ICO 中。我已经浏览了 SoftLayer 文档,但找不到相同的内容。
那么,您能否向我们提供以下信息?
- 请提供用于创建耐力存储的 API(以及 所需参数)
- 请提供用于创建性能的API 存储(以及所需的参数)
- 请提供API 用于连接耐力存储(以及所需的参数)
- 请提供用于附加性能存储的 API(以及 所需参数)
最佳答案
要订购耐力,请执行:
配置:
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
网址:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder
方法:POST
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
}
]
}
注释:
- 配置准备就绪后,从“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
网址:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder
方法:POST
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
方法:POST
{
"parameters": [
[
{
"id": 13548553,
"objectType": "SoftLayer_Virtual_Guest"
}
]
]
}
以上请求用于授权“Endurance”和“Performance” 如果您想授权“Virtual Guest”、“IpAddress”或“Hardware”,“objectType”的有效值为:
分别为“SoftLayer_Virtual_Guest”、“SoftLayer_Network_Subnet_IpAddress”、“SoftLayer_Hardware”。
引用:
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
这是一个示例,其中结果使用对象掩码
显示如下属性:“位置”和“网络存储类型”。
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[storageType, billingItem[description,location[id,longName]]]
Method: GET
使用过滤器:
按网络存储类型过滤:“持久存储”
或 “ block 存储(性能)”
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
其他链接可能对您有帮助:
关于asp.net-web-api - 性能和耐久性存储API( block 存储),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35454059/