Related Documentation
- Junos Space
- Get Information About an Event Profile
- Install Event Profile on Devices
- Export All Event Profiles by Type
- Export Event Profiles by ID and Type
- Get Event Profiles Import Job Results
- Clone an Event Profile
- Set an Event Profile as the Default Event Profile
- Event Profile Management REST API Overview
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:
|
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:
|
priority | String | Priority level of the event script. Values are:
|
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 |
Related Documentation
- Junos Space
- Get Information About an Event Profile
- Install Event Profile on Devices
- Export All Event Profiles by Type
- Export Event Profiles by ID and Type
- Get Event Profiles Import Job Results
- Clone an Event Profile
- Set an Event Profile as the Default Event Profile
- Event Profile Management REST API Overview