Install an Event Profile on a Device
An event profile is a set of event scripts that are selected from an AI-Script bundle. When you install an event profile on Juniper Networks devices, the event scripts are installed on the devices and provide the information needed to automatically detect and report problem (incident) and information events, thus ensuring maximum network uptime. Service Now uses Device Management Interface (DMI) to install and uninstall AI-Scripts on devices. DMI is an extension to the NETCONF network management protocol.
Use this API to install an event profile on a device.
URI
https://[host] /api/juniper/servicenow/device-management/devices/ {id} /installEventProfile?queue=http://[host]/api/hornet-q/queues/jms.queue.[QueueName] (HTTP method = POST)
Consumes
- application/vnd.juniper.servicenow.device-management.installeventprofile+xml;version=2; charset=UTF-8 for XML request
- application/vnd.juniper.servicenow.device-management.installeventprofile+json;version=2; charset=UTF-8 for JSON request
Request Elements
Element | Type | Description |
---|---|---|
eventprofile | eventprofile | Event profile to be installed |
href | String | Link to the event profile |
neverStoreScriptBundle | Boolean | Flag to store the script bundle on the device
|
removeScriptBundle | Boolean | Flag to remove script bundle from the device after the event profile is installed
|
alterDeviceConfig | Boolean | Flag to modify the device configuration while committing the event profile on the device
Note: This element is applicable only while installing AI-Scripts 5.0 and later on a device for the first time. |
Produces
- application/vnd.juniper.servicenow.device-management.device+xml;version=2 for XML requests
- application/vnd.juniper.servicenow.device-management.device+json;version=2 for JSON requests
Response Elements
Element | Type | Description |
---|---|---|
task | task | Install event profile job |
href | String | Link to the install event profile job |
id | Integer | Device unique identifier |
Sample Input
Example XML Input
<installeventprofile> <eventprofile href="/api/juniper/servicenow/event-profile-management/eventProfiles/163857" /> <neverStoreScriptBundle>false</neverStoreScriptBundle> <removeScriptBundle>false</removeScriptBundle> <alterDeviceConfig>false</alterDeviceConfig> </installeventprofile>
Example JSON Input
{ "installeventprofile": { "eventprofile": { "@href": "/api/juniper/servicenow/event-profile-management/eventProfiles/197067" }, "neverStoreScriptBundle": "false", "removeScriptBundle": "false", ”alterDeviceConfig”: “true” } }
Sample Output
Example XML Output
< task href= "/api/juniper/job-management/jobs/2130040" > < id >2130040< /id > < /task >
Example JSON Output
{ "task": { "href": "/api/juniper/job-management/jobs/2130040", "id": "2130040" } }
Response Status Code
Message | Description |
---|---|
404 Not Found | Invalid address group ID. |
SN-1007 | Address type is not valid. |
SN-1000 | Invalid devices. |