イベント・サービスと通知を使用してADBインスタンス起動通知
Oracle Cloudにおいて
ComputeやAutonomous Databaseなどの起動をスケジュールしており、起動したことを通知することをOCI イベント・サービスと通知サービスを使用して実装してみた。

※ イベント・サービス の アクション には、アクション・タイプ として ストリーミング / 通知 / ファンクション の設定が可能です。
※ 今回は 通知 を利用してメール通知します。
※ イベント・タイプ は、Autonomous Database – Start End を設定します。
作業ステップ
- 「通知」の設定
- トピックの作成
- サブスクリプションの作成・有効化
 
- イベント・ルールの設定
- ルールの作成
 
- 動作確認
「通知」の設定
「通知」方法として電子メールを使用する「通知」の設定
- Webコンソール のメニューから 「通知」 を選択
3.「トピックの作成」
- 「名前」 を入力
- 「説明」 を入力(任意)
- 「作成」 をクリック
サブスクリプションの作成
サブスクリプションの有効化
①. ステータスが「PENDING(確認待ち)」になっていることを確認
②. 電子メール通知の有効化
- 
Confirmation Mail のメールを確認 
- 
「Confirm Confirmed」の画面確認 
イベント・サービスの設定
「Autonomous Database – Start End」のイベントが発生した際に電子メールを使用する「通知」を呼び出す設定
①. Webコンソール のメニューから 「イベント・サービス」 を選択

③.「ルールの作成」
1.  「表示名」 にルールの名前を入力
2.  「説明」 を入力

3. 条件に「イベント・タイプ」を選択
4. サービス名に「Database」を選択
5. イベント・タイプ で「Autonomous Database – Start End」 を選択

6. アクション・タイプで「通知」を選択
7. 通知コンパートメントで通知を作成したコンパートメントを選択
8. トピックに通知で作成したトピックを選択
9. 「ルールの作成」をクリック

設定のテスト
(別途作成した)Autonomous Database を起動

※ 同一リージョン 内で対象としたコンパートメント配下で、Autonomous Database を起動
※イベント の対象リソースに関しては、 ルール作成や編集画面で、Condition を追加し、Attribute を選択することで、名前などで絞り込むことも可能
「通知」サービスからのメール例
「イベント・サービス」メトリックの確認
「配信されたイベント」がカウントされていることを確認
おわりに
イベント・サービスと通知を使用してAutonomous Databaseインスタンスが起動した際に電子メール通知を確認することができた。
参考情報
- イベントを生成するサービス
- Autonomous Database – サポートされているイベント・タイプ
| Database | Container Database | Exadata Infrastructure | |
|---|---|---|---|
| Automatic Failover | Begin-End | ||
| Change Compartment | Begin-End | ||
| Create Backup | Begin-End | Begin-End | |
| Create | Begin-End | Begin-End | Begin-End | 
| Disable Data Guard | Begin-End | ||
| Enable Data Guard | Begin-End | ||
| Manual Failover | Begin-End | ||
| Peer Database Provisioning | Begin-End | ||
| Restore | Begin-End | Begin-End | |
| Start | Begin-End | ||
| Stop | Begin-End | ||
| Switchover | Begin-End | ||
| Terminate | Begin-End | Begin-End | Begin-End | 
| Update | Begin-End | Begin-End | Begin-End | 
| Upgrade | Begin-End | ||
| Change Compartment | ✔️ | ✔️ | |
| Free Database Automatic Stop Reminder | ✔️ | ||
| Free Database Automatically Stopped | ✔️ | ||
| Free Database Automatic Termination Reminder | ✔️ | ||
| Free Database Automatically Terminated | ✔️ | ||
| Maintenance | Begin-End | ||
| Maintenance Reminder | ✔️ | ✔️ | |
| Maintenance Scheduled | ✔️ | ✔️ | |
| Restart | Begin-End | 













