What is relationShip between IOPS values Id and in

2019-02-20 15:57发布

问题:

I got confused while placing order for Endurance. As we have these three values for Storage Package :-

0.25_IOPS_PER_GB = 45074

2_IOPS_PER_GB = 45084

4_IOPS_PER_GB = 45094

There Ids are fixed but when we select one of these while placing order we get list of storage size which is almost same in all of 3 cases. Now suppose for 100 GB storage space for all of three packages (0.25, 2, and 4) Ids for 100 GB will be different or not..? If these are different it means there exist a relation between Storage Package and Storage Size. then what will be the relation between them. What api should I try to fetch Storage Sizes based on Storage Package i.e. selected IOPS Id. Thanks in advance

回答1:

  • When executing this request:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItems?objectMask=mask[attributes.value,itemCategory.categoryCode,keyName,description]&objectFilter={   "items": {     "itemCategory": {       "categoryCode": {         "operation": "storage_tier_level"       }     }   } }
    
    Method: GET
    

We can see that the Storage Packages have attribute valuescan help us to get a relation between Storage Package and Storage Size. For example the response shows us:

0.25 IOPS per GB --> "value": "100"

2 IOPS per GB--> "value": "200"

4 IOPS per GB--> "value": "300"
  • And when executing the below request to get valid prices for Endurance filtering by “Storage Size”:

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

The response shows us the "CAPACITY_RESTRICTION_MIN" and "CAPACITY_RESTRICTION_MAX"of Storage Size related to Storage Packages.

For example: “100 GB Storage Space” (id = 45234) should work successfully when creating an order with "4 IOPS per GB" ( "value": "300"). Below is a section of response:

Response:

{
"id": 45234
"attributes": [3]
0:  {
"value": "300"
"itemPriceAttributeType": {
"id": 21
"keyname": "CAPACITY_RESTRICTION_MIN"
}-
}-
1:  {
"value": "300"
"itemPriceAttributeType": {
"id": 22
"keyname": "CAPACITY_RESTRICTION_MAX"
}-
}-
2:  {
"value": "STORAGE_TIER_LEVEL"
"itemPriceAttributeType": {
"id": 24
"keyname": "CAPACITY_RESTRICTION_TYPE"
}-
}-
-
"categories": [1]
0:  {
"categoryCode": "performance_storage_space"
}-
-
"item": {
"description": "100 GB Storage Space"
"keyName": "100_GB_PERFORMANCE_STORAGE_SPACE"
}-
}

This is a verifyOrder example using the previous values:

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

Method: POST

Json Payload:

{
  "parameters": [
    {
      "location": 37473,  #Washington 1
      "packageId": 240,
      "osFormatType": {
        "id": 12,
        "keyName": "LINUX"
      },
      "complexType": "SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
      "prices": [
        {
          "id": 45064   # Endurance Storage
        },
        {
          "id": 45104   # Block Storage
        },
        {
          "id": 45094   # Storage Tier Level: 4 IOPS per GB
        },
        {
          "id": 45234   # performance_storage_space: 100 GB Storage Space
        },
        {
          "id": 46176   # Storage Snapshot Space: 10 GB Storage Space
        }
      ],
      "quantity": 1
    }
  ]
}

Update 1:

To get valid values using SoftLayer_Product_Package::getItemPrices with a relation of between Storage Package and Storage Size, please see:

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

Method: GET

Where: The response will display “Storage Package” item prices (categoryCode":"performance_storage_space"`) that can be used when selecting "4 IOPS per GB" (‘"value":300’).