Can I specify bandwidth to soft layer API for creating a virtual server?

风流意气都作罢 提交于 2019-12-12 05:46:28

问题


I am trying to create a virtual server through soft layer API. But the API I came across don't seem to accept network bandwidth, can't I specify the required bandwidth for my virtual server created through API?

Thanks, Kishore


回答1:


Anyway, here an example using SoftLayer_Product_Order::placeOrder method to place an order for VSI with bandwidth:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder

Method: Post

{  
   "parameters":[  
      {  
         "location":449494,
         "packageId":46,
         "hardware":[  
            {  
               "domain":"softlayer.com",
               "hostname":"test"
            }
         ],
         "prices":[  
            {  
               "id":1640
            },
            {  
               "id":1644
            },
            {  
               "id":13940
            },
            {  
               "id":2202
            },
            {  
               "id":50241
            },
            {  
               "id":273
            },
            {  
               "id":2302
            },
            {  
               "id":55
            },
            {  
               "id":58
            },
            {  
               "id":420
            },
            {  
               "id":418
            },
            {  
               "id":21
            },
            {  
               "id":57
            },
            {  
               "id":905
            },
            {  
               "id":14022
            }
         ]
      }
   ]
}

The "50241" price refers to "5000 GB Bandwidth"

To retrieve information about item prices, try this:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/46/getItemPrices

Method: Get

References:

SoftLayer_Product_Package::getItemPrices



来源:https://stackoverflow.com/questions/36940436/can-i-specify-bandwidth-to-soft-layer-api-for-creating-a-virtual-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!