Oracle Cloud Infrastructure

Pulumi Official
Package maintained by Pulumi
v0.1.1 published on Tuesday, May 3, 2022 by Pulumi

getAlertRules

This data source provides the list of Alert Rules in Oracle Cloud Infrastructure Budget service.

Returns a list of Alert Rules for a specified Budget.

Example Usage

using Pulumi;
using Oci = Pulumi.Oci;

class MyStack : Stack
{
    public MyStack()
    {
        var testAlertRules = Output.Create(Oci.Budget.GetAlertRules.InvokeAsync(new Oci.Budget.GetAlertRulesArgs
        {
            BudgetId = oci_budget_budget.Test_budget.Id,
            DisplayName = @var.Alert_rule_display_name,
            State = @var.Alert_rule_state,
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/go/oci/Budget"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Budget.GetAlertRules(ctx, &budget.GetAlertRulesArgs{
			BudgetId:    oci_budget_budget.Test_budget.Id,
			DisplayName: pulumi.StringRef(_var.Alert_rule_display_name),
			State:       pulumi.StringRef(_var.Alert_rule_state),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_oci as oci

test_alert_rules = oci.Budget.get_alert_rules(budget_id=oci_budget_budget["test_budget"]["id"],
    display_name=var["alert_rule_display_name"],
    state=var["alert_rule_state"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testAlertRules = oci.Budget.getAlertRules({
    budgetId: oci_budget_budget.test_budget.id,
    displayName: _var.alert_rule_display_name,
    state: _var.alert_rule_state,
});

Coming soon!

Using getAlertRules

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAlertRules(args: GetAlertRulesArgs, opts?: InvokeOptions): Promise<GetAlertRulesResult>
function getAlertRulesOutput(args: GetAlertRulesOutputArgs, opts?: InvokeOptions): Output<GetAlertRulesResult>
def get_alert_rules(budget_id: Optional[str] = None,
                    display_name: Optional[str] = None,
                    filters: Optional[Sequence[_budget.GetAlertRulesFilter]] = None,
                    state: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetAlertRulesResult
def get_alert_rules_output(budget_id: Optional[pulumi.Input[str]] = None,
                    display_name: Optional[pulumi.Input[str]] = None,
                    filters: Optional[pulumi.Input[Sequence[pulumi.Input[_budget.GetAlertRulesFilterArgs]]]] = None,
                    state: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetAlertRulesResult]
func GetAlertRules(ctx *Context, args *GetAlertRulesArgs, opts ...InvokeOption) (*GetAlertRulesResult, error)
func GetAlertRulesOutput(ctx *Context, args *GetAlertRulesOutputArgs, opts ...InvokeOption) GetAlertRulesResultOutput

> Note: This function is named GetAlertRules in the Go SDK.

public static class GetAlertRules 
{
    public static Task<GetAlertRulesResult> InvokeAsync(GetAlertRulesArgs args, InvokeOptions? opts = null)
    public static Output<GetAlertRulesResult> Invoke(GetAlertRulesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAlertRulesResult> getAlertRules(GetAlertRulesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: oci:Budget/getAlertRules:getAlertRules
  Arguments:
    # Arguments dictionary

The following arguments are supported:

BudgetId string

The unique Budget OCID

DisplayName string

A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource

Filters List<GetAlertRulesFilter>
State string

The current state of the resource to filter by.

BudgetId string

The unique Budget OCID

DisplayName string

A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource

Filters []GetAlertRulesFilter
State string

The current state of the resource to filter by.

budgetId String

The unique Budget OCID

displayName String

A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource

filters List<GetAlertRulesFilter>
state String

The current state of the resource to filter by.

budgetId string

The unique Budget OCID

displayName string

A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource

filters GetAlertRulesFilter[]
state string

The current state of the resource to filter by.

budget_id str

The unique Budget OCID

display_name str

A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource

filters GetAlertRulesFilter]
state str

The current state of the resource to filter by.

budgetId String

The unique Budget OCID

displayName String

A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource

filters List<Property Map>
state String

The current state of the resource to filter by.

getAlertRules Result

The following output properties are available:

AlertRules List<GetAlertRulesAlertRule>

The list of alert_rules.

BudgetId string

The OCID of the budget

Id string

The provider-assigned unique ID for this managed resource.

DisplayName string

The name of the alert rule.

Filters List<GetAlertRulesFilter>
State string

The current state of the alert rule.

AlertRules []GetAlertRulesAlertRule

The list of alert_rules.

BudgetId string

The OCID of the budget

Id string

The provider-assigned unique ID for this managed resource.

DisplayName string

The name of the alert rule.

Filters []GetAlertRulesFilter
State string

The current state of the alert rule.

alertRules List<GetAlertRulesAlertRule>

The list of alert_rules.

budgetId String

The OCID of the budget

id String

The provider-assigned unique ID for this managed resource.

displayName String

The name of the alert rule.

filters List<GetAlertRulesFilter>
state String

The current state of the alert rule.

alertRules GetAlertRulesAlertRule[]

The list of alert_rules.

budgetId string

The OCID of the budget

id string

The provider-assigned unique ID for this managed resource.

displayName string

The name of the alert rule.

filters GetAlertRulesFilter[]
state string

The current state of the alert rule.

alert_rules GetAlertRulesAlertRule]

The list of alert_rules.

budget_id str

The OCID of the budget

id str

The provider-assigned unique ID for this managed resource.

display_name str

The name of the alert rule.

filters GetAlertRulesFilter]
state str

The current state of the alert rule.

alertRules List<Property Map>

The list of alert_rules.

budgetId String

The OCID of the budget

id String

The provider-assigned unique ID for this managed resource.

displayName String

The name of the alert rule.

filters List<Property Map>
state String

The current state of the alert rule.

Supporting Types

GetAlertRulesAlertRule

BudgetId string

The unique Budget OCID

DefinedTags Dictionary<string, object>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

Description string

The description of the alert rule.

DisplayName string

A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource

FreeformTags Dictionary<string, object>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

Id string

The OCID of the alert rule

Message string

Custom message that will be sent when alert is triggered

Recipients string

Delimited list of email addresses to receive the alert when it triggers. Delimiter character can be comma, space, TAB, or semicolon.

State string

The current state of the resource to filter by.

Threshold double

The threshold for triggering the alert. If thresholdType is PERCENTAGE, the maximum value is 10000.

ThresholdType string

The type of threshold.

TimeCreated string

Time when budget was created

TimeUpdated string

Time when budget was updated

Type string

The type of alert. Valid values are ACTUAL (the alert will trigger based on actual usage) or FORECAST (the alert will trigger based on predicted usage).

Version int

Version of the alert rule. Starts from 1 and increments by 1.

BudgetId string

The unique Budget OCID

DefinedTags map[string]interface{}

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

Description string

The description of the alert rule.

DisplayName string

A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource

FreeformTags map[string]interface{}

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

Id string

The OCID of the alert rule

Message string

Custom message that will be sent when alert is triggered

Recipients string

Delimited list of email addresses to receive the alert when it triggers. Delimiter character can be comma, space, TAB, or semicolon.

State string

The current state of the resource to filter by.

Threshold float64

The threshold for triggering the alert. If thresholdType is PERCENTAGE, the maximum value is 10000.

ThresholdType string

The type of threshold.

TimeCreated string

Time when budget was created

TimeUpdated string

Time when budget was updated

Type string

The type of alert. Valid values are ACTUAL (the alert will trigger based on actual usage) or FORECAST (the alert will trigger based on predicted usage).

Version int

Version of the alert rule. Starts from 1 and increments by 1.

budgetId String

The unique Budget OCID

definedTags Map<String,Object>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

description String

The description of the alert rule.

displayName String

A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource

freeformTags Map<String,Object>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

id String

The OCID of the alert rule

message String

Custom message that will be sent when alert is triggered

recipients String

Delimited list of email addresses to receive the alert when it triggers. Delimiter character can be comma, space, TAB, or semicolon.

state String

The current state of the resource to filter by.

threshold Double

The threshold for triggering the alert. If thresholdType is PERCENTAGE, the maximum value is 10000.

thresholdType String

The type of threshold.

timeCreated String

Time when budget was created

timeUpdated String

Time when budget was updated

type String

The type of alert. Valid values are ACTUAL (the alert will trigger based on actual usage) or FORECAST (the alert will trigger based on predicted usage).

version Integer

Version of the alert rule. Starts from 1 and increments by 1.

budgetId string

The unique Budget OCID

definedTags {[key: string]: any}

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

description string

The description of the alert rule.

displayName string

A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource

freeformTags {[key: string]: any}

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

id string

The OCID of the alert rule

message string

Custom message that will be sent when alert is triggered

recipients string

Delimited list of email addresses to receive the alert when it triggers. Delimiter character can be comma, space, TAB, or semicolon.

state string

The current state of the resource to filter by.

threshold number

The threshold for triggering the alert. If thresholdType is PERCENTAGE, the maximum value is 10000.

thresholdType string

The type of threshold.

timeCreated string

Time when budget was created

timeUpdated string

Time when budget was updated

type string

The type of alert. Valid values are ACTUAL (the alert will trigger based on actual usage) or FORECAST (the alert will trigger based on predicted usage).

version number

Version of the alert rule. Starts from 1 and increments by 1.

budget_id str

The unique Budget OCID

defined_tags Mapping[str, Any]

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

description str

The description of the alert rule.

display_name str

A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource

freeform_tags Mapping[str, Any]

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

id str

The OCID of the alert rule

message str

Custom message that will be sent when alert is triggered

recipients str

Delimited list of email addresses to receive the alert when it triggers. Delimiter character can be comma, space, TAB, or semicolon.

state str

The current state of the resource to filter by.

threshold float

The threshold for triggering the alert. If thresholdType is PERCENTAGE, the maximum value is 10000.

threshold_type str

The type of threshold.

time_created str

Time when budget was created

time_updated str

Time when budget was updated

type str

The type of alert. Valid values are ACTUAL (the alert will trigger based on actual usage) or FORECAST (the alert will trigger based on predicted usage).

version int

Version of the alert rule. Starts from 1 and increments by 1.

budgetId String

The unique Budget OCID

definedTags Map<Any>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

description String

The description of the alert rule.

displayName String

A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource

freeformTags Map<Any>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

id String

The OCID of the alert rule

message String

Custom message that will be sent when alert is triggered

recipients String

Delimited list of email addresses to receive the alert when it triggers. Delimiter character can be comma, space, TAB, or semicolon.

state String

The current state of the resource to filter by.

threshold Number

The threshold for triggering the alert. If thresholdType is PERCENTAGE, the maximum value is 10000.

thresholdType String

The type of threshold.

timeCreated String

Time when budget was created

timeUpdated String

Time when budget was updated

type String

The type of alert. Valid values are ACTUAL (the alert will trigger based on actual usage) or FORECAST (the alert will trigger based on predicted usage).

version Number

Version of the alert rule. Starts from 1 and increments by 1.

GetAlertRulesFilter

Name string
Values List<string>
Regex bool
Name string
Values []string
Regex bool
name String
values List<String>
regex Boolean
name string
values string[]
regex boolean
name str
values Sequence[str]
regex bool
name String
values List<String>
regex Boolean

Package Details

Repository
https://github.com/pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.