2

We are a part of DST India team and currently we are working for an offering for our client where we are trying to integrate performance and endurance storage features (of SoftLayer) in ICO using REST API provided by SoftLayer. I have gone through SoftLayer documentation but I'm not able to find the same.

So, Could you kindly provide us following information?

  1. please provide API for creating endurance storage (along with the parameters required)
  2. please provide API for creating performance storage (along with the parameters required)
  3. please provide API for attaching endurance storage (along with the parameters required)
  4. please provide API for attaching performance storage (along with the parameters required)
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Anupam Kamal
  • 37
  • 1
  • 3

1 Answers1

3

To order Endurance, execute:

Configuration:

Package to use = 240
Storage Type: Endurance
Location: Dal06
Storage Package: 0.25 IOPS/GB
Storage Size: 20GB
Snapshot Space Size: 0GB
OS Type: Linux

URL:

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

Method: POST

Json Payload:

{
  "parameters": [
    {
      "location": 154820,  //Dallas 06
      "packageId": 240,
      "osFormatType": {
        "id": 12,
        "keyName": "LINUX"
      },
      "complexType": "SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
      "prices": [
        {
          "id": 45058   # Endurance Storage
        },
        {
          "id": 45098   # Block Storage
        },
        {
          "id": 45068   # 0.25 IOPS per GB
        },
        {
          "id": 45118   # 20 GB Storage Space
        },
        {
          "id": 46120   # 5 GB Storage Space - Snapshot
        }
      ],
      "quantity": 1
    }
  ]
}

