Notifications Example: Emails for Maintenance Events

This example shows how to use the Events and Notifications services to generate emails when maintenance events occur on Exadata Infrastructure and Autonomous Container Database resources. These maintenance events are:

  • Maintenance Scheduled for an Exadata Infrastructure resource
  • Maintenance Reminder for an Exadata Infrastructure resource
  • Maintenance Begin for an Exadata Infrastructure resource
  • Maintenance End for an Exadata Infrastructure resource
  • Maintenance Scheduled for an Autonomous Container Database resource
  • Maintenance Reminder for an Autonomous Container Database resource
  • Maintenance Begin for an Autonomous Container Database resource
  • Maintenance End for an Autonomous Container Database resource

Use Case

The I.T. department for Acme Company would like emails sent to its Fleet Adminstrators email group (autonomous-fleet-admin-group@acme.example.com) whenever a maintenance event occurs on any of its Exadata Infrastructure or Autonomous Container Database resources. All of these resources are created in their AcmeContainerDBs compartment.

High-Level Steps

  1. Create a notifications service topic.

  2. Add an email subscription to the topic.

  3. Add an events service rule to send maintenance events to the notifications service topic.

Note:

The user who performs these steps must have "manage ons-topics" and "manage ons-subscriptions" policies for the compartment in which the topic and subscription are created; for example:

allow group AcmeFAs to manage ons-topics in compartment AcmeContainerDBs
allow group AcmeFAs to manage ons-subscriptions in compartment AcmeContainerDBs

Step 1. Create a Notifications Topic

An administrator for Acme Company's cloud tenancy creates the Acme-Autonomous-Maintenance notifications topic in the AcmeContainerDBs compartment.

  1. On the Oracle Cloud Infrastructure Home page, click the Menu icon menu icon in the top corner to display the side menu, hover over Application Integration to expand its submenu, and then select Notifications.

    The list of notifications topics in the root compartment is displayed.

  2. In the side menu’s Compartment list, select the AcmeContainerDBs compartment.

    The list of notifications topics refreshes to show those in the AcmeContainerDBs compartment.

  3. Click Create Topic to open the Create Topic window.

  4. In the Create Topic window, enter Acme-Autonomous-Maintenance in the Name field and then click Create.

    The Create Topic window closes and the list of notifications topics refreshes to show the newly created topic.

For detailed information about creating topics, see Using Console in Oracle Cloud Infrastructure Documentation.

Step 2. Add a Subscription to the Notifications Topic

An administrator for Acme Company's cloud tenancy adds an email subscription to the Acme-Autonomous-Maintenance notifications topic.

  1. Go to the Topic Details page for the Acme-Autonomous-Maintenance notifications topic by clicking its name in the list of notification topics in the AcmeContainerDBs compartment.

  2. In the side menu’s Resources list, make sure Subscriptions is selected.

  3. Click Create Subscription to open the Create Subscription window.

  4. In the Create Subscription window, provide the following information:

    • In the Protocol list, select Email.

    • In the Email field, enter autonomous-fleet-admin-group@acme.example.com.

    When finished, click Create.

    The Create Subscription window closes and the Subsciption Details page for the newly created subscription is displayed. Note that it is Pending confirmation.

  5. Sign in to an email account that is part of the autonomous-fleet-admin-group group alias. Then, open the email "Oracle Cloud Infrastructure Notifications Service Subscription Confirmation" and confirm the email address.

Step 3. Add an Events Service Rule

An administrator for Acme Company's cloud tenancy creates the Acme-Autonomous-Maintenance events service rule in the AcmeContainerDBs compartment, specifying maintenance events as the triggering condition and delivery to the Acme-Autonomous-Maintenance notifications topic as the action.

  1. On the Oracle Cloud Infrastructure Home page, click the Menu icon menu icon in the top corner to display the side menu, hover over Application Integration to expand its submenu, and then select Events Service.

  2. In the side menu’s Compartment list, select the AcmeContainerDBs compartment.

    The list of rules shows the events service rules in the AcmeContainerDBs compartment.

  3. Click Create Rule to open the Create Rule window.

  4. In the Create Subscription window, enter Acme-Autonomous-Maintenance in the Display Name field and complete the Rule Conditions and Actions sections as follows:

    • Rule Conditions

      In the first list, select Event Type as the basis of the condition. Then, in the Service Name list, select Database. Finally, in the Event Type list, select the following event types one at a time:

      • Autonomous Container Database - Maintenance Begin
      • Autonomous Container Database - Maintenance End
      • Autonomous Container Database - Maintenance Reminder
      • Autonomous Container Database - Maintenance Scheduled
      • Exadata Infrastructure - Maintenance Begin
      • Exadata Infrastructure - Maintenance End
      • Exadata Infrastructure - Maintenance Reminder
      • Exadata Infrastructure - Maintenance Scheduled
    • Actions

      In the Action Type list, select Notifications. Then, in the Notifications Compartment list, select AcmeContainerDBs. Finally, in the Topic list, select Acme-Autonomous-Maintenance.

    When finished, click Create Rule.

    The Create Subscription window closes and the Details page for the newly created rule is displayed.