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 an Event Profile

    An event profile is a set of event scripts selected from an AI-Script bundle. Using event profiles, you can specify the event scripts that you want to install on Service Now devices.

    Use this API to create an event profile.

    URI

    https://[host]/api/juniper/servicenow/event-profile-management/createEventProfile (HTTP method = POST)

    Consumes

    • application/vnd.juniper.servicenow.event-profile-management.createeventprofile +xml;version=1;charset=UTF-8
    • application/vnd.juniper.servicenow.event-profile-management.createeventprofile +json;version=1;charset=UTF-8

    Request Elements

    Element

    Type

    Description

    profileName

    String

    Name of the event profile

    profileDescription

    String

    Description of the event profile

    scriptBundle

    String

    URL of the script bundle from which the event profile is to be created

    events

    event

    Collection of events in the event profile

    allEvents

    Boolean

    Indicates if all the events should be included in the auto submit policy.

    Possible values:

    • true—All events that are supported by AI-Scripts are included in the auto submit policy.
    • false—All events that are supported by AI-Scripts are not included in the auto submit policy.

      If you set false for this option, you must specify the names and the IDs of the events that you want to include in the event profile.

    event

    event

    An event in the event profile

    ID

    Integer

    ID of the event script in the Service Now database

    Dampening

    String

    Dampening status of the event

    Possible values:

    • NONE—An Incident is created in Service Now for each occurrence of the event.
    • ALWAYS—No incident is created in Service Now after the first occurrence of the event.
    • Dampening interval—Time interval (between 1 hr to 120 hrs) for which an incident is not created for the event when the event recurs on a device.

    priority

    String

    Priority level of the event script. Values are:

    • Critical
    • High
    • Medium
    • Low

    domainId

    Integer

    ID of the domain in which the event profile should be created.

    This is an optional element. If no domain ID is provided, the event profile is created in the Global domain.

    Note: The create request fails if a user does not have access to the Global domain and if no domain ID is provided with the create request.

    Produces

    • application/vnd.juniper.servicenow.event-profile-management.servicenowmsg +xml;version=1
    • application/vnd.juniper.servicenow.event-profile-management.servicenowmsg +json;version=1

    Response Elements

    Element

    Type

    Description

    status

    String

    Status of the create event profile job

    desc

    String

    Description of the job status

    keys

    key

    Collection of IDs of event scripts of events included the event profile

    key

    Integer

    ID of the event script

    Sample Input

    Sample XML Input when allEvents is False

    <createEventProfile>
       <profileName>testEventProfile_12</profileName>
       <description>testEventProfile1Test1</description>
       <scriptBundle uri="/api/juniper/servicenow/scriptbundle-management/scriptbundles/589829" />
       <events>
          <allEvents>false</allEvents>
    <event>
    <id>32770</id>
    <dampening>ALWAYS</dampening>
    </event>
    
       </events>
    </createEventProfile>
    

    Sample XML Input when allEvents is True and dampening is ALWAYS for an Event

    <createEventProfile>
       <profileName>testEventProfile</profileName>
       <description>testEventProfile1Test1</description>
       <scriptBundle uri="/api/juniper/servicenow/scriptbundle-management/scriptbundles/589829" />
       <events>
          <allEvents>true</allEvents>
    <event>
    <id>32770</id>
    <dampening>ALWAYS</dampening>
    </event>
    
       </events>
    </createEventProfile>
    
    
    <createEventProfile>
       <profileName>testEventProfile</profileName>
       <description>testEventProfile1Test1</description>
       <scriptBundle uri="/api/juniper/servicenow/scriptbundle-management/scriptbundles/589829" />
       <events>
          <allEvents>true</allEvents>
    
       </events>
    </createEventProfile>
    

    Sample XML Input when allEvents is True and Without dampening

    <createEventProfile>
       <profileName>testEventProfile</profileName>
       <description>testEventProfile1Test1</description>
       <scriptBundle uri="/api/juniper/servicenow/scriptbundle-management/scriptbundles/589829" />
       <events>
          <allEvents>true</allEvents>
    
       </events>
    </createEventProfile>
    

    Sample JDON Input when allEvents is False

    {
       "createEventProfile": {
          "profileName": "testEventProfile_12",
          "description": "testEventProfile1Test1",
          "scriptBundle": {
             "uri": "/api/juniper/servicenow/scriptbundle-management/scriptbundles/589829"
          },
          "events": {
             "allEvents": "false",
             "event": {
                "id": "32770",
                "dampening": "ALWAYS"
             }
          }
       }
    }
    

    Sample JSON Input when allEvents is True and dampening is ALWAYS for an Event

    {
       "createEventProfile": {
          "profileName": "testEventProfile",
          "description": "testEventProfile1Test1",
          "scriptBundle": {
             "uri": "/api/juniper/servicenow/scriptbundle-management/scriptbundles/589829"
          },
          "events": {
             "allEvents": "true",
             "event": {
                "id": "32770",
                "dampening": "ALWAYS"
             }
          }
       }
    }
    
    

    Sample JSON Input when allEvents is True and Without dampening

    {
       "createEventProfile": {
          "profileName": "testEventProfile",
          "description": "testEventProfile1Test1",
          "scriptBundle": {
             "uri": "/api/juniper/servicenow/scriptbundle-management/scriptbundles/589829"
          },
          "events": {
             "allEvents": "true"
          }
       }
    }
    
    

    Sample Output

    Sample XML Output

    <servicenowmsg>
           <status>
                  <desc>Event profile created successfully</desc>
                  <keys>
                         <key>98306</key>
                  </keys>
           </status>
    </servicenowmsg>
    

    Sample JSON Output

    {
        "servicenowmsg":{
            "status":{
                "desc":"Event profile created successfully",
                "keys":{
                    "key":98306
                }
            }
        }
    }
    

    Response Status Code

    Message

    Description

    500 Internal Server Error

    Profile Name is already in Use

    400 Bad Request

    Profile does not contain any valid events

    404 Not Found

    Invalid Script Bundle ID

    Modified: 2017-08-02