0

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

I needed following parameters for creating rest call for placing order

  1. Package to use
  2. Storage Type
  3. Location
  4. Storage Package (IOPS/GB)
  5. Storage Size
  6. Snapshot Space Size
  7. OS Type

    1. Package to use:- I already know package value for endurance is 240.

    2. Storage Type:- For endurance storage what will be numeric id for endurance What rest call will help in this..?

    3. Location:- This Rest call gives me locations ID:-

    https:[username]:[apiKey]api.softlayer.com/rest /v3.1/SoftLayer_Product_Package/240/getRegions.json

    1. Storage Package:- For Endurance I found only these 3 options in storage package :-
      • 0.25 IOPS/GB
      • 2 IOPS/GB
      • 4 IOPS/GB

    How will I get id for these three..?

    1. Storage Size:-

    For storage size id I used a rest call :-

    https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItemPrices?objectMask=mask[id,item[keyName,description],pricingLocationGroup[locations[id, name, longName]]]&objectFilter={"items":{"prices":{"pricingLocationGroup":{"locations":{"item":{"operation":"loc_code"}}}}}}

    Is there any other way..?

    1. Snapshot Space Size:- What will be the rest call for snapshot space size ids..?

    Please help me as I need to integrate this functionality as an API using BPM. We need to place order for endurance storage with dynamic values. Thanks in advance.

Alankar More
  • 1,107
  • 2
  • 8
  • 26

1 Answers1

0

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)

Community
  • 1
  • 1
mcruz
  • 1,534
  • 2
  • 11
  • 14