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

    Create On-Demand Incident

    Use this API to generate Juniper Message Bundles (JMBs) without having to wait for events to occur on devices.

    URI

    https://[host]/api/juniper/servicenow/device-management/devices/ createOnDemandIncident ?queue=http://[host]/api/hornet-q/queues/jms.queue.[QueueName] (HTTP method = POST)

    URI Parameters

    Parameter

    Type

    Required

    Description

    QueueName

    String

    Yes

    Name of the create on-demand incident job queue

    Consumes

    • application/vnd.juniper.servicenow.device-management.ondemandincident +xml;version=4;charset=UTF-8
    • application/vnd.juniper.servicenow.device-management.ondemandincident +json;version=4;charset=UTF-8

    Accept Header

    • application/vnd.juniper.servicenow.device-management.ondemandincidentresult+xml; version=5
    • application/vnd.juniper.servicenow.device-management.ondemandincidentresult+json; version=5

    Request Elements

    Element

    Type

    Description

    devices

    device

    Collection of devices on which on-demand incident is to be generated

    device

    device

    A device on which on-demand incident is to be generated

    uri

    String

    Link to the device

    followUpMethod

    String

    Method used to follow up the case created for the on-demand incident

    Possible values:

    • EMAIL_FULL_TEXT_UPDATE
    • EMAIL_WEB_LINK
    • PHONE_CALL

    For an end-customer Service Now, a value need not be provided for followUpMethod. Any value, if provided, is discarded.

    caseCCList

    caseCCList

    Collection of e-mail ID of users to be notified about the on-demand incident

    email

    String

    E-mail ID of a user

    Priority

    Enum

    Priority of the on-demand incident

    Possible values:

    • Critical
    • High
    • Medium
    • Low

    problemSynopsis

    String

    Synopsis of the on-demand incident

    problemDescription

    String

    Description of the incidnet

    customerComments

    String

    Comments from user for the on-demand incident

    createCase

    Boolean

    Flag to indicate whether the incident should be submitted to JSS or Service Now partner for creating a case

    Possible values:

    • true—The incident is submitted for creating a case
    • false—The incident is not submitted for creating a case

    collectLogFiles

    Boolean

    Flag to indicate whether or not log files should be collected for this on-demand incident

    Possible values:

    • true—Log files are collected for the on-demand incident
    • false—Log files are not collected for the on-demand incident

    verifyCPUUsage

    Boolean

    Flag to indicate whether or not usage of device CPU must be verified while generating this on-demand incident

    Possible values:

    • true—CPU usage is verified
    • false—CPU usage is not verified

    Produces

    • application/vnd.juniper.servicenow.device-management.ondemandincidentresult+xml; version=5
    • application/vnd.juniper.servicenow.device-management.ondemandincidentresult+json; version=5

    Response Elements

    Note: The response contains on-demand incident ID only if AI-Scripts Release 5.0R5 and later releases are installed on the device; otherwise, the response contains only the ID of the create on-demand incident job.

    Element

    Type

    Description

    Ondemandincidentresult

    ondemandincidentresult

    Result of create on-demand incident job

    IncidentDetailsList

    IncidentDetailsList

    List of on-demand Incident details

    IncidentDetails

    IncidentDetails

    Details of an on-demandincident

    IncidentId

    Integer

    ID of the on-demand incident

    DeviceId

    Integer

    ID of the device

    DeviceName

    String

    Name of the device

    Task

    Task

    Job to create the on-demand incident

    Id

    Integer

    ID of the job to create on-demand incident

    Sample Input

    Sample XML Input

    <ondemandincident>
    	<devices>
    		<device uri="/api/juniper/servicenow/device-management/devices/65552"/>
    	</devices>
    	<followUpMethod>Email Full Text Update</followUpMethod>
    	<caseCCList>
    		<email>abc@juniper.net</email>
    	</caseCCList>
    	<priority>Critical</priority>
    	<problemSynopsis>
    		These are my synopsis comments here
    	</problemSynopsis>
     <problemDescription>
         This is a Test case.
     </problemDescription>
    	<customerComments>
    		These are my customer comments here
    	</customerComments>
    	<createCase>false</createCase>
    	<collectLogFiles>true</collectLogFiles>
    	<verifyCPUUsage>true</verifyCPUUsage>
    	<useOffBoxJMBProcessing>true</useOffBoxJMBProcessing>
    </ondemandincident>
    
    

    Sample JSON Input

    {
    "ondemandincident":{
    "devices":{
    "device":[
    {
    "@uri":"/api/juniper/servicenow/device-management/devices/65546"
    },
    ]
    },
    "followUpMethod":"Email Full Text Update",
    "caseCCList":{
    "email":[
    "abc@juniper.net"
    ]
    },
    "priority":"High",
    "synopsisComments":"This is a Test case, please ignore",
    "problemDescription":"This is a Test case, please ignore",
    "customerComments":"This is a Test case, please ignore",
    “createCase”: "true",
    "collectLogFiles": "false",
    "verifyCPUUsage": "false",
    "useOffBoxJMBProcessing": "true"
    }
    }

    Sample Output

    Sample XML Output

    Response when on-demand incident is created when AI-Scripts Release 5.0R4 and earlier is installed on a device.
    <task href="/api/space/job-management/jobs/3801101">
            <id>3801101</id>
        </task>
    
    Response when on-demand incident is created when AI-Scripts Release 5.0R5 and later is installed on a device.
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <OnDemandIncidentProcessingResult>
        <IncidentDetailsList>
            <IncidentDetails>
                <IncidentId>5538586</IncidentId>
                <DeviceId>5505597</DeviceId>
                <DeviceName>fuga</DeviceName>
            </IncidentDetails>
        </IncidentDetailsList>
        <Task>
            <id>7602244</id>
        </Task>
    </OnDemandIncidentProcessingResult>
    
    
    

    Sample JSON Output

    Response when on-demand incident is created when AI-Scripts Release 5.0R4 and earlier is installed on a device.
    {
       "task":{
          "@href":"/api/space/job-management/jobs/3801101",
          "id":3801101
       }
    }
    
    Response when on-demand incident is created when AI-Scripts Release 5.0R5 and later is installed on a device.
    {
       "OnDemandIncidentProcessingResult": {
          "IncidentDetailsList": {
             "IncidentDetails": {
                "IncidentId": "5538586",
                "DeviceId": "5505597",
                "DeviceName": "fuga"
             }
          },
          "Task": {
             "id": "7602244"
          }
       }
    }
    

    Error Codess

    Message

    Description

    400 Bad Request

    • An on-demand incident cannot be created if more than five devices are selected.
    • The device is not associated with any device group.
    • The device Is an end-customer device.
    • The device Is a fabric node (TOR).
    • The device Is a DCF device.
    • The follow-up method specified in the request is invalid.
    • The priority specified in the request is invalid.
    • The e-mail ID specified in the request is invalid.

    404 Not Found

    The device specified in the request is not a valid Service Now device.

    Modified: 2017-01-08