0

I am working on performance storage. When I am selecting Storage Size 250/500 then no data In IOPS. When I was select storage size 100/20/80/1000/2000gb then I am getting IOPS. I am facing problem only 250/500gb. this is the API i am using

https://[username]:[apikey]@api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/222/getItemPrices?objectFilter={"itemPrices": { "attributes": { "value": { "operation": 20 } },  "categories": { "categoryCode": {    "operation": "performance_storage_iops" } },    "locationGroupId": {    "operation": "is null" } } }

I am sending screenshot when i was select storage size 50/500gb what I am getting response. So could you kindly provide the information to me.

enter image description here

mcruz
  • 1,534
  • 2
  • 11
  • 14
  • here user interface is one dropdown for storage size in that i need to select storage size and another dropdown is iops. After selecting storage size depend upon storage size iops value will be display in dropdown. Through Rest API i am getting storage size and IOPS but when i was select 250/500gb storage size then IOPS values are not getting. I was check that API in RestClient also its showing blank. so please help me to get out this issue – Mohammad Hafiz Apr 20 '16 at 07:02
  • Here I am trying to do BPM and SoftLayer integration using Java REST client.I wanted to show similar data(just like SL Performance storage UI ) on my custom BPM UI . (One drop down to select type of storage, 2nd to show location, 3rd to show size and 4th would be IOPS) where user can select the items and place request. – Mohammad Hafiz Apr 21 '16 at 10:49
  • I am using this API to get storage size details https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/222/getItemPrices?objectFilter={"itemPrices": {"categories": {"categoryCode": {"operation": "performance_storage_space"}},"locationGroupId": { "operation": "is null"}}} – Mohammad Hafiz Apr 21 '16 at 10:51
  • I can get the IOPS, I can use the same approach like above, but there is a dependency between the IOPS and storage space e.g. this api i am using https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/222/getItemPrices?objectFilter={"itemPrices": { "attributes": { "value": { "operation": 20 } }, "categories": { "categoryCode": { "operation": "performance_storage_iops" } }, "locationGroupId": { "operation": "is null" } } }. but if i will give in place of 20 like 100gb,1000gb etc I am getting iops. but i am facing issue only 250/500gb. – Mohammad Hafiz Apr 21 '16 at 10:55
  • Note: In the example we assume that selected storage space was "20", the prices for IOPS have an record called atributes, this record tell us the valid storage spaces of the IOPS, then we have other filters to get only the IOPS prices categoryCode = performance_storage_iops and we want only the standard prices locationGroupId=null. Thisi s my issue so kindly help me to get out of this – Mohammad Hafiz Apr 21 '16 at 10:59
  • You are trying to compare the limits, keep in mind that an IOPS item has: "capacityRestrictionMaximum" and "capacityRestrictionMinimum", these are the attributes that you are trying to filter with this: "{"itemPrices": { "attributes": { "value": { "operation": 20 } }, "categories": { "categoryCode": { "operation": "performance_storage_iops" } }". There exist IOPS items which have the following limits: capacityRestrictionMinimum = 100 and capacityRestrictionMaximum=1000, which means the 250/500 GB storage size could be used with this. – Ruber Cuellar Valenzuela Apr 21 '16 at 14:37
  • that is the reason why the request that you are trying, returns empty value for 250/500 Gb. – Ruber Cuellar Valenzuela Apr 21 '16 at 14:37
  • The Control Portal does internal processes to validate the IOPS, but if you want to retrieve the IOPS items that can be used for an specific storage size, it is not possible through REST, that I explained in the answer that I provided. – Ruber Cuellar Valenzuela Apr 21 '16 at 14:40

3 Answers3

0

I already answered this here, If you see the result you will notice that it contains "capacityRestrictionMinimum" and "capacityRestrictionMaximum" that means that those IOPS are valid for storage size from 100 to 1000. if do not believe me (I think that is the case) try using those IOPS in an order using the verifyOrder method.

