SAM/MnR/TCSA: How to create, update, delete notification using EDAA API?
Smarts-10.1.x
MnR/Watch4Net-7.x
TCSA-2.x
API action can be performed using Curl or any third party tool like POSTMAN.
All actions are demonstrated below using POSTMAN tool.
Perform POST as http://<SAM_IP/FQDN>:8080/smarts-edaa/msa/<DOMAIN_NAME>/instances/ICS_NotificationFactory::ICS-NotificationFactory/action/makeNotification?alt=json
with body:
{
"arguments": {
"className": "Router",
"instanceName": "Test",
"eventName": "Down"
}
}'
Perform PUT as http://<SAM_IP/FQDN>:8080/smarts-edaa/msa/<DOMAIN_NAME>/instances/ICS_Notification::NOTIFICATION-Router_Test_Down?alt=json
with body:
{
"ICS_Notification": {
"Severity": "2"
}
}'
Perform PUT as http://
<SAM_IP/FQDN>:8080
/smarts-edaa/msa/<DOMAIN_NAME>
/instances/ICS_Notification::NOTIFICATION-Router_Test_Down?alt=json
Example for Curl:
curl -k -u <username>:<password> -XPOST -H 'Content-Type: application/json' http://
/smarts-edaa/msa/<SAM_IP/FQDN>:8080
/instances/ICS_NotificationFactory::ICS-NotificationFactory/action/makeNotification?alt=json -d '<DOMAIN_NAME>
{
"arguments": {
"className": "Router",
"instanceName": "Test",
"eventName": "Down"
}
}'
Similarly, other actions can be performed. For update payload, refer above example from POSTMAN.
Reference: Smarts_EDAA_GUIDE
All demonstrated actions will create notification in domain however it will not be visible in SAM's console, this is due to fact that we are initiating makeNotification but not calling NL_Notify and NL_Change.
Perform POST as http://
with body:
/smarts-edaa/msa/<SAM_IP/FQDN>:8080
<DOMAIN_NAME>
/instances/ICS_Notification::NOTIFICATION-Router_Test_Down
/action/notify?alt=json
{
"arguments": {
"User": "<USER_NAME>",
"Source": "<DOMAIN_NAME>",
"AuditTrailText": "Notified by <USER_NAME> from External"
}
}'
Perform POST as http://
with empty body.
/smarts-edaa/msa/<SAM_IP/FQDN>:8080
<DOMAIN_NAME>
/instances/ICS_Notification::
/changed?alt=json NOTIFICATION-Router_Test_Down
/action