SoftLayer_Account::getOperatingSystemReloadImages

2019-02-21 04:27发布

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.

2条回答
兄弟一词,经得起流年.
2楼-- · 2019-02-21 04:33
Lonely孤独者°
3楼-- · 2019-02-21 04:42

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

查看更多
登录 后发表回答