/api/space/script-management/scripts/exec-scripts
The following operations are supported on this resource:
POST /api/space/script-management/scripts/exec-scripts (v2)
This API executes scripts on devices. Here a script and a device are passed as reference URLs (href).
Access Control
The following capabilities are required to access this API:
"ExecuteScriptCap"
Example Usage
Since this API makes an asynchronous method call, the user must specify a queue parameter with this API.
POST /api/space/script-management/scripts/exec-scripts?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 |
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.script-management.exec-scripts+xml;version=2;charset=UTF-8
application/vnd.net.juniper.space.script-management.exec-scripts+json;version=2;charset=UTF-8 -
Produces content types:
application/vnd.net.juniper.space.script-management.exec-scripts+xml;version=2
application/vnd.net.juniper.space.script-management.exec-scripts+json;version=2 -
Sample Input XML:
<exec-scripts>
<scriptMgmt>
<script href="/api/space/script-management/scripts/294912" />
<device href="/api/space/device-management/devices/458753" />
<scriptVersionSelected>1.1</scriptVersionSelected>
<scriptParams>
<scriptParam>
<paramName>paramName</paramName>
<paramValue>paramValue</paramValue>
</scriptParam>
</scriptParams>
</scriptMgmt>
</exec-scripts> -
Sample Output XML:
<task href="/api/space/job-management/jobs/688128">
<id>688128</id>
</task> -
Sample Input JSON:
{"exec-scripts":
[{"scriptMgmt":
{"script":{"@href":"/api/space/script-management/scripts/294912"},
"scriptVersionSelected":"1.1",
"device":{"@href":"/api/space/device-management/devices/458753"},
"scriptParams":
[{"scriptParam":
{"paramName":"test",
"paramValue":"test"}
}]
}
}]
} -
Sample Output JSON:
{"task":{"@href":"/api/space/job-management/jobs/688132",
"id":688132
}}
For the deprecated versions of this API, refer to :
version 1