change SANM policy dynamically via REST


Article ID: 129021


Updated On:


CA Spectrum


How to change SANM policy dynamically via REST API.


Component: SPCAEM


1. Stop Notifier.
2. The model handle of the policies are needed.

<Please see attached file for image>

User-added image

3. The associations can be found via CLI.

> show associations mh=0x4048e43
LMHandle    LMName                  Relation                         RMHandle    RMName
0x4048e43   shane                      Has_Filters                      0x4048e42   ShaneFilter
0x4048e41   AlarmNotifier         SANMApp_Is_Scheduled_By          0x4048e43   shane
0x4048e43   shane         SANM_Policy_Schedule             0x4000044   Every month on the 1st at 12AM
0x4048e43   shane                             Is_Associated_With               0x4048e41   AlarmNotifier

> show associations mh=0x4048e41
LMHandle    LMName                            Relation                         RMHandle    RMName
0x4048e41   AlarmNotifier                     SANMApp_Is_Scheduled_By          0x4048e43   shane
0x4048e41   AlarmNotifier                     SANMApp_Is_Scheduled_By          0x4048e44   shaneNew
0x4048e43   shane                             Is_Associated_With               0x4048e41   AlarmNotifier

4. Delete associations via REST client.

"delete" associations/relation/0x00d70001/leftmodel/0x4048f14/rightmodel/0x4048e41

5. Post new associations via REST client. 

"POST" associations/relation/0x00d70001/leftmodel/0x4048f16/rightmodel/0x4048e41

8. Restart Notifier.
9. Verify the alarm filter has changed in emailed alarms.

Additional Information

Notifier needs to be stopped before deleting the set policy as it will set the default policy if it is deleted while notifier is running.
This does not change the policy used until AM is restarted.
There is no way to restart Notifier via REST so a script with cmdC and launchinstdbapp can be used to do so. 
If we change the filters of the set policy while it is running, the changes are seen in emails sent, without needing to restart Notifier.


1558689092494000129021_sktwi1f5rjvs16fsw.png get_app