Receive Notifications for Data Catalog Harvest Events
In this tutorial, you set up the Oracle Cloud Infrastructure Events service to send you an email whenever a Data Catalog harvest job starts, succeeds, or fails in a specific compartment. Key tasks include how to:
Create topics and subscriptions.
Write rules to receive email notifications for events.
Create buckets with data.
Harvest data in Data Catalog.
Before You Begin
To successfully perform this tutorial, you must have:
If you have administrative rights to your account, skip the rest of this
section. Otherwise, have your administrator add the following policy to your
account:
Copy
allow group <the-group-your-username-belongs> to manage all-resources in compartment catalog-compartment
In the next section, you make a compartment for your data catalog instances,
called catalog-compartment.
1. Set Up a Notification 🔗
In this section, you set up the Notifications service to register your email for a custom subscription. Later, you use this subscription, to receive notifications in your email account.
Open the navigation menu and select Observability & Management. Under Events Service, select Rules.
Click Create Rule.
Fill in the following information:
Display Name:catalog-harvest-rule
Description:Receive an email when a harvest job starts, succeeds or fails in the catalog-compartment.
Rule Conditions:
Condition: Event Type
Service Name:
Data Catalog
Event Type: Harvest - Begin
Event Type: Harvest - End
Note
Ensure you select both Harvest-Begin and Harvest-End.
Click + Another Condition.
Fill in the following information:
Rule Conditions:
Condition: Attribute
Attribute Name: CompartmentName
Attribute Values:catalog-compartment
The Rule Logic is automatically populated:
MATCH event WHERE (
eventType EQUALS ANY OF (
com.oraclecloud.datacatalog.harvestjob.end,
com.oraclecloud.datacatalog.harvestjob.begin
)
AND (
compartmentName MATCHES ANY OF (
laleh-catalog-compartment
)
)
)
In the Actions section, fill in the following
information:
Action Type: Notifications
Notifications Compartment:catalog-compartment
Topic:catalog-topic
Click Create Rule.
You have successfully created an event rule for your data catalog harvest
jobs.
3. Create a Bucket with Data 🔗
In this section, you create a bucket in the Object Storage service. Then you add data to the bucket.
In this section, you give the Data Catalog service access to Object Storage resources in the catalog-compartment. This policy allows your data catalog instances to download metadata from the catalog-bucket.
Open the navigation menu and select Identity & Security. Under Identity, select Policies.
Click Create Policy.
Fill in the following information:
Name:catalog-policy
Description:Allow Data Catalog to access Object Storage resources.
In the Policy Builder section, click Customize (Advanced).
Paste the following policy in the policy builder:
Copy
allow service datacatalog to read object-family in compartment catalog-compartment
Click Create.
You have successfully created a policy for data catalog to access object storage
resources including buckets.
4. Harvest the Bucket 🔗
In this section, you create a data catalog instance. Then you connect your data
catalog instance to your bucket and harvest metadata from the bucket. Finally, you review
your email notifications for the harvest jobs.
The "harvestStatus" for a harvestjob.begin event is "IN_PROGRESS", and for a harvestjob.end event is either "SUCCEEDED" or "FAILED".
What's Next 🔗
Congratulations! You successfully received two notification emails, one when a harvest job
started and one when it completed.
Now that you're familiar with harvesting from Oracle Object Storage, go through the following tutorials and create notifications for other types of data sources: