REST Resources

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

The following operations are supported on this resource:

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:

    <change-credentials>
       <devices>
         <device href="/api/space/device-management/devices/3047456"></device>
       </devices>
       <user-name>root</user-name>
       <change-to>KEY</change-to>
       <change-on-device>false</change-on-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"
            }
         ]
        },
        "user-name":"root",
        "change-to":"KEY",
        "change-on-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 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:
    <change-credentials>
       <devices>
         <device href="/api/space/device-management/devices/3047456"></device>
       </devices>
       <user-name>root</user-name>
       <password>123admin</password>
       <change-to>CREDENTIAL</change-to>
       <change-on-device>false</change-on-device>
       <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"}]
        },
        "user-name":"root",
        "password":"123admin",
        "change-to":"CREDENTIAL",
        "change-on-device":"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