/api/space/device-management/devices/{id}/exec-rpc
The following operations are supported on this resource:
POST /api/space/device-management/devices/{id}/exec-rpc (v3)
This API creates a schedulable RPC request on the specified device. It executes the different RPC commands after opening a channel to the device and sets the status of the executed RPC commmands.
Note: The RPC command to be executed must not contain any <rpc> tags. For example, the following is incorrect:
![CDATA[<rpc><get-system-information/><rpc/>]] is incorrect.
The following input is correct:
![CDATA[<get-system-information/>]]
.Access Control
The following capabilities are required to access this API:
"OpenSSH"
Example Usage
Since this API makes an asynchronous method call, the user must specify a queue parameter with this API.
POST /api/space/device-management/devices/{id}/exec-rpc?queue-url=<queue-url>&schedule-time=<schedule-time>Note: It is assumed that the queue denoted by <queue-url> has, already, been created.
Parameters
Name | Type | URI Type | Description | Required |
device-id | Integer | Path | The ID of the device on which to perform the RPC command. | Y |
queue-url | URL | Query | A fully qualified queue URL, where job progress notifications will be sent (See Asynchronous API Usage) | Y |
schedule-time | cron-like-expression | Query | Schedule this API in the future, by specifying a cron-like-expression (See Job Scheduling) | N |
Content Types
-
Consumes content types:
application/vnd.net.juniper.space.device-management.rpc+xml;version=3;charset=UTF-8
application/vnd.net.juniper.space.device-management.rpc+json;version=3;charset=UTF-8 -
Produces content types:
application/vnd.net.juniper.space.device-management.rpc+xml;version=3
application/vnd.net.juniper.space.device-management.rpc+json;version=3 -
Sample Input XML:
Using CDATA
<netconf>
<rpcCommands>
<rpcCommand>
<![CDATA[<get-system-information/>]]>
</rpcCommand>
</rpcCommands>
</netconf> -
Sample Input XML:
Using the Escape Sequence
<netconf>
<rpcCommands>
<rpcCommand>
<get-system-information/>
</rpcCommand>
</rpcCommands>
</netconf> -
Sample Output XML:
<task>
<id>884737</id>
</task> -
Sample Input JSON:
{
"netconf":
{
"rpcCommands":
{
"rpcCommand": ["{\"get-system-information\":\"\"}"]
}
}
} -
Sample Output JSON:
{"task":{"id":917507}}