Install Script Bundle on a Device
Use this API to install a script bundle on a device managed by Service Now. The Retrieve Job Details API https://{host-id} api/space/job-management/jobs/{jobs-id} outputs the URI for this API.
URI
https://{host-id}/api/juniper/servicenow/event-profile-management/eventProfiles/ job-instances/{job-id}/event-profiles-install-job-results
URI Parameters
Parameter | Type | Required | Description |
---|---|---|---|
job-id | Integer | Yes | ID of the job for installing service bundle on a device |
Consumes
None
Produces
None
Response Elements
Element | Type | Description |
---|---|---|
uri | String | URI to the collection of install script bundle job results |
total | Integer | Number of records in the collection |
jobResult | jobResult | A install script bundle job result |
id | Integer | ID of the script bundle in Service Now database |
profileId | Integer | ID of the event profile associated with the script bundle |
bundleId | Integer | ID of the script bundle in Junos Space |
jobType | String | Type of job; the value is always Install in this operation |
serviceNowDeviceID | Integer | ID of the device on which the script bundle is installed in the Service Now database |
spaceDeviceID | Integer | ID of the device on which the script bundle is installed in Junos Space Network Management Platform |
jobStatus | String | Status of the script bundle installation job Possible values are:
|
jobRemarks | String | Remarks about the script bundle installation job |
jobSteps | jobSteps | Provides details about the steps performed for installing the script bundle on the device and the results of each step The steps include:
|
id | Integer | ID of the job step |
stepName | String | Name of the step |
jobStatus | String | Status of the step in the installation job |
detailedJobRemarks | String | Remarks about the step |
Sample Output
Sample XML Output
<event-profiles-install-job-results uri="/api/juniper/servicenow/event-profile-management/eventProfiles/job-instances/ 163850/event-profiles-install-job-results" total="1"> <jobResult> <id>32770</id> <profileId>33654</profileId> <bundleId>33211</bundleId> <jobType>Install</jobType> <serviceNowDeviceID>34631</serviceNowDeviceID> <spaceDeviceID>-1</spaceDeviceID> <jobStatus>FAILED</jobStatus> <jobRemarks> An error occurred during Event Profile installation. The device configuration is not in Sync. Please make sure the device 'Managed status' in Manage Device (space platform) should be 'In Sync' before installing/uninstalling AI script. </jobRemarks> <jobSteps> <id>35177</id> <stepName>Connect to device</stepName> <joStatus>FAILURE</joStatus> <detailedJobRemarks> The device configuration is not in Sync. Please make sure the device 'Managed status' in Manage Device (space platform) should be 'In Sync' before installing/uninstalling AI script. </detailedJobRemarks> </jobSteps> <jobSteps> <id>35178</id> <stepName>Copy script bundle to device</stepName> <joStatus>NOTSTARTED</joStatus> </jobSteps> <jobSteps> <id>35179</id> <stepName>Commit configuration</stepName> <joStatus>NOTSTARTED</joStatus> </jobSteps> <jobSteps> <id>35180</id> <stepName>Install script bundle on device</stepName> <joStatus>NOTSTARTED</joStatus> </jobSteps> <jobSteps> <id>35181</id> <stepName>Copy slax file to device</stepName> <joStatus>NOTSTARTED</joStatus> </jobSteps> <jobSteps> <id>35182</id> <stepName>Commit slax file on device</stepName> <joStatus>NOTSTARTED</joStatus> </jobSteps> </jobResult> </event-profiles-install-job-results>
Sample JSON Output
{ "event-profiles-install-job-results":{ "@uri":"/api/juniper/servicenow/event-profile-management/ eventProfiles/job-instances/393221/event-profiles-install-job-results", "@total":"1", "jobResult":{ "id":32770, "profileId":33654, "bundleId":33211, "jobType":"Install", "serviceNowDeviceID":393217, "spaceDeviceID":-1, "jobStatus":"FAILED", "jobRemarks":"An error occurred during Event Profile installation. The device configuration is not in Sync. Please make sure the device 'Managed status' in Manage Device (space platform) should be 'In Sync' before installing/uninstalling AI script.", "jobSteps":[ { "id":426304, "stepName":"Connect to device", "joStatus":"FAILURE", "detailedJobRemarks":"The device configuration is not in Sync. Please make sure the device 'Managed status' in Manage Device (space platform) should be 'In Sync' before installing/uninstalling AI script." }, { "id":426305, "stepName":"Copy script bundle to device", "joStatus":"NOTSTARTED" }, { "id":426306, "stepName":"Commit configuration", "joStatus":"NOTSTARTED" }, { "id":426307, "stepName":"Install script bundle on device", "joStatus":"NOTSTARTED" }, { "id":426308, "stepName":"Copy slax file to device", "joStatus":"NOTSTARTED" }, { "id":426309, "stepName":"Commit slax file on device", "joStatus":"NOTSTARTED" },
Error Codes
Message | Description |
---|---|
200 OK | The script bundle was installed correctly. |