Notes:

  • change from "verifyOrder" method to "placeOrder" once that your configuration is ready
  • Remove the comments set in the prices ids to get a valid Json (e.g. remove --> # Endurance Storage)

How to get the valid item prices to order Endurance/Performance Storage?

Execute the following according to package to use:

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

Method: GET

Where:
 A price id with a locationGroupId = null is considered "A standard price" and the API will internally switch the prices for the customer. But we recommend to execute first the verifyOrder in order to see if the wanted order is ok (the fee can vary).

To Order Performance Storage:

Configuration:

Package to use: 222
Storage Type: Performance
Location: Dallas 06
Storage Size: 20GB – 100 to 1000 IOPS
Specify IOPS: 100
Select OS Type: Linux

URL:

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

Method: POST

Json Payload:

{
  "parameters": [
    {
      "packageId": 222,
      "location": 154820,
      "osFormatType": {
        "id": 12,
        "keyName": "LINUX"
      },
      "complexType": "SoftLayer_Container_Product_Order_Network_PerformanceStorage_Iscsi",
      "prices": [
        {
          "id": 40672   # Block Storage (Performance)
        },
        {
          "id": 40682   # 20 GB Storage Space
        },
        {
          "id": 40792   # 100 IOPS
        }
      ],
      "quantity": 1
    }
  ]
}

To authorize/allow hosts, please execute:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[Storage_id]/allowAccessFromHostList

Method: POST

{
  "parameters": [
    [
      {
        "id": 13548553,
        "objectType": "SoftLayer_Virtual_Guest"
      }
    ]
  ]
}

The Above request is used to authorize “Endurance” and “Performance” If you want to authorize “Virtual Guest”,“IpAddress” or “Hardware”, valid values for “objectType” are:

“SoftLayer_Virtual_Guest “,”SoftLayer_Network_Subnet_IpAddress”, ”SoftLayer_Hardware” respectively.

Reference:

http://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage/allowAccessFromHostList

The “network storage” and VSI/Bar Metal/Subnet must to be located in the same location/datacenter. These requests help us to get available hosts can be authorized to an specific “network storage” as we can see in the Portal:

To get valid available subnets with associated IP addresses, execute:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[storage_id]/ getAllowableSubnets?objectMask=mask[id,networkIdentifier,cidr,subnetType,ipAddresses[id,ipAddress]]

Method: GET

To get valid available virtual guests, please execute:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage_Iscsi/[storage_id]/getAllowableVirtualGuests?objectMask=mask[id,fullyQualifiedDomainName] 

Method: GET

Available Bar metal:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[storage_id]/getAllowableHardware
Method: GET

Update 1:

Additionally, to get network Storage list, please see: SoftLayer_Account::getNetworkStorage

This is an example, where the result displays properties like: “location” and “network storage type” using object Masks.

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[storageType, billingItem[description,location[id,longName]]]

Method: GET

Using filters:

Filtering by network Storage Type: “Endurance Storage” or “Block Storage (Performance)”

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[id,username,nasType,storageType, billingItem[description,location[id,longName]]]&objectFilter={"networkStorage":{"nasType":{"operation":"ISCSI"},"billingItem":{"description":{"operation":"Endurance Storage"}}}}
Method: GET

Other link may help you:

API for Listing All Performance Storages for a user

Community
  • 1
  • 1
mcruz
  • 1,534
  • 2
  • 11
  • 14
  • Hi , Thanks much for answering my doubt .I would need some more help as I am not able to find these two ID's a) id": 45118 # 20 GB Storage Space and b) "id": 46120 # 5 GB Storage Space - Snapshot in getItemPrices.xml. For a) I am getting something which is all related to performacne storage. eg) 143811 20 GB Storage Space 20_GB_PERFORMANCE_STORAGE_SPACE But I am not able to find anyhting related to b) {"error":"Price # 45118 does not exist.","code":"SoftLayer_Exception_Public"} – Anupam Kamal Feb 18 '16 at 09:24
  • The ids used belong to a test account. You need to execute Product_Package:getItemPrices using your account and own valid ids will be displayed for your case. – mcruz Feb 18 '16 at 10:50
  • I can see entry for only for performance storage.No entry for endurance like below eg. (from getItemPrices.xml) 45234 100 GB Storage Space 100_GB_PERFORMANCE_STORAGE_SPACE – Anupam Kamal Feb 18 '16 at 11:04
  • Also, shall I use the same packageId ie 240 for endurance or it will be different based on account ? – Anupam Kamal Feb 18 '16 at 11:07
  • You have to use package “240” to order “Endurance” no matter you use different accounts. Now, to get valid/consistent ”item price ids”, you need to use your own username:apikey provided by your account (the price ids can vary according to accounts). When you use “SoftLayer_Product_Package/240/getItemPrices” the values displayed are valid for “Endurance” (maybe the keyname seems to be confusing and it seems to be for Performance, but these ids are valid for Endurance). – mcruz Feb 18 '16 at 15:28
  • When you use package “222”, for “VerifyOrder/placeOrder”, it means that you are working to order “Performance Storage” and you use “…SoftLayer_Product_Package/222/getItemPrices…” you get valid item prices for performance. I hope it helps. – mcruz Feb 18 '16 at 15:29
  • Thanks. I am able to verify and order performance storage. As I am trying to integrate it using java client, it's bit difficult to parse the json response for getItemPrice as the response is huge. Is there filter available for getItemPrice? If yes, please help me out here how we can apply filter here.Thanks much. – Anupam Kamal Feb 22 '16 at 09:29
  • This is a REST example using filters that may help you: https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/[package_id]/getItemPrices?objectMask=mask[id,item.description,hourlyRecurringFee,locationGroupId,pricingLocationGroup[locations[id, name, longName]]]&objectFilter={"itemPrices":{"pricingLocationGroup":{"locations":{"id":{"operation":"814994"}}}}} Related to java client, I’m afraid to say that filters are not supported yet. – mcruz Feb 23 '16 at 19:16
  • Thanks for your support. I am able to integrate place order flow for performance storage with our product. It would be really great if you could share the api to get all performance storage/endurance storage so that I can use the ID from there and can use to get the list of allowable virtual system and to authorize host to use the storage. – Anupam Kamal Mar 07 '16 at 04:56
  • @AnupamKamal. Added some request in the answer in "Update 1" section. I hope them help you. Regards. – mcruz Mar 07 '16 at 20:34
  • Thanks for your response. I am able to fetch the details for performance and endurance storage. However while calling the api to the allowable virtual servers , it is throwing me error. This is the response I got for performance storage ---[{"id":7691337,"nasType":"ISCSI","username":"IBM01SL446594-2","billingItem":{"description":"Block Storage (Performance)","location":{"id":37473,"longName":"Washington 1"}},"storageType":{"description":"Performance Block Storage","id":5,"keyName":"PERFORMANCE_BLOCK_STORAGE"}} – Anupam Kamal Mar 09 '16 at 06:33
  • But when you hit the api ---https://[username]:[key]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage_Iscsi/7691337/ getAllowableVirtualGuests?objectMask=mask[id,fullyQualifiedDomainName] it is throwing error saying ------------- Function (" getAllowableVirtualGuests") is not a valid method for this service. SoftLayer_Exception_Public . Probably there could be some silly mistake I am doing. It would be great if you could help me out here. Thanks a lot . – Anupam Kamal Mar 09 '16 at 06:36
  • @AnupamKamal, there is a mistake in this part of the request `"SoftLayer_Network_Storage_‌​Iscsi/7691337/ getAllowableVirtualGuests"`. There is a **`blank space `** at the beginning of the method **"getAllowableVirtualGuests"**, please remove it. The request should be: ` https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage_Iscsi/7691337/getAllowableVirtualGuests?objectMask=mask[id,fullyQualifiedDomainName]` – mcruz Mar 09 '16 at 17:10