2

I am trying to provision a subnet using the below REST call

curl -H "Content-Type: application/json" --data @subnet-data.json https://<userid>:<apikey>@api.softlayer.com/rest/v3.1/SoftLayer_Network/4601/createSubnet

where 4601 is the id of my Network.

The JSON Payload is:

{
"parameters": [
    {
        "networkIdentifier": "172.31.10.0",
        "cidr": 24,
        "podName": "dal09.pod01",
    }
]

}

But I get the following error

{"error":"Bad request","code":"SoftLayer_Exception_WebService_BadRequest"}

Please let me know the correct way to order a Subnet. Also if you can let me know how to find the correct/required parameters that would be great.

Thank you.

yash nigam
  • 67
  • 4

1 Answers1

0

Take a look this forum please:

If you have any question or doubt, let me know


Updated

The price id depends from the catalog, try this request please, you will be able to see the id for Global IPv4:

http://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/0/getItemPrices?objectFilter={"itemPrices":{"item":{"description":{"operation":"Global IPv4"}}}}

Method: Get

If you don't have success, try the request below, sometimes it's necessary to encoded because we are using an objectFilter:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/0/getItemPrices?objectFilter=%7B%22itemPrices%22%3A%7B%22item%22%3A%7B%22description%22%3A%7B%22operation%22%3A%22Global+IPv4%22%7D%7D%7D%7D

Method: Get

Replace: $user and $apiKey with you own information

Community
  • 1
  • 1
  • I saw the code given by you in the link above But when I use the json provided there : `{ "parameters": [ { "packageId": 0, "prices": [ { "id": 19065 } ], "quantity": 1, "complexType": "SoftLayer_Container_Product_Order_Network_Subnet"}]}` I get the error `{"error":"Price # 19065 does not exist.","code":"SoftLayer_Exception_Public"}` So I tried to find the correct price. But I cannot see when i use '/rest/v3.1/SoftLayer_Product_Package/0/getItemPrices' then I cannot see any price related to subnet, such as 'global ipv4' – yash nigam Oct 28 '16 at 13:17
  • Please, review the **Updated** section in my answer, if you have any doubt or issue, let me know – Ruber Cuellar Valenzuela Oct 28 '16 at 13:45
  • Hello, I got the following responses: `curl https://$user:$apikey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/0/getItemPrices?objectFilter=%7B%22itemPrices%22%3A%7B%22item%22%3A%7B%22description%22%3A%7B%22operation%22%3A%22Global+IPv4%22%7D%7D%7D%7D output: [] ` and `curl -g https://$user:$apikey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/0/getItemPrices?objectFilter={"itemPrices":{"item":{"description":{"operation":"Global IPv4"}}}} output: curl: (52) Empty reply from server ` – yash nigam Nov 03 '16 at 07:27