SoftLayer_Account::getOperatingSystemReloadImages

泄露秘密 提交于 2019-12-01 13:12:37

问题


I want to use API to get the available OS list during OSReload. I found the method SoftLayer_Account::getOperatingSystemReloadImages is mentioned.But cannot find the usage about this method. Who can help me on this? Thanks.


回答1:


I was not able to find this method getOperatingSystemReloadImages. But I found a way to get OS reload options:

First, we need to know the package used to order the server. For example for Virtual Guests, the package used is 46. But if you want to confirm this, please execute the following Rest request:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[vsi_id]/getBillingItem?objectMask=mask[package]

Method: GET

Then, to get ”Reload options”, execute:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/46/getItemPrices?objectFilter={   "itemPrices": {     "categories": {       "categoryCode": {         "operation": "os"       }     }   } }&objectMask=mask[id,item[softwareDescription], categories[categoryCode]]

Method: GET

References:

SoftLayer_Virtual_Guest::getBillingItem

SoftLayer_Product_Package::getItemPrices

EDIT:

Now, in order to use ” SoftLayer_Virtual_Guest::reloadOperatingSystem”, we need add some parameters in Json body configuration: “token” and “config” (Ref: SoftLayer_Virtual_Guest::reloadOperatingSystem)

Below is a REST example:

URL:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[virtual_Guest_ID]/reloadOperatingSystem

Method: POST

Json:

{
  "parameters": [
    "FORCE",
    {
      "itemPrices": [
        {
          "id": 45466
        }
      ]
    }
  ]
}

Where: 45466 is the new priceId of the OS




回答2:


See this example to reload OS https://gist.github.com/softlayer/407058



来源:https://stackoverflow.com/questions/36563416/softlayer-accountgetoperatingsystemreloadimages

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