I need to implement placing order for endurance storage in my Application using BPM over ICO (IBM Cloud Orchestrator) dynamically.
I needed followi
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
"id": 45098 # Block Storage
The filter will be changed to:
objectFilter={"itemPrices": {"categories": {"categoryCode": {"operation": "storage_block"}}}}
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]]]
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]]]
Filter to use: "categoryCode": "storage_snapshot_space"
objectFilter={"itemPrices": {"categories": {"categoryCode": {"operation": "storage_snapshot_space"}}}}
API for Performance and Endurance storage(Block storage)