1. Packages
  2. Azure Classic
  3. API Docs
  4. monitoring
  5. getScheduledQueryRulesAlert

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

azure.monitoring.getScheduledQueryRulesAlert

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

    Use this data source to access the properties of an AlertingAction scheduled query rule.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.monitoring.getScheduledQueryRulesAlert({
        resourceGroupName: "example-rg",
        name: "tfex-queryrule",
    });
    export const queryRuleId = example.then(example => example.id);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.monitoring.get_scheduled_query_rules_alert(resource_group_name="example-rg",
        name="tfex-queryrule")
    pulumi.export("queryRuleId", example.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := monitoring.LookupScheduledQueryRulesAlert(ctx, &monitoring.LookupScheduledQueryRulesAlertArgs{
    			ResourceGroupName: "example-rg",
    			Name:              "tfex-queryrule",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("queryRuleId", example.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.Monitoring.GetScheduledQueryRulesAlert.Invoke(new()
        {
            ResourceGroupName = "example-rg",
            Name = "tfex-queryrule",
        });
    
        return new Dictionary<string, object?>
        {
            ["queryRuleId"] = example.Apply(getScheduledQueryRulesAlertResult => getScheduledQueryRulesAlertResult.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.monitoring.MonitoringFunctions;
    import com.pulumi.azure.monitoring.inputs.GetScheduledQueryRulesAlertArgs;
    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 = MonitoringFunctions.getScheduledQueryRulesAlert(GetScheduledQueryRulesAlertArgs.builder()
                .resourceGroupName("example-rg")
                .name("tfex-queryrule")
                .build());
    
            ctx.export("queryRuleId", example.applyValue(getScheduledQueryRulesAlertResult -> getScheduledQueryRulesAlertResult.id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:monitoring:getScheduledQueryRulesAlert
          Arguments:
            resourceGroupName: example-rg
            name: tfex-queryrule
    outputs:
      queryRuleId: ${example.id}
    

    Using getScheduledQueryRulesAlert

    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 getScheduledQueryRulesAlert(args: GetScheduledQueryRulesAlertArgs, opts?: InvokeOptions): Promise<GetScheduledQueryRulesAlertResult>
    function getScheduledQueryRulesAlertOutput(args: GetScheduledQueryRulesAlertOutputArgs, opts?: InvokeOptions): Output<GetScheduledQueryRulesAlertResult>
    def get_scheduled_query_rules_alert(name: Optional[str] = None,
                                        resource_group_name: Optional[str] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetScheduledQueryRulesAlertResult
    def get_scheduled_query_rules_alert_output(name: Optional[pulumi.Input[str]] = None,
                                        resource_group_name: Optional[pulumi.Input[str]] = None,
                                        opts: Optional[InvokeOptions] = None) -> Output[GetScheduledQueryRulesAlertResult]
    func LookupScheduledQueryRulesAlert(ctx *Context, args *LookupScheduledQueryRulesAlertArgs, opts ...InvokeOption) (*LookupScheduledQueryRulesAlertResult, error)
    func LookupScheduledQueryRulesAlertOutput(ctx *Context, args *LookupScheduledQueryRulesAlertOutputArgs, opts ...InvokeOption) LookupScheduledQueryRulesAlertResultOutput

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

    public static class GetScheduledQueryRulesAlert 
    {
        public static Task<GetScheduledQueryRulesAlertResult> InvokeAsync(GetScheduledQueryRulesAlertArgs args, InvokeOptions? opts = null)
        public static Output<GetScheduledQueryRulesAlertResult> Invoke(GetScheduledQueryRulesAlertInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetScheduledQueryRulesAlertResult> getScheduledQueryRulesAlert(GetScheduledQueryRulesAlertArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:monitoring/getScheduledQueryRulesAlert:getScheduledQueryRulesAlert
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Specifies the name of the scheduled query rule.
    ResourceGroupName string
    Specifies the name of the resource group where the scheduled query rule is located.
    Name string
    Specifies the name of the scheduled query rule.
    ResourceGroupName string
    Specifies the name of the resource group where the scheduled query rule is located.
    name String
    Specifies the name of the scheduled query rule.
    resourceGroupName String
    Specifies the name of the resource group where the scheduled query rule is located.
    name string
    Specifies the name of the scheduled query rule.
    resourceGroupName string
    Specifies the name of the resource group where the scheduled query rule is located.
    name str
    Specifies the name of the scheduled query rule.
    resource_group_name str
    Specifies the name of the resource group where the scheduled query rule is located.
    name String
    Specifies the name of the scheduled query rule.
    resourceGroupName String
    Specifies the name of the resource group where the scheduled query rule is located.

    getScheduledQueryRulesAlert Result

    The following output properties are available:

    Actions List<GetScheduledQueryRulesAlertAction>
    supports the following:
    AuthorizedResourceIds List<string>
    The list of Resource IDs referred into query.
    DataSourceId string
    The resource URI over which log search query is to be run.
    Description string
    The description of the scheduled query rule.
    Enabled bool
    Whether this scheduled query rule is enabled.
    Frequency int
    Frequency at which rule condition should be evaluated.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Specifies the Azure Region where the resource should exist.
    Name string
    Query string
    Log search query.
    QueryType string
    The type of query results.
    ResourceGroupName string
    Severity int
    Severity of the alert.
    Tags Dictionary<string, string>
    Throttling int
    Time for which alerts should be throttled or suppressed.
    TimeWindow int
    Time window for which data needs to be fetched for query.
    Triggers List<GetScheduledQueryRulesAlertTrigger>
    A trigger block as defined below.
    Actions []GetScheduledQueryRulesAlertAction
    supports the following:
    AuthorizedResourceIds []string
    The list of Resource IDs referred into query.
    DataSourceId string
    The resource URI over which log search query is to be run.
    Description string
    The description of the scheduled query rule.
    Enabled bool
    Whether this scheduled query rule is enabled.
    Frequency int
    Frequency at which rule condition should be evaluated.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Specifies the Azure Region where the resource should exist.
    Name string
    Query string
    Log search query.
    QueryType string
    The type of query results.
    ResourceGroupName string
    Severity int
    Severity of the alert.
    Tags map[string]string
    Throttling int
    Time for which alerts should be throttled or suppressed.
    TimeWindow int
    Time window for which data needs to be fetched for query.
    Triggers []GetScheduledQueryRulesAlertTrigger
    A trigger block as defined below.
    actions List<GetScheduledQueryRulesAlertAction>
    supports the following:
    authorizedResourceIds List<String>
    The list of Resource IDs referred into query.
    dataSourceId String
    The resource URI over which log search query is to be run.
    description String
    The description of the scheduled query rule.
    enabled Boolean
    Whether this scheduled query rule is enabled.
    frequency Integer
    Frequency at which rule condition should be evaluated.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    Specifies the Azure Region where the resource should exist.
    name String
    query String
    Log search query.
    queryType String
    The type of query results.
    resourceGroupName String
    severity Integer
    Severity of the alert.
    tags Map<String,String>
    throttling Integer
    Time for which alerts should be throttled or suppressed.
    timeWindow Integer
    Time window for which data needs to be fetched for query.
    triggers List<GetScheduledQueryRulesAlertTrigger>
    A trigger block as defined below.
    actions GetScheduledQueryRulesAlertAction[]
    supports the following:
    authorizedResourceIds string[]
    The list of Resource IDs referred into query.
    dataSourceId string
    The resource URI over which log search query is to be run.
    description string
    The description of the scheduled query rule.
    enabled boolean
    Whether this scheduled query rule is enabled.
    frequency number
    Frequency at which rule condition should be evaluated.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    Specifies the Azure Region where the resource should exist.
    name string
    query string
    Log search query.
    queryType string
    The type of query results.
    resourceGroupName string
    severity number
    Severity of the alert.
    tags {[key: string]: string}
    throttling number
    Time for which alerts should be throttled or suppressed.
    timeWindow number
    Time window for which data needs to be fetched for query.
    triggers GetScheduledQueryRulesAlertTrigger[]
    A trigger block as defined below.
    actions Sequence[GetScheduledQueryRulesAlertAction]
    supports the following:
    authorized_resource_ids Sequence[str]
    The list of Resource IDs referred into query.
    data_source_id str
    The resource URI over which log search query is to be run.
    description str
    The description of the scheduled query rule.
    enabled bool
    Whether this scheduled query rule is enabled.
    frequency int
    Frequency at which rule condition should be evaluated.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    Specifies the Azure Region where the resource should exist.
    name str
    query str
    Log search query.
    query_type str
    The type of query results.
    resource_group_name str
    severity int
    Severity of the alert.
    tags Mapping[str, str]
    throttling int
    Time for which alerts should be throttled or suppressed.
    time_window int
    Time window for which data needs to be fetched for query.
    triggers Sequence[GetScheduledQueryRulesAlertTrigger]
    A trigger block as defined below.
    actions List<Property Map>
    supports the following:
    authorizedResourceIds List<String>
    The list of Resource IDs referred into query.
    dataSourceId String
    The resource URI over which log search query is to be run.
    description String
    The description of the scheduled query rule.
    enabled Boolean
    Whether this scheduled query rule is enabled.
    frequency Number
    Frequency at which rule condition should be evaluated.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    Specifies the Azure Region where the resource should exist.
    name String
    query String
    Log search query.
    queryType String
    The type of query results.
    resourceGroupName String
    severity Number
    Severity of the alert.
    tags Map<String>
    throttling Number
    Time for which alerts should be throttled or suppressed.
    timeWindow Number
    Time window for which data needs to be fetched for query.
    triggers List<Property Map>
    A trigger block as defined below.

    Supporting Types

    GetScheduledQueryRulesAlertAction

    ActionGroups List<string>
    List of action group reference resource IDs.
    CustomWebhookPayload string
    Custom payload to be sent for all webhook URI in Azure action group.
    EmailSubject string
    Custom subject override for all email IDs in Azure action group.
    ActionGroups []string
    List of action group reference resource IDs.
    CustomWebhookPayload string
    Custom payload to be sent for all webhook URI in Azure action group.
    EmailSubject string
    Custom subject override for all email IDs in Azure action group.
    actionGroups List<String>
    List of action group reference resource IDs.
    customWebhookPayload String
    Custom payload to be sent for all webhook URI in Azure action group.
    emailSubject String
    Custom subject override for all email IDs in Azure action group.
    actionGroups string[]
    List of action group reference resource IDs.
    customWebhookPayload string
    Custom payload to be sent for all webhook URI in Azure action group.
    emailSubject string
    Custom subject override for all email IDs in Azure action group.
    action_groups Sequence[str]
    List of action group reference resource IDs.
    custom_webhook_payload str
    Custom payload to be sent for all webhook URI in Azure action group.
    email_subject str
    Custom subject override for all email IDs in Azure action group.
    actionGroups List<String>
    List of action group reference resource IDs.
    customWebhookPayload String
    Custom payload to be sent for all webhook URI in Azure action group.
    emailSubject String
    Custom subject override for all email IDs in Azure action group.

    GetScheduledQueryRulesAlertTrigger

    MetricTriggers List<GetScheduledQueryRulesAlertTriggerMetricTrigger>
    Operator string
    Evaluation operation for rule.
    Threshold double
    Result or count threshold based on which rule should be triggered.
    MetricTriggers []GetScheduledQueryRulesAlertTriggerMetricTrigger
    Operator string
    Evaluation operation for rule.
    Threshold float64
    Result or count threshold based on which rule should be triggered.
    metricTriggers List<GetScheduledQueryRulesAlertTriggerMetricTrigger>
    operator String
    Evaluation operation for rule.
    threshold Double
    Result or count threshold based on which rule should be triggered.
    metricTriggers GetScheduledQueryRulesAlertTriggerMetricTrigger[]
    operator string
    Evaluation operation for rule.
    threshold number
    Result or count threshold based on which rule should be triggered.
    metric_triggers Sequence[GetScheduledQueryRulesAlertTriggerMetricTrigger]
    operator str
    Evaluation operation for rule.
    threshold float
    Result or count threshold based on which rule should be triggered.
    metricTriggers List<Property Map>
    operator String
    Evaluation operation for rule.
    threshold Number
    Result or count threshold based on which rule should be triggered.

    GetScheduledQueryRulesAlertTriggerMetricTrigger

    MetricColumn string
    MetricTriggerType string
    Operator string
    Evaluation operation for rule.
    Threshold double
    Result or count threshold based on which rule should be triggered.
    MetricColumn string
    MetricTriggerType string
    Operator string
    Evaluation operation for rule.
    Threshold float64
    Result or count threshold based on which rule should be triggered.
    metricColumn String
    metricTriggerType String
    operator String
    Evaluation operation for rule.
    threshold Double
    Result or count threshold based on which rule should be triggered.
    metricColumn string
    metricTriggerType string
    operator string
    Evaluation operation for rule.
    threshold number
    Result or count threshold based on which rule should be triggered.
    metric_column str
    metric_trigger_type str
    operator str
    Evaluation operation for rule.
    threshold float
    Result or count threshold based on which rule should be triggered.
    metricColumn String
    metricTriggerType String
    operator String
    Evaluation operation for rule.
    threshold Number
    Result or count threshold based on which rule should be triggered.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi