Create a Service Insight Notification
Use this API to create a notification in Junos space Service Insight.
URI
https://[host]/api/juniper/serviceinsight/notification-management/createNotification (HTTP method = POST)
Consumes
- application/vnd.juniper.serviceinsight.notification-management.createNotification+ xml;version=1
- application/vnd.juniper.serviceinsight.notification-management.createNotification+ json;version=1
Request Elements
Element | Type | Description |
---|---|---|
name | String | Name of the notification |
trigger | String | Trigger to send notification in the form of e-mail or SNMP traps to users when conditions specified in the trigger filter are met Possible values:
|
filter | filter | Filter used by Service Insight to send the notification in the form of e-mail or SNMP traps |
organization | String | Organization used in the filter |
deviceGroup | String | Device group used in the filter |
deviceName | String | Device name used in the filter |
serialNumber | String | Serial number of the device used in the filter |
hasTheWords | String | String used in the filter An object is filtered and a notification sent when the object contains the words in this element. |
doesNotHave | String | String used in the filter An object is filtered when the object does not contain the words in this element. |
emails | Collection of e-mail IDs to which the notification must be flagged | |
String | E-mail IDs to which notifications must be flagged | |
snmpTraps | snmpTraps | Collection of SNMP traps for sending notifications |
snmpTrap | snmpTrap | An SNMP trap |
uri | String | URI of the SNMP trap |
href | String | Link to the SNMP trap |
domianId | Integer | ID of the domain in which the Service Insight notification should be created This is an optional element. If no domain ID is provided, the notification 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.serviceinsight.notification-management.ServiceInsightMsg+ xml;version=1
- application/vnd.juniper.serviceinsight.notification-management.ServiceInsightMsg+ json;version=1
Response Elements
Element | Type | Description |
---|---|---|
msg | String | Status message of the create Service Insight notification job |
Sample Input
Sample XML Output
<notification> <name>Test</name> <trigger>NEW_EOL_MATCH</trigger> <filter> <organization uri="/api/juniper/servicenow/organization-management/organization/33456"/> <deviceGroup uri="/api/juniper/servicenow/device-group-management/deviceGroup/33456"/> <deviceName>abc</deviceName> <serialNumber>1278</serialNumber> <hasTheWords>None</hasTheWords> <doesNotHave>None</doesNotHave> </filter> <snmpTraps> <snmpTrap uri="="/api/juniper/servicenow/global-setting-management/snmp-configuration- management/snmpConfiguration/98304"/> </snmpTraps> <emails> <email>abc@test.com</email> </emails> </notification>
Sample JSON Output
{ "notification": { "name": "Test-json-eol", "trigger": "NEW_EOL_MATCH", "filter": { "organization": { "@uri": "/api/juniper/servicenow/organization-management/organization/34732" }, "deviceGroup": { "@uri": "/api/juniper/servicenow/device-group-management/deviceGroup/34733" }, "deviceName": "mx-80-sn2", "serialNumber": "D4358", "hasTheWords": "None", "doesNotHave": "None" }, "snmpTraps": { "snmpTrap": { "@uri": "/api/juniper/servicenow/global-setting-management/snmp-configuration-management/snmpConfiguration/65567" } }, "emails": { "email": "deeptij@juniper.net" } } }
Sample Output
Sample XML Output
<serviceinsightmsg> <msg> successfully created notification with name as =TestNotification </msg> </serviceinsightmsg>
Sample JSON Output
{ "serviceinsightmsg": { "msg": "successfully created notification with name as =TestNotification" } }