Search code examples
javaapiibm-cloud-infrastructure

How to order a Public and Private Vlan using Softlayer API


I want to order a Public and Private Vlan using Rest API. I didn't find any API references related to Vlan creation.


Solution

  • Try to use the following example:

    E.G Order private VLAN:

    Method: POST

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

    Body

    {  "parameters":[{  
               "complexType":"SoftLayer_Container_Product_Order_Network_Vlan",
               "location":"DALLAS05",
               "quantity":1,
               "packageId":571,
               "prices":[{  
                     "id":  2019,
                     "item":{
                        "id":1072,
                        "keyName" :"PRIVATE_NETWORK_VLAN"}
                        }],
                "name":"testVlan"   
      }]}
    

    to order a public VLAN is the same that order a private VLAN just you have to look for a public VLAN item price.

    Keep in mind that you must choose the items according to the selected datacenter.

    To get the item prices use the following REST API call.

    Method: GET

    https://[username]:apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/571/getItemPrices?maskObject=mask[pricingLocationGroup[locations]]