/api/space/device-management/change-device-credentials

The following operations are supported on this resource:

POST /change-device-credentialsVersion 5

This API is used to change login credentials information for a large number of devices.


Note: Please make sure device "user" used in the request has admin privileges. For any KEY/CREDENTIAL to KEY based change, the "change-on-device" flag must always be true.

Sample Usage

This API makes an asynchronous method call, so you can, optionally, specify queue and schedule parameters:

POST /change-device-credentials?queue=<queue>&schedule=<schedule>


Note: The queue URL denoted by <queue> must have been created already.


  • Parameters:
    NameTypeURI TypeDescriptionRequired
    queueQueue URLQueryA fully qualified queue URL, where job progress notifications will be sent (See Asynchronous API Usage)N
    schedulecron-like-expressionQuerySchedule this API in the future, by specifying a cron-like-expression (See Job Scheduling)N
  • Sample Input XML:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <change-credentials>
       <devices>
         <device href=/api/space/device-management/devices/3047456"></device>
       </devices>
       <userName>super</userName>
       <password>test</password>
       <changeTo>credential</changeTo>
       <changeOnDevice>false</changeOnDevice>
       <re-authenticate-device>false</re-authenticate-device>
    </change-credentials>

  • Sample Output XML:
    <task href="/api/space/job-management/jobs/3244036">
       <id>3244036</id>
    </task>

  • Sample Input JSON:

    {
      "change-credentials":{
        "devices":{
          "device":[{"@href": "/api/space/device-management/devices/3047456"}]
        }
        "userName":"super",
        "password":"test",
        "changeTo":"credential",
        "changeOnDevice":"false",
        "re-authenticate-device":"false",
      }
    }

  • Sample Output JSON:


    {
      "task":{
        "@href":"/api/space/job-management/jobs/3244036",
        "id":3244036
      }

  • Access Control

    The following capabilities are required to access this API: ChangeCredential

    POST /change-device-credentialsVersion 4

    This API is used to change login credentials information for a large number of devices. The change can either be keybased on credential based.In case of keybased, the SSH public/private key is generated on Junos Space. The keys get configured on the devices from Junos Space.

    Sample Usage

    This API makes an asynchronous method call, so you can, optionally, specify queue and schedule parameters:

    POST /change-device-credentials?queue=<queue>&schedule=<schedule>


    Note: The queue URL denoted by <queue> must have been created already.


    • Parameters:
      NameTypeURI TypeDescriptionRequired
      queueQueue URLQueryA fully qualified queue URL, where job progress notifications will be sent (See Asynchronous API Usage)N
      schedulecron-like-expressionQuerySchedule this API in the future, by specifying a cron-like-expression (See Job Scheduling)N
  • Sample Input XML:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <change-credentials>
       <devices>
         <device href=/api/space/device-management/devices/3047456"></device>
       </devices>
       <userName>super</userName>
       <password>test</password>
       <changeTo>credential</changeTo>
       <changeOnDevice>false</changeOnDevice>
    </change-credentials>

  • Sample Input XML:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <change-credentials>
       <devices>
         <device href=/api/space/device-management/devices/3047456"></device>
       </devices>
       <userName>super</userName>
       <changeTo>key</changeTo>
       <changeOnDevice>false</changeOnDevice>
    </change-credentials>

  • Sample Output XML:
    <task href="/api/space/job-management/jobs/3244036">
       <id>3244036</id>
    </task>

  • Sample Input JSON:

    {
      "change-credentials":{
        "devices":{
          "device":[{"@href": "/api/space/device-management/devices/3047456"}]
        }
        "userName":"super",
        "password":"test",
        "changeTo":"credential",
        "changeOnDevice":"false",
      }
    }

  • Sample Input JSON:

    {
      "change-credentials":{
        "devices":{
          "device":[{"@href": "/api/space/device-management/devices/3047456"}]
        }
        "userName":"super",
        "changeTo":"key",
        "changeOnDevice":"false",
      }
    }

  • Sample Output JSON:


    {
      "task":{
        "@href":"/api/space/job-management/jobs/3244036",
        "id":3244036
      }

  • Access Control

    The following capabilities are required to access this API: ChangeCredential