Table: oci_ons_subscription - Query OCI Notification Service Subscriptions using SQL
The Oracle Cloud Infrastructure (OCI) Notification Service is a cloud messaging service for sending notifications to large numbers of recipients. It enables you to broadcast messages to distributed components by topic, through a publish-subscribe pattern. This service ensures that messages are delivered to all active, healthy subscribers in a topic.
Table Usage Guide
The oci_ons_subscription
table provides insights into subscriptions within the OCI Notification Service. As a DevOps engineer, explore subscription-specific details through this table, including subscription protocol, endpoint, and associated metadata. Utilize it to uncover information about subscriptions, such as their delivery policy, effective delivery policy, and the status of the subscription.
Examples
Basic info
Explore which topics are subscribed to in the Oracle Cloud Infrastructure (OCI) messaging service, understanding the lifecycle state and protocol of each. This aids in monitoring the health and status of your subscribed topics for efficient message processing.
select id, topic_id, lifecycle_state, protocol, endpoint, etagfrom oci_ons_subscription;
select id, topic_id, lifecycle_state, protocol, endpoint, etagfrom oci_ons_subscription;
List subscriptions in a pending state
Explore which subscriptions are in a pending state to assess their status and take necessary actions. This is useful in managing subscriptions and ensuring timely activation or termination.
select id, lifecycle_state, protocol, endpointfrom oci_ons_subscriptionwhere lifecycle_state = 'PENDING';
select id, lifecycle_state, protocol, endpointfrom oci_ons_subscriptionwhere lifecycle_state = 'PENDING';
Get subscription count by topic ID
Explore the distribution of subscriptions across different topics. This can be useful to understand which topics are attracting the most subscribers, aiding in content strategy and resource allocation.
select topic_id, count(id) as subscription_countfrom oci_ons_subscriptiongroup by topic_id;
select topic_id, count(id) as subscription_countfrom oci_ons_subscriptiongroup by topic_id;
Get subscription count by protocol
Analyze the distribution of different protocols to understand the overall usage patterns in your Oracle Cloud Infrastructure (OCI) Notification Service subscriptions. This can help in optimizing resource allocation and planning for future requirements.
select protocol, count(protocol) as protocol_countfrom oci_ons_subscriptiongroup by protocol;
select protocol, count(protocol) as protocol_countfrom oci_ons_subscriptiongroup by protocol;
Query examples
- ons_notification_topic_subscription
- ons_notification_topic_unused_count
- ons_subscription_1_year
- ons_subscription_24_hrs
- ons_subscription_30_days
- ons_subscription_365_days
- ons_subscription_90_days
- ons_subscription_age_report
- ons_subscription_by_compartment
- ons_subscription_by_creation_month
- ons_subscription_by_region
- ons_subscription_by_tenancy
- ons_subscription_count
- ons_subscription_unused_count
- ons_subscriptions_for_ons_notification_topic
Control examples
- CIS v1.1.0 > 3 Logging and Monitoring > 3.3 Create at least one notification topic and subscription to receive monitoring alerts
- CIS v1.2.0 > 3 Logging and Monitoring > 3.3 Create at least one notification topic and subscription to receive monitoring alerts
- CIS v2.0.0 > 4 Logging and Monitoring > 4.2 Create at least one notification topic and subscription to receive monitoring alerts
Schema for oci_ons_subscription
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
compartment_id | text | = | The OCID of the compartment in Tenant in which the resource is located. |
created_time | timestamp with time zone | The time when this subscription was created. | |
defined_tags | jsonb | Defined tags for resource. Defined tags are set up in your tenancy by an administrator. Only users granted permission to work with the defined tags can apply them to resources. | |
delivery_policy | jsonb | Delivery Policy of the subscription. | |
endpoint | text | A locator that corresponds to the subscription protocol. | |
etag | text | Used for optimistic concurrency control. | |
freeform_tags | jsonb | Free-form tags for resource. This tags can be applied by any user with permissions on the resource. | |
id | text | = | The OCID of the subscription. |
lifecycle_state | text | The lifecycle state of the subscription. | |
protocol | text | The protocol used for the subscription. | |
region | text | The OCI region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
tenant_id | text | =, !=, ~~, ~~*, !~~, !~~* | The OCID of the Tenant in which the resource is located. |
tenant_name | text | The name of the Tenant in which the resource is located. | |
title | text | Title of the resource. | |
topic_id | text | = | The OCID of the associated topic. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- oci
You can pass the configuration to the command with the --config
argument:
steampipe_export_oci --config '<your_config>' oci_ons_subscription