0
votes

I'm trying to reload a bare metal system with the following flex image but it isn't persisting. Is there something I'm doing wrong is the REST call?

    String content = "{\"parameters\":[\"FORCE\",{\"sshKeyIds\":["+sshKeys+"]},{\"imageTemplateId\":803303}]}";

    Response response = RestAssured.given().contentType(ContentType.JSON).body(content).post("https://"+username+":"+apikey+"@api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/"+softlayer_id+"/reloadOperatingSystem.json");
1
Not enough information... if you try to manually curl the same exact HTTP call - does it persist ? - Nir Alfasi
No, same outcome. The softlayer backend isn't using the imageTemplateId specified in the call. What more information do you need? @alfasin - Raj Desai
If it has the same outcome - why are you looking for issues in the code ? look for the reason on the other (receiving) side. - Nir Alfasi

1 Answers

0
votes

Please try the following Rest request using SoftLayer_Hardware_Server::reloadOperatingSystem:

URL:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/[Hardware_Id]/reloadOperatingSystem

Method: POST

Json Payload:

{
  "parameters": [
    "50ecea4c6cc06fa1eb346b5f627adfaa",
    {
      "imageTemplateId": 295000
    }
  ]
}

Where:

“50ecea4c6cc06fa1eb346b5f627adfaa” is the token (The token will remain active for 10 minutes)
“295000” the image template to use

• But, How to get the token for our above configuration?

Execute:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/[Hardware_Id]/reloadOperatingSystem

Method: GET