Sending Messages when DevCS Jobs Fail | OCI Notification Service


OCI Notifications are subscription topics for sending messages to channels like email, rest or pager when things happen.

Example

In the following example we are sending a notification when the start job of an autonomous database fails, for example if the database is already started.

#
oci db autonomous-database start --autonomous-database-id ocid1.autonomousdatabase.oc1.eu-frankfurt-1.abtheljr3....6kfsvmxnge2q || 
{ 
# send notification as it failed
oci ons message publish --topic-id ocid1.onstopic.oc1.eu-frankfurt-1.aaaaaaa...enmktkzyla --title "ATP start failed" --body "Take a look at the build job logs"; 
# exiting saying it failed
exit 1; 
}
#

That’s all folks! Hope it helps 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.