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

前端 未结 1 506
一生所求
一生所求 2020-12-22 07:40

I need to implement placing order for endurance storage in my Application using BPM over ICO (IBM Cloud Orchestrator) dynamically.

I needed followi

相关标签:
1条回答
  • 2020-12-22 08:11

    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)

    0 讨论(0)
提交回复
热议问题