The Latest NetApp News
Product and Solution Information, Press Releases, Announcements
ONTAP REST APIs: Automate Notification of High-Severity Events | |||||||||||
Posted: Fri Jul 17, 2020 09:39:14 AM | |||||||||||
A priority for IT organizations is the ability to manage various levels of severity. “Severity” differs for every organization, depending on the use case. An event can be of high severity — for example, an emergency, alert, or error message — or it could be of low severity, as with a notice or informational message. Most customers want the flexibility to choose and automate which events and severity they should get notified for. ONTAP® REST APIs simplifies the event management with modernized and consolidate direct REST endpoints and Python Client Libraries, which enables users to get notified of preferred events automatically. EventsNetApp® ONTAP® software has various types of messages for all the storage actions and operations it performs (for example, callhome.vol.space.crit, sm.syncmirror.out.of.sync). There are also predefined filters (for example, default-trap-events, important-events) that can alert you about severe events. You can also customize your own filters that uses the predefined messages and severity levels available in ONTAP. Before proceeding further, let’s clarify some of this terminology:
Figure 1: Configure Events using CLI and ONTAP REST APIs Here’s an example. If you want to set an email alert for any disk failure, you would perform these steps:
After completing these steps, you get notifications at the destination according to the filters applied. By using the modernized, consolidated ONTAP REST calls, you can manage events in an easier, simpler way than before. For example, you can make a single POST call to create a filter with all rules applied, rather than executing separate commands in the CLI. The following mapping shows how each command is simplified to a direct REST call.
Take a look at our sample script that covers three common event management use cases with REST APIs:
Code Snippet# Key Value arguments for destination creation dataobj = {} dataobj = {“destination”: destination, “filters”: [{“name”: filter_name}], “name”: destination_name, “type”: dest_type} url = “https://{}/api/support/ems/destinations/”.format(cluster)response = requests.post(url,headers=headers_inc,json=dataobj,verify=False) |