Password Update in SL

前端 未结 2 762
故里飘歌
故里飘歌 2021-01-26 17:15

I am trying to update a password/Username of OS using Java API in Softlayer. But after executing API, Password is not modified. Here is the code i\'ve tested. Please comment me

相关标签:
2条回答
  • 2021-01-26 17:38

    Here is java sample code to update software in device.

         com.softlayer.api.service.software.component.Password passtemplate =
         new com.softlayer.api.service.software.component.Password();
         passtemplate.setUsername("newUserName");
         passtemplate.setPassword("123456abcDF");
    
        com.softlayer.api.service.software.component.Password.Service passService = com.softlayer.api.service.software.component.Password
                .service(client, 10000000l); // Client and password ID
        passService.editObject(passtemplate);
    
    0 讨论(0)
  • 2021-01-26 17:55

    Please try the following: SoftLayer_Software_Component_Password::editObject

    Below is a REST example:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Software_Component_Password/[comp_pass_id]/editObject
    
    Method: POST
    
    Json Payload:
    {
      "parameters": [
        {
          "password": "myPassEdited",
          "username": "myUserEdited"
        }
      ]
    }
    

    Also, to get passwords of server software components, please see:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Hardware/[server_id]/getSoftwareComponents?objectMask=mask[passwords]
    
    Method: GET
    
    0 讨论(0)
提交回复
热议问题