订购加密的块存储

时间:2018-03-13 19:12:18

标签: ibm-cloud-infrastructure block-storage

我正在尝试订购250 Gb 3000 IOPS加密块存储。使用请求:

{"parameters": [{
"complexType":"SoftLayer_Container_Product_Order_Network_Storage_AsAService",
"packageId": 759,
"location": 957095,
"quantity": 1,
"iops":3000,
"prices": [ 
        { "id": 189439},
        { "id": 196039},            
        {"id": 196099}, 
        {"id":189939}],
"volumeSize": 250,
 "osFormatType":{  
        "id":24,
        "keyName":"WINDOWS_2008"
        }
}
]}

验证订单返回的错误是:

{
    "error": "Undefined storage type",
"code": "SoftLayer_Exception_Public"
}

我选择的项目是否存在不匹配?或者订单中的其他内容?

1 个答案:

答案 0 :(得分:0)

错误在物品的价格中。

以下是一个示例,如何通过rest api放置块存储顺序。

方法:POST

https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Product_Order/verifyOrder

身体:Json

{

"parameters": [
                {
                   "complexType": "SoftLayer_Container_Product_Order_Network_Storage_AsAService",
                   "location": 265592,
                   "packageId": 759,
                   "prices": [
                               {
                                 "id": 189433
                               },
                               {
                                 "id": 189443
                               },
                               {
                                 "id": 189833
                               },
                               {
                                 "id": 189893
                               }
                             ],
                   "quantity": 1,
                   "iops": 3000,
                   "osFormatType":{
                                    "id": 24,
                                    "keyName": "WINDOWS_2008"
                                  },
                   "volumeSize": 250
                 }
            ] }

•这是项目价格的categoryCode和描述:

“id”:189433(categoryCode:storage_as_a_service,            “description”:“存储即服务”)

“id”:189443(categoryCode:storage_block,            “description”:“Block Storage”)

“id”:189833(categoryCode:performance_storage_space,            “description”:“100 - 499 GBs”)

“id”:189893(categoryCode:performance_storage_iops,            “description”:“100 - 6000 IOPS”)

•您可以找到商品价格的ID,通过“描述”值在此休息API中搜索:

方法:GET

https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/759/getItemPrices?objectMask=mask[id,locationGroupId,item[id,keyName,description],pricingLocationGroup[locations[id,name,longName]]]

例如“description”:“存储即服务”

{

    "id": 189433,
    "locationGroupId": null,
    "item": {
        "description": "Storage as a Service",
        "id": 9571,
        "keyName": "STORAGE_AS_A_SERVICE"
    }
}

例如“description”:“100 - 499 GB”您会找到相同的选项,但您必须选择所需的位置依赖。

在我的例子中,我选择了“阿姆斯特丹1”而“id”将是“id”:189833

{

    "id": 189833,
    "locationGroupId": 503,
    "item": {
        "description": "100 - 499 GBs",
        "id": 9585,
        "keyName": "100_499_GBS"
    },
    "pricingLocationGroup": {
        "description": "Location Group 2",
        "id": 503,
        "locationGroupTypeId": 82,
        "name": "Location Group 2",
        "securityLevelId": null,
        "locations": [
            {
                "id": 449610,
                "longName": "Montreal 1",
                "name": "mon01"
            },
            {
                "id": 449618,
                "longName": "Montreal 2",
                "name": "mon02"
            },
            {
                "id": 448994,
                "longName": "Toronto 1",
                "name": "tor01"
            },
            {
                "id": 350993,
                "longName": "Toronto 2",
                "name": "tor02"
            },
            {
                "id": 221894,
                "longName": "Amsterdam 2",
                "name": "ams02"
            },
            {
                "id": 265592,
                "longName": "Amsterdam 1",
                "name": "ams01"
            },
            {
                "id": 814994,
                "longName": "Amsterdam 3",
                "name": "ams03"
            }
        ]
    }
},

项目价格的其余部分也是如此。