How to fetch LocationID, Storage Package ID, Storage Size ID and SnapShot Space Size ID for placing order in Endurance Storage

Deadly 提交于 2019-11-29 17:28:54
mcruz

To get the valid prices for all configuration Endurance items, you can use SoftLayer_Product_Package::getItemPrices.

To know what package Endurance (PackageId = 240 ) is using, please see:

https://[username]:[apikey]@api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/getAllObjects

Method: GET

This is an example:

Package to use = 240
Storage Type: Endurance
Location: Dal06
Storage Package: 0.25 IOPS/GB
Storage Size: 40GB
Snapshot Space Size: 5GB
OS Type: Linux

REST example:

{
  "parameters": [
    {
      "location": 154820, 
      "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": 45148   # 40 GB Storage Space
        },
        {
          "id": 46120   # 5 GB Storage Snapshot Space
        }
      ],
      "quantity": 1
    }
  ]
}

To get the above ids, we can use some filters for better understanding:

-Getting ** Storage Type**: "id": 45058 # Endurance Storage:

https://[username]:[apikey]@api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/240/getItemPrices?objectFilter={"itemPrices": {"categories": {"categoryCode": {"operation": "storage_service_enterprise"}}}}&objectMask=mask[id,categories,item[keyName,description],pricingLocationGroup[locations[id, name, longName]]]

Method: GET

Where we are filtering by : categoryCode

  • Getting id for “Block Storage” or “File Storage”, we choose Block Storage:

"id": 45098 # Block Storage

The filter will be changed to:

objectFilter={"itemPrices": {"categories": {"categoryCode": {"operation": "storage_block"}}}}
  • Getting available ids for Storage Package:

i.e.: "id": 45068 # 0.25 IOPS per GB

The filter to use is: "categoryCode": "storage_tier_level"

objectFilter={"itemPrices": {"categories": {"categoryCode": {"operation": "storage_tier_level"}}}}&objectMask=mask[id,categories,item[keyName,description],pricingLocationGroup[locations[id, name, longName]]]
  • Getting Storage Size:

Filter to use: "categoryCode": "performance_storage_space"

objectFilter={"itemPrices": {"categories": {"categoryCode": {"operation": "performance_storage_space"}}}}&objectMask=mask[id,categories,item[keyName,description],pricingLocationGroup[locations[id, name, longName]]]
  • Getting Snapshot Space Size:

Filter to use: "categoryCode": "storage_snapshot_space"

objectFilter={"itemPrices": {"categories": {"categoryCode": {"operation": "storage_snapshot_space"}}}}

Some references:

API for Performance and Endurance storage(Block storage)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!