getGroupMetricRules

This data source provides the Cms Group Metric Rules of the current Alibaba Cloud user.

NOTE: Available in v1.104.0+.

Example Usage

Basic Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.Cms.GetGroupMetricRules.InvokeAsync(new AliCloud.Cms.GetGroupMetricRulesArgs
        {
            Ids = 
            {
                "4a9a8978-a9cc-55ca-aa7c-530ccd91ae57",
            },
            NameRegex = "the_resource_name",
        }));
        this.FirstCmsGroupMetricRuleId = example.Apply(example => example.Rules?[0]?.Id);
    }

    [Output("firstCmsGroupMetricRuleId")]
    public Output<string> FirstCmsGroupMetricRuleId { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := cms.GetGroupMetricRules(ctx, &cms.GetGroupMetricRulesArgs{
			Ids: []string{
				"4a9a8978-a9cc-55ca-aa7c-530ccd91ae57",
			},
			NameRegex: pulumi.StringRef("the_resource_name"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstCmsGroupMetricRuleId", example.Rules[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cms.CmsFunctions;
import com.pulumi.alicloud.cms.inputs.GetGroupMetricRulesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = CmsFunctions.getGroupMetricRules(GetGroupMetricRulesArgs.builder()
            .ids("4a9a8978-a9cc-55ca-aa7c-530ccd91ae57")
            .nameRegex("the_resource_name")
            .build());

        ctx.export("firstCmsGroupMetricRuleId", example.applyValue(getGroupMetricRulesResult -> getGroupMetricRulesResult.rules()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.cms.get_group_metric_rules(ids=["4a9a8978-a9cc-55ca-aa7c-530ccd91ae57"],
    name_regex="the_resource_name")
pulumi.export("firstCmsGroupMetricRuleId", example.rules[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = alicloud.cms.getGroupMetricRules({
    ids: ["4a9a8978-a9cc-55ca-aa7c-530ccd91ae57"],
    nameRegex: "the_resource_name",
});
export const firstCmsGroupMetricRuleId = example.then(example => example.rules?[0]?.id);
variables:
  example:
    Fn::Invoke:
      Function: alicloud:cms:getGroupMetricRules
      Arguments:
        ids:
          - 4a9a8978-a9cc-55ca-aa7c-530ccd91ae57
        nameRegex: the_resource_name
outputs:
  firstCmsGroupMetricRuleId: ${example.rules[0].id}

Using getGroupMetricRules

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 getGroupMetricRules(args: GetGroupMetricRulesArgs, opts?: InvokeOptions): Promise<GetGroupMetricRulesResult>
function getGroupMetricRulesOutput(args: GetGroupMetricRulesOutputArgs, opts?: InvokeOptions): Output<GetGroupMetricRulesResult>
def get_group_metric_rules(dimensions: Optional[str] = None,
                           enable_state: Optional[bool] = None,
                           group_id: Optional[str] = None,
                           group_metric_rule_name: Optional[str] = None,
                           ids: Optional[Sequence[str]] = None,
                           metric_name: Optional[str] = None,
                           name_regex: Optional[str] = None,
                           namespace: Optional[str] = None,
                           output_file: Optional[str] = None,
                           status: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetGroupMetricRulesResult
def get_group_metric_rules_output(dimensions: Optional[pulumi.Input[str]] = None,
                           enable_state: Optional[pulumi.Input[bool]] = None,
                           group_id: Optional[pulumi.Input[str]] = None,
                           group_metric_rule_name: Optional[pulumi.Input[str]] = None,
                           ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                           metric_name: Optional[pulumi.Input[str]] = None,
                           name_regex: Optional[pulumi.Input[str]] = None,
                           namespace: Optional[pulumi.Input[str]] = None,
                           output_file: Optional[pulumi.Input[str]] = None,
                           status: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetGroupMetricRulesResult]
func GetGroupMetricRules(ctx *Context, args *GetGroupMetricRulesArgs, opts ...InvokeOption) (*GetGroupMetricRulesResult, error)
func GetGroupMetricRulesOutput(ctx *Context, args *GetGroupMetricRulesOutputArgs, opts ...InvokeOption) GetGroupMetricRulesResultOutput

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

public static class GetGroupMetricRules 
{
    public static Task<GetGroupMetricRulesResult> InvokeAsync(GetGroupMetricRulesArgs args, InvokeOptions? opts = null)
    public static Output<GetGroupMetricRulesResult> Invoke(GetGroupMetricRulesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetGroupMetricRulesResult> getGroupMetricRules(GetGroupMetricRulesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:cms/getGroupMetricRules:getGroupMetricRules
  arguments:
    # arguments dictionary

The following arguments are supported:

Dimensions string

The dimensions that specify the resources to be associated with the alert rule.

EnableState bool

Indicates whether the alert rule is enabled.

GroupId string

The ID of the application group.

GroupMetricRuleName string

The name of the alert rule.

Ids List<string>

A list of Group Metric Rule IDs.

MetricName string

The name of the metric.

NameRegex string

A regex string to filter results by Group Metric Rule name.

Namespace string

The namespace of the service.

OutputFile string
Status string

The status of Group Metric Rule..

Dimensions string

The dimensions that specify the resources to be associated with the alert rule.

EnableState bool

Indicates whether the alert rule is enabled.

GroupId string

The ID of the application group.

GroupMetricRuleName string

The name of the alert rule.

Ids []string

A list of Group Metric Rule IDs.

MetricName string

The name of the metric.

NameRegex string

A regex string to filter results by Group Metric Rule name.

Namespace string

The namespace of the service.

OutputFile string
Status string

The status of Group Metric Rule..

dimensions String

The dimensions that specify the resources to be associated with the alert rule.

enableState Boolean

Indicates whether the alert rule is enabled.

groupId String

The ID of the application group.

groupMetricRuleName String

The name of the alert rule.

ids List<String>

A list of Group Metric Rule IDs.

metricName String

The name of the metric.

nameRegex String

A regex string to filter results by Group Metric Rule name.

namespace String

The namespace of the service.

outputFile String
status String

The status of Group Metric Rule..

dimensions string

The dimensions that specify the resources to be associated with the alert rule.

enableState boolean

Indicates whether the alert rule is enabled.

groupId string

The ID of the application group.

groupMetricRuleName string

The name of the alert rule.

ids string[]

A list of Group Metric Rule IDs.

metricName string

The name of the metric.

nameRegex string

A regex string to filter results by Group Metric Rule name.

namespace string

The namespace of the service.

outputFile string
status string

The status of Group Metric Rule..

dimensions str

The dimensions that specify the resources to be associated with the alert rule.

enable_state bool

Indicates whether the alert rule is enabled.

group_id str

The ID of the application group.

group_metric_rule_name str

The name of the alert rule.

ids Sequence[str]

A list of Group Metric Rule IDs.

metric_name str

The name of the metric.

name_regex str

A regex string to filter results by Group Metric Rule name.

namespace str

The namespace of the service.

output_file str
status str

The status of Group Metric Rule..

dimensions String

The dimensions that specify the resources to be associated with the alert rule.

enableState Boolean

Indicates whether the alert rule is enabled.

groupId String

The ID of the application group.

groupMetricRuleName String

The name of the alert rule.

ids List<String>

A list of Group Metric Rule IDs.

metricName String

The name of the metric.

nameRegex String

A regex string to filter results by Group Metric Rule name.

namespace String

The namespace of the service.

outputFile String
status String

The status of Group Metric Rule..

getGroupMetricRules Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Names List<string>
Rules List<Pulumi.AliCloud.Cms.Outputs.GetGroupMetricRulesRule>
Dimensions string
EnableState bool
GroupId string
GroupMetricRuleName string
MetricName string
NameRegex string
Namespace string
OutputFile string
Status string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Names []string
Rules []GetGroupMetricRulesRule
Dimensions string
EnableState bool
GroupId string
GroupMetricRuleName string
MetricName string
NameRegex string
Namespace string
OutputFile string
Status string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
names List<String>
rules List<GetGroupMetricRulesRule>
dimensions String
enableState Boolean
groupId String
groupMetricRuleName String
metricName String
nameRegex String
namespace String
outputFile String
status String
id string

The provider-assigned unique ID for this managed resource.

ids string[]
names string[]
rules GetGroupMetricRulesRule[]
dimensions string
enableState boolean
groupId string
groupMetricRuleName string
metricName string
nameRegex string
namespace string
outputFile string
status string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
names Sequence[str]
rules Sequence[GetGroupMetricRulesRule]
dimensions str
enable_state bool
group_id str
group_metric_rule_name str
metric_name str
name_regex str
namespace str
output_file str
status str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
names List<String>
rules List<Property Map>
dimensions String
enableState Boolean
groupId String
groupMetricRuleName String
metricName String
nameRegex String
namespace String
outputFile String
status String

Supporting Types

GetGroupMetricRulesRule

ContactGroups string

Alarm contact group.

Dimensions string

The dimensions that specify the resources to be associated with the alert rule.

EffectiveInterval string

The time period during which the alert rule is effective.

EmailSubject string

The subject of the alert notification email.

EnableState bool

Indicates whether the alert rule is enabled.

Escalations List<Pulumi.AliCloud.Cms.Inputs.GetGroupMetricRulesRuleEscalation>

Alarm level.

GroupId string

The ID of the application group.

GroupMetricRuleName string

The name of the alert rule.

Id string

The ID of the Group Metric Rule.

MetricName string

The name of the metric.

Namespace string

The namespace of the service.

NoEffectiveInterval string

The time period during which the alert rule is ineffective.

Period int

The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.

Resources string

The resources that are associated with the alert rule.

RuleId string

The ID of the alert rule.

SilenceTime int

The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.

SourceType string

The type of the alert rule. The value is fixed to METRIC, indicating an alert rule for time series metrics.

Status string

The status of Group Metric Rule..

Webhook string

The callback URL.

ContactGroups string

Alarm contact group.

Dimensions string

The dimensions that specify the resources to be associated with the alert rule.

EffectiveInterval string

The time period during which the alert rule is effective.

EmailSubject string

The subject of the alert notification email.

EnableState bool

Indicates whether the alert rule is enabled.

Escalations []GetGroupMetricRulesRuleEscalation

Alarm level.

GroupId string

The ID of the application group.

GroupMetricRuleName string

The name of the alert rule.

Id string

The ID of the Group Metric Rule.

MetricName string

The name of the metric.

Namespace string

The namespace of the service.

NoEffectiveInterval string

The time period during which the alert rule is ineffective.

Period int

The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.

Resources string

The resources that are associated with the alert rule.

RuleId string

The ID of the alert rule.

SilenceTime int

The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.

SourceType string

The type of the alert rule. The value is fixed to METRIC, indicating an alert rule for time series metrics.

Status string

The status of Group Metric Rule..

Webhook string

The callback URL.

contactGroups String

Alarm contact group.

dimensions String

The dimensions that specify the resources to be associated with the alert rule.

effectiveInterval String

The time period during which the alert rule is effective.

emailSubject String

The subject of the alert notification email.

enableState Boolean

Indicates whether the alert rule is enabled.

escalations List<GetGroupMetricRulesRuleEscalation>

Alarm level.

groupId String

The ID of the application group.

groupMetricRuleName String

The name of the alert rule.

id String

The ID of the Group Metric Rule.

metricName String

The name of the metric.

namespace String

The namespace of the service.

noEffectiveInterval String

The time period during which the alert rule is ineffective.

period Integer

The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.

resources String

The resources that are associated with the alert rule.

ruleId String

The ID of the alert rule.

silenceTime Integer

The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.

sourceType String

The type of the alert rule. The value is fixed to METRIC, indicating an alert rule for time series metrics.

status String

The status of Group Metric Rule..

webhook String

The callback URL.

contactGroups string

Alarm contact group.

dimensions string

The dimensions that specify the resources to be associated with the alert rule.

effectiveInterval string

The time period during which the alert rule is effective.

emailSubject string

The subject of the alert notification email.

enableState boolean

Indicates whether the alert rule is enabled.

escalations GetGroupMetricRulesRuleEscalation[]

Alarm level.

groupId string

The ID of the application group.

groupMetricRuleName string

The name of the alert rule.

id string

The ID of the Group Metric Rule.

metricName string

The name of the metric.

namespace string

The namespace of the service.

noEffectiveInterval string

The time period during which the alert rule is ineffective.

period number

The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.

resources string

The resources that are associated with the alert rule.

ruleId string

The ID of the alert rule.

silenceTime number

The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.

sourceType string

The type of the alert rule. The value is fixed to METRIC, indicating an alert rule for time series metrics.

status string

The status of Group Metric Rule..

webhook string

The callback URL.

contact_groups str

Alarm contact group.

dimensions str

The dimensions that specify the resources to be associated with the alert rule.

effective_interval str

The time period during which the alert rule is effective.

email_subject str

The subject of the alert notification email.

enable_state bool

Indicates whether the alert rule is enabled.

escalations Sequence[GetGroupMetricRulesRuleEscalation]

Alarm level.

group_id str

The ID of the application group.

group_metric_rule_name str

The name of the alert rule.

id str

The ID of the Group Metric Rule.

metric_name str

The name of the metric.

namespace str

The namespace of the service.

no_effective_interval str

The time period during which the alert rule is ineffective.

period int

The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.

resources str

The resources that are associated with the alert rule.

rule_id str

The ID of the alert rule.

silence_time int

The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.

source_type str

The type of the alert rule. The value is fixed to METRIC, indicating an alert rule for time series metrics.

status str

The status of Group Metric Rule..

webhook str

The callback URL.

contactGroups String

Alarm contact group.

dimensions String

The dimensions that specify the resources to be associated with the alert rule.

effectiveInterval String

The time period during which the alert rule is effective.

emailSubject String

The subject of the alert notification email.

enableState Boolean

Indicates whether the alert rule is enabled.

escalations List<Property Map>

Alarm level.

groupId String

The ID of the application group.

groupMetricRuleName String

The name of the alert rule.

id String

The ID of the Group Metric Rule.

metricName String

The name of the metric.

namespace String

The namespace of the service.

noEffectiveInterval String

The time period during which the alert rule is ineffective.

period Number

The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.

resources String

The resources that are associated with the alert rule.

ruleId String

The ID of the alert rule.

silenceTime Number

The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.

sourceType String

The type of the alert rule. The value is fixed to METRIC, indicating an alert rule for time series metrics.

status String

The status of Group Metric Rule..

webhook String

The callback URL.

GetGroupMetricRulesRuleEscalation

criticals List<Property Map>

The critical level.

infos List<Property Map>

The info level.

warns List<Property Map>

The warn level.

GetGroupMetricRulesRuleEscalationCritical

ComparisonOperator string

The comparison operator of the threshold for warn-level alerts.

Statistics string

The statistical aggregation method for warn-level alerts.

Threshold string

The threshold for warn-level alerts.

Times int

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

ComparisonOperator string

The comparison operator of the threshold for warn-level alerts.

Statistics string

The statistical aggregation method for warn-level alerts.

Threshold string

The threshold for warn-level alerts.

Times int

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

comparisonOperator String

The comparison operator of the threshold for warn-level alerts.

statistics String

The statistical aggregation method for warn-level alerts.

threshold String

The threshold for warn-level alerts.

times Integer

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

comparisonOperator string

The comparison operator of the threshold for warn-level alerts.

statistics string

The statistical aggregation method for warn-level alerts.

threshold string

The threshold for warn-level alerts.

times number

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

comparison_operator str

The comparison operator of the threshold for warn-level alerts.

statistics str

The statistical aggregation method for warn-level alerts.

threshold str

The threshold for warn-level alerts.

times int

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

comparisonOperator String

The comparison operator of the threshold for warn-level alerts.

statistics String

The statistical aggregation method for warn-level alerts.

threshold String

The threshold for warn-level alerts.

times Number

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

GetGroupMetricRulesRuleEscalationInfo

ComparisonOperator string

The comparison operator of the threshold for warn-level alerts.

Statistics string

The statistical aggregation method for warn-level alerts.

Threshold string

The threshold for warn-level alerts.

Times int

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

ComparisonOperator string

The comparison operator of the threshold for warn-level alerts.

Statistics string

The statistical aggregation method for warn-level alerts.

Threshold string

The threshold for warn-level alerts.

Times int

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

comparisonOperator String

The comparison operator of the threshold for warn-level alerts.

statistics String

The statistical aggregation method for warn-level alerts.

threshold String

The threshold for warn-level alerts.

times Integer

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

comparisonOperator string

The comparison operator of the threshold for warn-level alerts.

statistics string

The statistical aggregation method for warn-level alerts.

threshold string

The threshold for warn-level alerts.

times number

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

comparison_operator str

The comparison operator of the threshold for warn-level alerts.

statistics str

The statistical aggregation method for warn-level alerts.

threshold str

The threshold for warn-level alerts.

times int

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

comparisonOperator String

The comparison operator of the threshold for warn-level alerts.

statistics String

The statistical aggregation method for warn-level alerts.

threshold String

The threshold for warn-level alerts.

times Number

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

GetGroupMetricRulesRuleEscalationWarn

ComparisonOperator string

The comparison operator of the threshold for warn-level alerts.

Statistics string

The statistical aggregation method for warn-level alerts.

Threshold string

The threshold for warn-level alerts.

Times int

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

ComparisonOperator string

The comparison operator of the threshold for warn-level alerts.

Statistics string

The statistical aggregation method for warn-level alerts.

Threshold string

The threshold for warn-level alerts.

Times int

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

comparisonOperator String

The comparison operator of the threshold for warn-level alerts.

statistics String

The statistical aggregation method for warn-level alerts.

threshold String

The threshold for warn-level alerts.

times Integer

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

comparisonOperator string

The comparison operator of the threshold for warn-level alerts.

statistics string

The statistical aggregation method for warn-level alerts.

threshold string

The threshold for warn-level alerts.

times number

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

comparison_operator str

The comparison operator of the threshold for warn-level alerts.

statistics str

The statistical aggregation method for warn-level alerts.

threshold str

The threshold for warn-level alerts.

times int

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

comparisonOperator String

The comparison operator of the threshold for warn-level alerts.

statistics String

The statistical aggregation method for warn-level alerts.

threshold String

The threshold for warn-level alerts.

times Number

The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

Package Details

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

This Pulumi package is based on the alicloud Terraform Provider.