验证耐久性存储中的订单时出现内部服务器错误

时间:2016-03-09 13:46:56

标签: rest ibm-cloud-infrastructure

我正在使用Mozilla海报中的以下REST调用验证订单

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

此调用的jSON有效负载为: -

      {
      "parameters": [
         {
         "location": 138124,  
         "packageId": 240,
         "osFormatType": {
         "id": 12,
         "keyName": "LINUX"
         },
         "complexType": 
           SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
         "prices": [
         {
          "id": 45064   # Endurance Storage
         },
         {
          "id": 45104   # Bloack Storage
         },
         {
          "id": 45074   # 0.25 IOPS/GB
         },
         {
          "id": 45354   # 100 GB Storage space
         },
         {
          "id": 6028    # 5 GB Snapshot space
         }
         ],
         "quantity": 1
        }
         ]
        }

用于拍摄空间的调用是: -

   https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/240/getItemPrices?objectFilter={%22itemPrices%22: {%22categories%22: {%22categoryCode%22: {%22operation%22: %22storage_snapshot_space%22}}}}

但我仍面临着问题。我得到的错误是500内部服务器错误。

请同样帮助我。在此先感谢

1 个答案:

答案 0 :(得分:0)

您的模板中存在一些错误:

  1. 起始引用(“) “SoftLayer_Container_Product_Order_Network_Storage_Enterprise”值 缺少。
  2. 项目价格:“45354”指的是:“2000 GB存储空间”
  3. id:“6028”指的是“itemId”。你应该指定 “价格标识符”(使用SoftLayer_Product_Package::getItemPrices的“id”属性)而不是“itemId”
  4. 试试这个模板:

    {  
       "parameters":[  
          {  
             "location":138124,
             "packageId":240,
             "osFormatType":{  
                "id":12,
                "keyName":"LINUX"
             },
             "complexType":"SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
             "prices":[  
                {  
                   "id":45064  # Endurance Storage
                },
                {  
                   "id":45104  # Block Storage
                },
                {  
                   "id":45074  # 0.25 IOPS/GB  
                },
                {  
                   "id":45214  # 100 GB Storage space
                },
                {  
                   "id":46126  # 5 GB Snapshot space
                }
             ],
             "quantity":1
          }
       ]
    }
    

    一些重要的参考资料: