Marcin P
Marcin P

Reputation: 430

Softlayer API: how to update/remove machine password

I am able to get VS OS password via SoftLayer_Virtual_Guest but now face the problem of updating the OS pass. How to update (preferable delete, or set blank) this.

Also not sure what the Software_Component_Password is for.

Upvotes: 0

Views: 166

Answers (1)

Albert Camacho
Albert Camacho

Reputation: 1104

Your question about password update was answered here Password Update in SL

In your case, for virtual guest you should be able to get all passwords of VSI with the following GET REST call

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[server_id]/getSoftwareComponents?objectMask=mask[passwords,softwareLicense]

Change [username], [apikey], [server_id] with your own data.

You need to select a password id and use the following POST request in order to update it.

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Software_Component_Password/[password_id]/editObject


Body in JSON:
{
  "parameters": [
    {
      "password": "myPassEdited",
      "username": "myUserEdited"
    }
  ]
}

Try by sending an empty password, just set "" in password parameter.

With Software_Component_Password service you can create, edit, delete one or a list of passwords, I recommend you review information about this service.

Upvotes: 1

Related Questions