Community
  • 1
  • 1
0

As I understand, you want to retrieve IOPS item prices according the storage size, aren't you?

If that is the case, there is not possible retrieve these kind of data using REST, because we need to apply a filter with a range between "capacityRestrictionMaximum" and "capacityRestrictionMinimum". These data are returned as String datatype, and it's not possible to apply a filter between integers (storage type) and strings.

However, this can be possible using a programming language, try the following Python script:

"""
This script retrieves performance storage iops per Storage Size

Important manual pages:
http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getItemPrices
http://sldn.softlayer.com/article/object-filters

License: http://sldn.softlayer.com/article/License
Author: SoftLayer Technologies, Inc. <sldn@softlayer.com>
"""
import SoftLayer

# Your SoftLayer API username and key.
USERNAME = 'set me'
API_KEY = 'set me'

# Define Package Id
packageId = 222

# Define the Storage Size
storageGb = 250

# Define an object filter, to retrieve performance_storage_iops category 
objectFilter = {'itemPrices':{'categories': {'categoryCode':{'operation':'performance_storage_iops'}}, 'locationGroupId': { 'operation': 'is null' }}}

# Create a SoftLayer API client object
client = SoftLayer.Client(username=USERNAME, api_key=API_KEY)

try:
    prices = client['Product_Package'].getItemPrices(id=packageId, filter=objectFilter, mask='mask[categories]')
    for price in prices:
        if (storageGb <= int(price['capacityRestrictionMaximum']) and storageGb >= int(price['capacityRestrictionMinimum'])):
            # print (price)
            print('Price Id: %s Item Id: %s IOPS: %s' % (price['id'], price['item']['id'], price['item']['description']))
except SoftLayer.SoftLayerAPIError as e:
    print("Unable to retrieve IOPSr faultCode=%s, faultString=%s"
          % (e.faultCode, e.faultString))
    exit(1)

See the following link, to get more information about programming languages supported by SoftLayer:

http://sldn.softlayer.com/

I hope it really helps you

0

Using “SoftLayer_Product_Package::getItemPrices” with some objectFilters and objectMasks’, we can get some information to get valid“IOPS”according to“Storage Space”`.

The "attributes" property will show you a range of capacity of "GB Storage Space" (minimum/maximum "GB" supported), but not a specific value like "250/500GB".

We execute the below request to get valid “IOPS” according to “Storage Space”:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/222/getItemPrices?objectMask=mask[id,item[keyName,description],pricingLocationGroup[locations[id, name, longName]],categories.categoryCode,attributes[itemPriceAttributeType.keyname,value]]&objectFilter={   "itemPrices": {     "item": {       "description": {         "operation": "1200 IOPS"       }     },     "categories": {       "categoryCode": {         "operation": "performance_storage_iops"       }     },     "locationGroupId": {       "operation": "is null"     }   } }

Method: GET

The response will display an amount of items. But, what of them do we have to choose?

In my response, the price_id to select is this one:

{
    "id": 41608,
    "attributes": [
      {
        "value": "100",
        "itemPriceAttributeType": {
          "keyname": "CAPACITY_RESTRICTION_MIN"
        }
      },
      {
        "value": "1000",
        "itemPriceAttributeType": {
          "keyname": "CAPACITY_RESTRICTION_MAX"
        }
      },
      {
        "value": "STORAGE_SPACE",
        "itemPriceAttributeType": {
          "keyname": "CAPACITY_RESTRICTION_TYPE"
        }
      }
    ],
    "categories": [
      {
        "categoryCode": "performance_storage_iops"
      }
    ],
    "item": {
      "description": "1200 IOPS",
      "keyName": "1200_IOPS_3"
    }
  }

Why?

Because, the item with "description:1200 IOPS", is into range[100 - 1000 GB STORAGE_SPACE]. In our case the configuration is: “Storage Size: 500GB”

I hope this information help you.

mcruz
  • 1,534
  • 2
  • 11
  • 14