Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Uninstall Script Bundle from a Device

    Use this API to uninstall a Script Bundle from a device running Junos OS and 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 (HTTP method = GET)

    URI Parameters

    Parameter

    Type

    Required

    Description

    job-id

    Integer

    Yes

    ID of the uninstall script bundle job

    Consumes

    None

    Produces

    None

    Response Elements

    Element

    Type

    Description

    uri

    String

    Link to the collection of uninstall script bundle job result

    total

    Integer

    Number of records in the collection

    jobResult

    jobResult

    An uninstall script bundle job result

    ID

    Integer

    ID of the script bundle in the 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 Network Management Platform

    jobType

    String

    Type of job; the value is always uninstall in this operation

    serviceNowDeviceID

    Integer

    ID of the device in the Service Now database.

    spaceDeviceID

    Integer

    ID of the device in Junos Space Platform.

    jobStatus

    Enum

    Status of the script bundle uninstallation job

    Possible values are:

    • Success—The script bundle is successfully uninstalled from the device.
    • Failed—Uninstallation of the script bundle failed on the device.
    • Scheduled—The script bundle is scheduled to be uninstalled from the device.

    jobRemarks

    String

    Remarks about the uninstallation job

    jobSteps

    jobSteps

    Provides details about the steps performed for uninstalling the script bundle from the device and the results of each step

    The steps are:

    • Connecting to the device
    • Deleting configuration
    • Uninstalling event profile
    • Deleting .slax files from the device

    id

    Integer

    ID of the job step

    stepName

    String

    Name of the step

    jobStatus

    String

    Status of the step in the uninstallation 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/ 163852/event-profiles-install-job-results" total="1"> 
     <jobResult> 
      <id>32771</id> 
      <profileId>0</profileId> 
      <bundleId>0</bundleId> 
      <jobType>UnInstall</jobType> 
      <serviceNowDeviceID>34631</serviceNowDeviceID>
      <spaceDeviceID>-1</spaceDeviceID>
      <jobStatus>FAILED</jobStatus>
      <jobRemarks>Error: Could not connect to the device.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>35183</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>35184</id>
      <stepName>Deleting configuration</stepName> 
      <joStatus>NOTSTARTED</joStatus> 
      </jobSteps> 
      <jobSteps> 
      <id>35185</id> 
      <stepName>Uninstall event profile</stepName> 
      <joStatus>NOTSTARTED</joStatus> 
      </jobSteps> 
      <jobSteps> 
      <id>35186</id> 
      <stepName>Delete slax file</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/ 393223/event-profiles-install-job-results",
          "@total":"1",
          "jobResult":{  
             "id":32771,
             "profileId":0,
             "bundleId":0,
             "jobType":"UnInstall",
             "serviceNowDeviceID":393217,
             "spaceDeviceID":-1,
             "jobStatus":"FAILED",
             "jobRemarks":"Error: Could not connect to the device.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":426316,
                   "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":426317,
                   "stepName":"Deleting configuration",
                   "joStatus":"NOTSTARTED"
                },
                {  
                   "id":426318,
                   "stepName":"Uninstall event profile",
                   "joStatus":"NOTSTARTED"
                },
                {  
                   "id":426319,
                   "stepName":"Delete slax file",
                   "joStatus":"NOTSTARTED"
                  }
             }
       }
    

    Error Codes

    Message

    Description

    200 OK

    The script bundle was successfully uninstalled from the device.

    Modified: 2016-08-10