0

Suppose I want to purchase a replica of Block storage. I have scheduleId & data center Id with me. How I can find out the price details to put into API while purchasing a replica.

Here,

I have parameters like:

placeorder = {
     "complextype": "SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
     "packageId": 216,
     "location": "AMSTERDAM",
     "originVolumeScheduleId": 123,
     "originVolumeId": 321,
     "prices": [
<Which parameters are necessary here & how we can choose those>
]

I need to know how we can find out the price details with SoftLayer_Product_Package::getItems method, but I am confused while selecting prices for any offering.

paisanco
  • 4,098
  • 6
  • 27
  • 33
rajendra
  • 73
  • 1
  • 5

1 Answers1

0

When ordering a replica, we need to set the same items than ‘Primary’ and add a Storage Replication item.

For example, we have anEndurance with following configured items:

  • Endurance Storage
  • Block Storage
  • 0.25 IOPS per GB
  • 20 GB Storage Space
  • 10 GB Storage Space (Snapshot Space)

To see these items through API using StorageId, please execute the following:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[storageId]/getBillingItem?objectMask=mask[id,orderItem[id,description,itemPrice.id,order[id,items]]]

Method: GET

Now, to order a replica, we need to add item prices related to above listed items and add a Storage Replication item according to chosen Location.

This is an example to order a replica:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder

Note: 
Please change “verifyOrder” to “placeOrder” when your order is ready.
In my case, the location chosen is `PARIS`

Method: POST

Json Payload:


{
  "parameters": [
    {
      "location": "PARIS",
      "packageId": 240,
      "complexType": "SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
      "originVolumeId": 6465511,
      "originVolumeScheduleId": 33641,
      "osFormatType": {
        "id": 12,
        "keyName": "LINUX"
      },
      "prices": [
        {
          "id": 147099     # 20 GB Storage Space (Storage Replication)
        },
        {
          "id": 45058     # Endurance Storage
        },
        {
          "id": 45068   # 0.25 IOPS per GB (Storage Tier Level)
        },
        {
          "id": 45098     # Block Storage 
        },
        {
          "id": 144009     # 20 GB Storage Space (Storage Space)
        },
        {
          "id": 143449     # 10 GB Storage Space (Storage Snapshot Space)
        }
      ],
      "quantity": 1
    }
  ]
}

To get valid prices according to Endurance package (packageId = 240), please execute:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItemPrices?objectMask=mask[id,locationGroupId,item[id,keyName,description],pricingLocationGroup[locations[id, name, longName]]]

Method: GET

Some References:

Location-based-Pricing-and-You

SoftLayer_Product_Order

SoftLayer_Network_Storage:getBillingItem

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

I hope this information help you.

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