Search code examples
ibm-cloud-infrastructure

What is the relationship between capacity_restriction_min, capacity_restriction_max parameters and Storage Size in Softlayer API?


I'm using Softlayer API and trying to get info about primary disk size applicable to a particular OS. In web UI, for example, I can select either 25 or 100 GB disk for a RHEL server, but only 100 GB disk is available as primary for Windows. So I want to get those limits for all OSes from SL API, and the only suitable parameters I could find are capacity_restriction_min and max.

The questions are:

  • what are capacity_restriction_* parameters used for? (any explanation or link to a doc?)
  • Is there any way to get the limitation for primary disk for all OSes available for me through SL API?

Solution

  • Regarding to your first question:

    • capacityRestrictionMaximum: The maximum capacity value for which this price is suitable.
    • capacityRestrictionMinimum: The minimum capacity value for which this price is suitable.

    These properties are used for place an order of block/file storage.

    Related forums:

    Storage Size, this is an option required at the moment to order File/Block Storage, this is related the storage size that the storage will have.

    Related forums:



    Regarding to this question: Is there any way to get the limitation for primary disk for all OSes available for me through SL API?

    The flow is the following: After you get the price or item for primary disk, you should check if there is any conflict with other item in your order (In case that you have the price, you need to find/get the item from the price).

    For example, if you are trying to order 25 GB in primary disk and Windows OS, there exist a conflict between these items, so if you try to place an order, an exception will be raised.

    You should check the conflicts with the following method:

    Please, let me know If you have any doubt or need further assistance


    Updated


    Unfortunately, there is no any official document about how to order storage (file/block) through API, but the same idea from UI should be applied in API, perhaps the following links will provide more information about it:

    Just in case, the following packages should be applied for storage:

    • Consistent Performance File Storage: 222
    • Consistent Performance Block Storage: 222
    • Endurance Block Storage: 240
    • Endurance File Storage: 240

    To get available packages, you should use the following method:

    Then you can get information about how to configure the following packages and which categories you need:

    You can get the information for the itemPrices with their categories, adding an objectMask:

    Rest request example:

    https://$user:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/240/getItemPrices?objectMask=mask[categories]
    
    Method: Get
    

    You can build your template with this information, also the links provide some information about capacity restrictions related to storage size and IOPS, if you have any doubt with any particular case, just let me know.