Table: oci_budget_alert_rule - Query OCI Budgets Alert Rules using SQL
Oracle Cloud Infrastructure (OCI) Budgets service allows you to set budget thresholds and send notifications when the thresholds are exceeded. Alert rules can be set up to track spending and usage, allowing users to manage their costs and consumption effectively. Alert rules are associated with a specific budget and trigger notifications based on the thresholds defined.
Table Usage Guide
The oci_budget_alert_rule
table provides insights into alert rules within OCI Budgets service. As a financial analyst or cloud cost manager, you can explore details about each alert rule through this table, including the associated budget, threshold, and type of alert. Use this table to track and manage spending, understand cost trends, and ensure budget compliance.
Examples
Basic info
Explore the financial boundaries of your project by identifying the alert rules in your budget. This query can help you assess the financial health and lifecycle state of your project.
select display_name, id, budget_id, threshold, lifecycle_state as statefrom oci_budget_alert_rule;
select display_name, id, budget_id, threshold, lifecycle_state as statefrom oci_budget_alert_rule;
List alert rules that are not active
Explore which budget alert rules within your OCI environment are not currently active. This is useful for identifying potential savings or areas where budget tracking may not be effectively implemented.
select display_name, id, budget_id, threshold, lifecycle_state as statefrom oci_budget_alert_rulewhere lifecycle_state <> 'ACTIVE';
select display_name, id, budget_id, threshold, lifecycle_state as statefrom oci_budget_alert_rulewhere lifecycle_state <> 'ACTIVE';
List alert rules with a threshold more than 100 percentage
Determine the areas in which budget alert rules have been set with a threshold exceeding 100 percent. This can be useful to identify potential errors or overly conservative settings in your financial monitoring.
select display_name, id, budget_id, threshold, lifecycle_state as statefrom oci_budget_alert_rulewhere threshold > 100 and threshold_type = 'PERCENTAGE';
select display_name, id, budget_id, threshold, lifecycle_state as statefrom oci_budget_alert_rulewhere threshold > 100 and threshold_type = 'PERCENTAGE';
Schema for oci_budget_alert_rule
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
budget_id | text | = | The OCID of the budget |
compartment_id | text | The OCID of the compartment in Tenant in which the resource is located. | |
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. | |
description | text | The description of the alert rule. | |
display_name | text | = | The name of the alert rule. |
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 alert rule. |
lifecycle_state | text | = | The current state of the alert rule. |
message | text | Custom message sent when alert is triggered. | |
recipients | text | Delimited list of email addresses to receive the alert when it triggers. | |
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. | |
threshold | double precision | The threshold for triggering the alert. If thresholdType is PERCENTAGE, the maximum value is 10000. | |
threshold_type | text | The type of threshold. | |
time_created | timestamp with time zone | Time that budget was created. | |
time_updated | timestamp with time zone | Time that budget was updated. | |
title | text | Title of the resource. | |
type | text | The type of alert. | |
version | bigint | Version of the alert rule. Starts from 1 and increments by 1. |
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_budget_alert_rule