| name | oraclecloud-webhooks-events |
| description | Wire up event-driven workflows with OCI Events, Notifications, and Functions.
Use when building serverless event processing, subscribing to instance lifecycle changes, or routing audit events to alerting systems.
Trigger with "oraclecloud webhooks events", "oci events rules", "oci notifications", "oci ons topics".
|
| allowed-tools | Read, Write, Edit, Bash(pip:*), Bash(oci:*), Grep |
| version | 1.7.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","oraclecloud","oci"] |
| compatibility | Designed for Claude Code |
Oracle Cloud Webhooks & Events
Overview
Build event-driven workflows using the OCI Events service, Oracle Notification Service (ONS), and OCI Functions. OCI Events monitors resource state changes across your tenancy and fires rules that route events to ONS topics, streaming, or Functions. This skill covers event rule creation, ONS topic/subscription setup, event pattern matching syntax, and Functions integration.
Purpose: Create reliable event-driven pipelines that react to OCI resource changes in real time.
Prerequisites
- OCI Python SDK —
pip install oci
- OCI config file at
~/.oci/config with valid credentials (user, fingerprint, tenancy, region, key_file)
- IAM policies granting access to Events, ONS, and Functions:
Allow group EventAdmins to manage cloudevents-rules in compartment <name>
Allow group EventAdmins to manage ons-topics in compartment <name>
Allow group EventAdmins to use fn-function in compartment <name>
- Compartment OCID for the target compartment
- Python 3.8+
Instructions
Step 1: Create an ONS Topic and Subscription
Create a notification topic that will receive events, then subscribe an endpoint (email, HTTPS, PagerDuty, or Slack via HTTPS):
import oci
config = oci.config.from_file("~/.oci/config")
ons_control = oci.ons.NotificationControlPlaneClient(config)
ons_data = oci.ons.NotificationDataPlaneClient(config)
topic_response = ons_control.create_topic(
oci.ons.models.CreateTopicDetails(
name="infra-alerts",
compartment_id="ocid1.compartment.oc1..example",
description="Infrastructure lifecycle alerts"
)
)
topic_id = topic_response.data.topic_id
print(f"Topic created: {topic_id}")
subscription = ons_data.create_subscription(
oci.ons.models.CreateSubscriptionDetails(
topic_id=topic_id,
compartment_id="ocid1.compartment.oc1..example",
protocol="HTTPS",
endpoint=
)
)
()