2
votes

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.

1

1 Answers

0
votes

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:[email protected]/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:[email protected]/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