理解包项

时间:2017-01-10 18:49:44

标签: api ibm-cloud-infrastructure iscsi

我通过仅查询locationGroupId值为undefined的那些价格条目,运行SL REST API查询以获取240(Endurance iSCSI)软件包的可用项目列表,仅用于公共价格条目。这是我跑的查询:

curl -u:https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItems.json?objectFilter=%7B%22items%22:%7B%22prices%22:%7B%22locationGroupId%22:%7B%22operation%22:%22is%20null%22%7D%7D%7D%7D

我对结果感到有点困惑。这是一段摘录:

...

   {
      "upgradeItemId" : null,
      "description" : "4000 GB Storage Space",
      "capacity" : "4000",
      "keyName" : "4000_GB_PERFORMANCE_STORAGE_SPACE",
      "itemCategory" : {
         "quantityLimit" : 0,
         "name" : "Storage Space",
         "id" : 382,
         "categoryCode" : "performance_storage_space"
      },
      "softwareDescriptionId" : null,
      "id" : 5146,
      "itemTaxCategoryId" : 166,
      "prices" : [
         {
            "recurringFee" : "58",
            "setupFee" : "0",
            "quantity" : null,
            "packageReferences" : [
               {
                  "packageId" : 240,
                  "id" : 386831,
                  "itemPriceId" : 46625
               }
            ],
            "onSaleFlag" : null,
            "oneTimeFee" : "0",
            "itemId" : 5146,
            "sort" : 10,
            "currentPriceFlag" : null,
            "laborFee" : "0",
            "id" : 46625,
            "locationGroupId" : null
         },
         {
            "recurringFee" : "145",
            "setupFee" : "0",
            "quantity" : null,
            "packageReferences" : [
               {
                  "packageId" : 240,
                  "id" : 385796,
                  "itemPriceId" : 46096
               }
            ],
            "onSaleFlag" : null,
            "oneTimeFee" : "0",
            "itemId" : 5146,
            "sort" : 10,
            "currentPriceFlag" : null,
            "laborFee" : "0",
            "id" : 46096,
            "locationGroupId" : null
         },
         {
            "recurringFee" : "290",
            "setupFee" : "0",
            "quantity" : null,
            "packageReferences" : [
               {
                  "packageId" : 240,
                  "id" : 385806,
                  "itemPriceId" : 46106
               }
            ],
            "onSaleFlag" : null,
            "oneTimeFee" : "0",
            "itemId" : 5146,
            "sort" : 10,
            "currentPriceFlag" : null,
            "laborFee" : "0",
            "id" : 46106,
            "locationGroupId" : null
         },
         {
            "recurringFee" : "290",
            "setupFee" : "0",
            "quantity" : null,
            "packageReferences" : [
               {
                  "packageId" : 240,
                  "id" : 383598,
                  "itemPriceId" : 45364
               }
            ],
            "onSaleFlag" : null,
            "oneTimeFee" : "0",
            "itemId" : 5146,
            "sort" : 10,
            "currentPriceFlag" : null,
            "laborFee" : "0",
            "id" : 45364,
            "locationGroupId" : null
         },
         {
            "recurringFee" : "362.5",
            "setupFee" : "0",
            "quantity" : null,
            "packageReferences" : [
               {
                  "packageId" : 240,
                  "id" : 386841,
                  "itemPriceId" : 46635
               }
            ],
            "onSaleFlag" : null,
            "oneTimeFee" : "0",
            "itemId" : 5146,
            "sort" : 10,
            "currentPriceFlag" : null,
            "laborFee" : "0",
            "id" : 46635,
            "locationGroupId" : null
         },
         {
            "recurringFee" : "435",
            "setupFee" : "0",
            "quantity" : null,
            "packageReferences" : [
               {
                  "packageId" : 240,
                  "id" : 385816,
                  "itemPriceId" : 46116
               }
            ],
            "onSaleFlag" : null,
            "oneTimeFee" : "0",
            "itemId" : 5146,
            "sort" : 10,
            "currentPriceFlag" : null,
            "laborFee" : "0",
            "id" : 46116,
            "locationGroupId" : null
         },
         {
            "recurringFee" : "580",
            "setupFee" : "0",
            "quantity" : null,
            "packageReferences" : [
               {
                  "packageId" : 240,
                  "id" : 383608,
                  "itemPriceId" : 45374
               }
            ],
            "onSaleFlag" : null,
            "oneTimeFee" : "0",
            "itemId" : 5146,
            "sort" : 10,
            "currentPriceFlag" : null,
            "laborFee" : "0",
            "id" : 45374,
            "locationGroupId" : null
         },
         {
            "recurringFee" : "580",
            "setupFee" : "0",
            "quantity" : null,
            "packageReferences" : [
               {
                  "packageId" : 240,
                  "id" : 1302339,
                  "itemPriceId" : 183991
               }
            ],
            "onSaleFlag" : null,
            "oneTimeFee" : "0",
            "itemId" : 5146,
            "sort" : 10,
            "currentPriceFlag" : null,
            "laborFee" : "0",
            "id" : 183991,
            "locationGroupId" : null
         },
         {
            "recurringFee" : "725",
            "setupFee" : "0",
            "quantity" : null,
            "packageReferences" : [
               {
                  "packageId" : 240,
                  "id" : 386851,
                  "itemPriceId" : 46645
               }
            ],
            "onSaleFlag" : null,
            "oneTimeFee" : "0",
            "itemId" : 5146,
            "sort" : 10,
            "currentPriceFlag" : null,
            "laborFee" : "0",
            "id" : 46645,
            "locationGroupId" : null
         },
         {
            "recurringFee" : "1015",
            "setupFee" : "0",
            "quantity" : null,
            "packageReferences" : [
               {
                  "packageId" : 240,
                  "id" : 383618,
                  "itemPriceId" : 45384
               }
            ],
            "onSaleFlag" : null,
            "oneTimeFee" : "0",
            "itemId" : 5146,
            "sort" : 10,
            "currentPriceFlag" : null,
            "laborFee" : "0",
            "id" : 45384,
            "locationGroupId" : null
         },
         {
            "recurringFee" : "1450",
            "setupFee" : "0",
            "quantity" : null,
            "packageReferences" : [
               {
                  "packageId" : 240,
                  "id" : 1300099,
                  "itemPriceId" : 181751
               }
            ],
            "onSaleFlag" : null,
            "oneTimeFee" : "0",
            "itemId" : 5146,
            "sort" : 10,
            "currentPriceFlag" : null,
            "laborFee" : "0",
            "id" : 181751,
            "locationGroupId" : null
         },
         {
            "recurringFee" : "1682",
            "setupFee" : "0",
            "quantity" : null,
            "packageReferences" : [
               {
                  "packageId" : 240,
                  "id" : 1295927,
                  "itemPriceId" : 178645
               }
            ],
            "onSaleFlag" : null,
            "oneTimeFee" : "0",
            "itemId" : 5146,
            "sort" : 10,
            "currentPriceFlag" : null,
            "laborFee" : "0",
            "id" : 178645,
            "locationGroupId" : null
         }
      ],
      "units" : "GB"
   },
...

对于此项目," 4000_GB_PERFORMANCE_STORAGE_SPACE",有多个价格ID,其locationGroupId未定义。我能看到的唯一不同的是recurringFee值。我不明白这些价格中的哪一个可供选择。我觉得我应该选择最便宜的一个,但我认为还有其他一些区别,但我不知道它是什么。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

这些价​​格有不同的类别,例如它们可以是:

  • 性能存储复制
  • 存储快照空间
  • 存储空间
  • 存储复制

您需要根据您想要的订单使用价格,您还需要考虑这些价格的容量( capacityRestrictionMaximum capacityRestrictionMinimum 属性)< / p>

要获取此类信息,您需要添加一个类似下面的休息请求的掩码:

https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItems.json?objectFilter={"items":{"prices":{"locationGroupId":{"operation":"is null"}}}}&objectMask=mask[prices[categories]]

Method: Get

编码:

https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItems.json?objectFilter=%7B%22items%22%3A%7B%22prices%22%3A%7B%22locationGroupId%22%3A%7B%22operation%22%3A%22is+null%22%7D%7D%7D%7D&objectMask=mask%5Bprices%5Bcategories%5D%5D

Method: Get

<强>参考文献: