Reputation: 1
Our requirement is to have 5 virtual machines in 3 different vlans. At https://control.softlayer.com/network/vlans I don't see option to create private vlans. I am wondering is there way to create multiple private vlans using SL API ?
Upvotes: 0
Views: 238
Reputation: 1532
This is a REST
request to order a private Vlan
:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder
Method: POST Json Payload:
{
"parameters": [
{
"location": "AMSTERDAM",
"packageId": 0,
"prices": [
{
"id": 50745 # Private Network Vlan
},
{
"id": 36696 # 8 Static Public IP Addresses
}
],
"quantity": 1,
"name": "myNewVlan",
"complexType": "SoftLayer_Container_Product_Order_Network_Vlan",
"itemCategoryQuestionAnswers": [
{
"categoryId": 53,
"categoryCode": "static_sec_ip_addresses",
"questionId": 14,
"answer": 4 # TOTAL_IPS_IN_30_DAYS
},
{
"categoryId": 53,
"categoryCode": "static_sec_ip_addresses",
"questionId": 15,
"answer": 4 # TOTAL_IPS_IN_12_MONTHS
},
{
"categoryId": 53,
"categoryCode": "static_sec_ip_addresses",
"questionId": 16,
"answer": "Description of your need for additional IPs"
},
{
"categoryId": 53,
"categoryCode": "static_sec_ip_addresses",
"questionId": 9,
"answer": "Contact name"
},
{
"categoryId": 53,
"categoryCode": "static_sec_ip_addresses",
"questionId": 10,
"answer": "Contact job title"
},
{
"categoryId": 53,
"categoryCode": "static_sec_ip_addresses",
"questionId": 11,
"answer": "[email protected]"
},
{
"categoryId": 53,
"categoryCode": "static_sec_ip_addresses",
"questionId": 12,
"answer": "72578789" # CONTACT_PHONE_NUMBER
},
{
"categoryId": 53,
"categoryCode": "static_sec_ip_addresses",
"questionId": 13,
"answer": true # CONTACT_VALIDATED
}
]
}
]
}
Note:
To execute this request, remove the comments please .e.g. # CONTACT_PHONE_NUMBER, # CONTACT_VALIDATED, # TOTAL_IPS_IN_12_MONTHS, # TOTAL_IPS_IN_30_DAYS.
When all your configuration is ready change from verifyOrder
to ‘placeOrder’.
To get valid item prices
, execute:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/0/getItemPrices?objectMask=mask[id,locationGroupId,item[id,keyName,description],pricingLocationGroup[locations[id, name, longName]]]
Method: GET
If you want to create multiple items, you can use API clients
created by SoftLayer: SoftLayer Api Clients
References:
SoftLayer_Product_Order::placeOrder
SoftLayer_Product_Order::verifyOrder
SoftLayer_Container_Product_Order_Network_Vlan
Upvotes: 0