0

I need to implement placing order for endurance storage in my Application using BPM over ICO (IBM Cloud Orchestrator). We needed following parameters for creating rest call for placing order:

  1. Package to use
  2. Storage Type
  3. Location
  4. Storage Package
  5. Storage Size
  6. Snapshot Space Size
  7. OS Type

I am able to fetch data till storage size on the basis of selected storage type, location and storage package using below call:

https://$user:$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":"che01"}}}}}}

But don't have any idea how to get the snapshot space size. What will be the method or API for fetching snapshot space size?

Ravi Dutt
  • 135
  • 2
  • 4
  • 16

1 Answers1

0

The method to fetch snapshot space size is the SoftLayer_Product_Package::getItemPrices, it returns all the prices in the package see documentation.

The reason you don't see the snaspshot spaces is because the package you are using does not have that kind of items (or categories). You can see the kind of items that the package has using this RestFul

GET https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/222/getConfiguration?objectMask=mask[itemCategory]

See documentation for more details

SO you have to use another package, the package for endurance storage is 240, you can see that using this RestFUl:

Get https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/getAllObjects

See documentation for more details

As you will notice the items listed by the SoftLayer_Product_Package::getItemPrices contains a property called category, you can use this property to filter the data (See documentation for more detail). So in order to get only the snapshot space size use this:

GET https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/240/getItemPrices?objectFilter={"itemPrices": {"categories": {"categoryCode": {"operation": "storage_snapshot_space"}}}}

see documentation for more details

Also the filter you are using does not work, it is not possible to filter the location using the name (I do not know why, but it is working like that), currently your request is fetching all the data ignoring the filter, you need to filter the locations using the "locationGroupId" see documentation for more details

Here a simple example to fetch the item prices for the location "che01"

GET https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItemPrices?objectFilter={"itemPrices": {"locationGroupId": {"operation": "in", "options": [{"name": "data", "value": [585,583]}]}}}

You may asking yourself how to get the values 585 and 583, weel see documentation for that.

here an example to get those values

GET https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/240/getRegions?objectMask=mask[location[location[priceGroups]]]

Now you can mix the filters to get all snapshot sapace size for a location like this:

GET https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItemPrices?objectFilter={"itemPrices": { "categories": {"categoryCode": {"operation": "storage_snapshot_space"}}   , "locationGroupId": {"operation": "in", "options": [{"name": "data", "value": [585,583]}]}}}

I hope this help you and you do not need ask more times about the same, but if you have more question please see documentation there are plenty of good information about orders and other stuff http://sldn.softlayer.com/

Regards

  • really sorry, due to mistake I added here 222 but instead I should use 240 for endurance. – Ravi Dutt Mar 08 '16 at 06:12
  • I am unable to differentiate values of Snapshot space size values from your call given below:- https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItemPrices?objectFilter={"itemPrices": { "categories":{"categoryCode": {"operation": "storage_snapshot_space"}} ,"locationGroupId": {"operation": "in", "options": [{"name": "data", "value": [585,583]}]}}} As I find 0 GB Snapshot space size value for endurance storage over Softlayer – Ravi Dutt Mar 08 '16 at 11:27
  • regarding the value 0 that is expected the reason is because you can order an Endurance storage without snapshot space size, so the portal displays the value 0 in order to know that the user does not want a snapshot space size, when the portal creates the order it does not set any price for the snapshot size. – Nelson Raul Cabero Mendoza Mar 08 '16 at 12:57
  • regarding your first question "I am unable to differentiate values of Snapshot space size values from your call given below" please can you exaplain me better I do not understand. – Nelson Raul Cabero Mendoza Mar 08 '16 at 12:58
  • I used help given by you:- https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/240/getItemPrices?objectFilter={"itemPrices": {"categories": {"categoryCode": {"operation": "storage_snapshot_space"}}}} and from data that I got as a response is not identifiable to me. I need to know ids for snapshot space size but those are not distinguishable for me from others. Please make this needful favour... – Ravi Dutt Mar 09 '16 at 12:55
  • It is not clear what is not identifiable for you :(. I think you may be thinking that the result you are getting using my request is storage for "storage space" or "storage size" (like in the portal) and not for "storage snapshot size", but believe me they are for "storage snapshot size", they have the same descriptions like the "storage space", but their categories are different that is how you identify them. – Nelson Raul Cabero Mendoza Mar 09 '16 at 13:57
  • use this mask objectMask=mask[id,capacityRestrictionMaximum ,pricingLocationGroup[id,locations,name],categories[categoryCode,name],item[capacity, units,description]] (Note do not use any filter just the mask) you will see that IOPS have a category code, storage space another category, storage snapshot space another category – Nelson Raul Cabero Mendoza Mar 09 '16 at 13:58
  • Also try to order (or verify an order) an endurance storage it will help you to undertand a lot stuff. – Nelson Raul Cabero Mendoza Mar 09 '16 at 14:01
  • I want to fetch the snap shot storage space values on the basis of storage size. That will be easy ti identify and there will not be any extra data as well. is there any api to do this task..? – Ravi Dutt Mar 23 '16 at 11:43
  • I mean I want to fetch all snapshot storage space ids using storage id. As we know storage space will contain only those values which are equal to storage size or less than that . There exists a relation between them. I want to fetch data on the basis of that relation. – Ravi Dutt Mar 23 '16 at 11:48
  • nope there is not such relation, the only relation that snapshot storage space have is with the IOPS. you need to filter the data by your own in order to see the snapshot storage space which are equal or less than the storage size. – Nelson Raul Cabero Mendoza Mar 23 '16 at 13:23