UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

346 lines (345 loc) 12.6 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * Manages an AOM alarm rule resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const alarmRule = new huaweicloud.aom.AlarmRule("alarmRule", { * alarmLevel: 3, * description: "test rule", * namespace: "PAAS.NODE", * metricName: "cupUsage", * dimensions: [{ * name: "hostID", * value: _var.instance_id, * }], * comparisonOperator: ">=", * period: 60000, * statistic: "average", * threshold: "3", * unit: "Percent", * evaluationPeriods: 2, * }); * ``` * * ## Import * * AOM alarm rules can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Aom/alarmRule:AlarmRule alarm_rule <id> * ``` */ export declare class AlarmRule extends pulumi.CustomResource { /** * Get an existing AlarmRule resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AlarmRuleState, opts?: pulumi.CustomResourceOptions): AlarmRule; /** * Returns true if the given object is an instance of AlarmRule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is AlarmRule; /** * Specifies whether to enable the action to be triggered by an alarm. * The default value is true. Changing this creates a new resource. */ readonly alarmActionEnabled: pulumi.Output<boolean | undefined>; /** * Specifies the action triggered by an alarm. This is a list of strings. * Changing this creates a new resource. */ readonly alarmActions: pulumi.Output<string[] | undefined>; /** * Indicates whether the alarm rule is enabled. */ readonly alarmEnabled: pulumi.Output<boolean>; /** * Specifies the alarm severity. The value can be `1`, `2`, `3` or `4`, * which indicates *critical*, *major*, *minor*, and *informational*, respectively. * The default value is `2`. */ readonly alarmLevel: pulumi.Output<number | undefined>; /** * Specifies the comparison condition of alarm thresholds. * The value can be **>**, **=**, **<**, **>=** or **<=**. */ readonly comparisonOperator: pulumi.Output<string>; /** * Specifies the description of the alarm rule. * The value can be a string of `0` to `1,000` characters. */ readonly description: pulumi.Output<string | undefined>; /** * Specifies the list of metric dimensions. The structure is described below. * Changing this creates a new resource. */ readonly dimensions: pulumi.Output<outputs.Aom.AlarmRuleDimension[]>; /** * Specifies the alarm checking evaluation periods. * The value can be `1`, `2`, `3`, `4` and `5`. */ readonly evaluationPeriods: pulumi.Output<number>; /** * Specifies the action triggered when the data is not enough. * This is a list of strings. Changing this creates a new resource. */ readonly insufficientDataActions: pulumi.Output<string[] | undefined>; /** * Specifies the alarm metric name. Changing this creates a new resource. */ readonly metricName: pulumi.Output<string>; /** * Specifies the dimension name. Changing this creates a new resource. */ readonly name: pulumi.Output<string>; /** * Specifies the alarm namespace. Changing this creates a new resource. */ readonly namespace: pulumi.Output<string>; /** * Specifies the action triggered by the clearing of an alarm. * This is a list of strings. Changing this creates a new resource. */ readonly okActions: pulumi.Output<string[] | undefined>; /** * Specifies the alarm checking period in milliseconds. * The value can be **60,000**, **300,000**, **900,000** and **3,600,000**. */ readonly period: pulumi.Output<number>; /** * The region in which to create the alarm rule resource. If omitted, the * provider-level region will be used. Changing this creates a new resource. */ readonly region: pulumi.Output<string>; /** * Indicates the reason of alarm status. */ readonly stateReason: pulumi.Output<string>; /** * Indicates the alarm status. */ readonly stateValue: pulumi.Output<string>; /** * Specifies the data rollup methods. The value can be **maximum**, * **minimum**, **average**, **sum** and **sampleCount**. Changing this creates a new resource. */ readonly statistic: pulumi.Output<string>; /** * Specifies the alarm threshold. */ readonly threshold: pulumi.Output<string>; /** * Specifies the data unit. * The valid value is range from `1` to `32`. * Changing this creates a new resource. */ readonly unit: pulumi.Output<string>; /** * Create a AlarmRule resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: AlarmRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AlarmRule resources. */ export interface AlarmRuleState { /** * Specifies whether to enable the action to be triggered by an alarm. * The default value is true. Changing this creates a new resource. */ alarmActionEnabled?: pulumi.Input<boolean>; /** * Specifies the action triggered by an alarm. This is a list of strings. * Changing this creates a new resource. */ alarmActions?: pulumi.Input<pulumi.Input<string>[]>; /** * Indicates whether the alarm rule is enabled. */ alarmEnabled?: pulumi.Input<boolean>; /** * Specifies the alarm severity. The value can be `1`, `2`, `3` or `4`, * which indicates *critical*, *major*, *minor*, and *informational*, respectively. * The default value is `2`. */ alarmLevel?: pulumi.Input<number>; /** * Specifies the comparison condition of alarm thresholds. * The value can be **>**, **=**, **<**, **>=** or **<=**. */ comparisonOperator?: pulumi.Input<string>; /** * Specifies the description of the alarm rule. * The value can be a string of `0` to `1,000` characters. */ description?: pulumi.Input<string>; /** * Specifies the list of metric dimensions. The structure is described below. * Changing this creates a new resource. */ dimensions?: pulumi.Input<pulumi.Input<inputs.Aom.AlarmRuleDimension>[]>; /** * Specifies the alarm checking evaluation periods. * The value can be `1`, `2`, `3`, `4` and `5`. */ evaluationPeriods?: pulumi.Input<number>; /** * Specifies the action triggered when the data is not enough. * This is a list of strings. Changing this creates a new resource. */ insufficientDataActions?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the alarm metric name. Changing this creates a new resource. */ metricName?: pulumi.Input<string>; /** * Specifies the dimension name. Changing this creates a new resource. */ name?: pulumi.Input<string>; /** * Specifies the alarm namespace. Changing this creates a new resource. */ namespace?: pulumi.Input<string>; /** * Specifies the action triggered by the clearing of an alarm. * This is a list of strings. Changing this creates a new resource. */ okActions?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the alarm checking period in milliseconds. * The value can be **60,000**, **300,000**, **900,000** and **3,600,000**. */ period?: pulumi.Input<number>; /** * The region in which to create the alarm rule resource. If omitted, the * provider-level region will be used. Changing this creates a new resource. */ region?: pulumi.Input<string>; /** * Indicates the reason of alarm status. */ stateReason?: pulumi.Input<string>; /** * Indicates the alarm status. */ stateValue?: pulumi.Input<string>; /** * Specifies the data rollup methods. The value can be **maximum**, * **minimum**, **average**, **sum** and **sampleCount**. Changing this creates a new resource. */ statistic?: pulumi.Input<string>; /** * Specifies the alarm threshold. */ threshold?: pulumi.Input<string>; /** * Specifies the data unit. * The valid value is range from `1` to `32`. * Changing this creates a new resource. */ unit?: pulumi.Input<string>; } /** * The set of arguments for constructing a AlarmRule resource. */ export interface AlarmRuleArgs { /** * Specifies whether to enable the action to be triggered by an alarm. * The default value is true. Changing this creates a new resource. */ alarmActionEnabled?: pulumi.Input<boolean>; /** * Specifies the action triggered by an alarm. This is a list of strings. * Changing this creates a new resource. */ alarmActions?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the alarm severity. The value can be `1`, `2`, `3` or `4`, * which indicates *critical*, *major*, *minor*, and *informational*, respectively. * The default value is `2`. */ alarmLevel?: pulumi.Input<number>; /** * Specifies the comparison condition of alarm thresholds. * The value can be **>**, **=**, **<**, **>=** or **<=**. */ comparisonOperator: pulumi.Input<string>; /** * Specifies the description of the alarm rule. * The value can be a string of `0` to `1,000` characters. */ description?: pulumi.Input<string>; /** * Specifies the list of metric dimensions. The structure is described below. * Changing this creates a new resource. */ dimensions: pulumi.Input<pulumi.Input<inputs.Aom.AlarmRuleDimension>[]>; /** * Specifies the alarm checking evaluation periods. * The value can be `1`, `2`, `3`, `4` and `5`. */ evaluationPeriods: pulumi.Input<number>; /** * Specifies the action triggered when the data is not enough. * This is a list of strings. Changing this creates a new resource. */ insufficientDataActions?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the alarm metric name. Changing this creates a new resource. */ metricName: pulumi.Input<string>; /** * Specifies the dimension name. Changing this creates a new resource. */ name?: pulumi.Input<string>; /** * Specifies the alarm namespace. Changing this creates a new resource. */ namespace: pulumi.Input<string>; /** * Specifies the action triggered by the clearing of an alarm. * This is a list of strings. Changing this creates a new resource. */ okActions?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the alarm checking period in milliseconds. * The value can be **60,000**, **300,000**, **900,000** and **3,600,000**. */ period: pulumi.Input<number>; /** * The region in which to create the alarm rule resource. If omitted, the * provider-level region will be used. Changing this creates a new resource. */ region?: pulumi.Input<string>; /** * Specifies the data rollup methods. The value can be **maximum**, * **minimum**, **average**, **sum** and **sampleCount**. Changing this creates a new resource. */ statistic: pulumi.Input<string>; /** * Specifies the alarm threshold. */ threshold: pulumi.Input<string>; /** * Specifies the data unit. * The valid value is range from `1` to `32`. * Changing this creates a new resource. */ unit: pulumi.Input<string>; }