SoftLayer_Account::getOperatingSystemReloadImages

前端 未结 2 891
礼貌的吻别
礼貌的吻别 2021-01-17 00:52

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 a

2条回答
  •  抹茶落季
    2021-01-17 01:44

    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

提交回复
热议问题