import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
 * Manages an AlertingAction Scheduled Query Rules resource within Azure Monitor.
 *
 * > **Note:** This resource is using an older AzureRM API version which is known to cause problems e.g. with custom webhook properties not included in triggered alerts. This resource is superseded by the azure.monitoring.ScheduledQueryRulesAlertV2 resource using newer API versions.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "monitoring-resources",
 *     location: "West Europe",
 * });
 * const exampleInsights = new azure.appinsights.Insights("example", {
 *     name: "appinsights",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     applicationType: "web",
 * });
 * const example2 = new azure.appinsights.Insights("example2", {
 *     name: "appinsights2",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     applicationType: "web",
 * });
 * // Example: Alerting Action with result count trigger
 * const exampleScheduledQueryRulesAlert = new azure.monitoring.ScheduledQueryRulesAlert("example", {
 *     name: "example",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     action: {
 *         actionGroups: [],
 *         emailSubject: "Email Header",
 *         customWebhookPayload: "{}",
 *     },
 *     dataSourceId: exampleInsights.id,
 *     description: "Alert when total results cross threshold",
 *     enabled: true,
 *     query: `requests
 *   | where tolong(resultCode) >= 500
 *   | summarize count() by bin(timestamp, 5m)
 * `,
 *     severity: 1,
 *     frequency: 5,
 *     timeWindow: 30,
 *     trigger: {
 *         operator: "GreaterThan",
 *         threshold: 3,
 *     },
 *     tags: {
 *         foo: "bar",
 *     },
 * });
 * // Example: Alerting Action Cross-Resource
 * const example2ScheduledQueryRulesAlert = new azure.monitoring.ScheduledQueryRulesAlert("example2", {
 *     name: "example",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     authorizedResourceIds: [example2.id],
 *     action: {
 *         actionGroups: [],
 *         emailSubject: "Email Header",
 *         customWebhookPayload: "{}",
 *     },
 *     dataSourceId: exampleInsights.id,
 *     description: "Query may access data within multiple resources",
 *     enabled: true,
 *     query: std.format({
 *         input: `let a=requests
 *   | where toint(resultCode) >= 500
 *   | extend fail=1; let b=app('%s').requests
 *   | where toint(resultCode) >= 500 | extend fail=1; a
 *   | join b on fail
 * `,
 *         args: [example2.id],
 *     }).then(invoke => invoke.result),
 *     severity: 1,
 *     frequency: 5,
 *     timeWindow: 30,
 *     trigger: {
 *         operator: "GreaterThan",
 *         threshold: 3,
 *     },
 *     tags: {
 *         foo: "bar",
 *     },
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Insights` - 2018-04-16
 *
 * ## Import
 *
 * Scheduled Query Rule Alerts can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:monitoring/scheduledQueryRulesAlert:ScheduledQueryRulesAlert example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Insights/scheduledQueryRules/myrulename
 * ```
 */
export declare class ScheduledQueryRulesAlert extends pulumi.CustomResource {
    /**
     * Get an existing ScheduledQueryRulesAlert 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?: ScheduledQueryRulesAlertState, opts?: pulumi.CustomResourceOptions): ScheduledQueryRulesAlert;
    /**
     * Returns true if the given object is an instance of ScheduledQueryRulesAlert.  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 ScheduledQueryRulesAlert;
    /**
     * An `action` block as defined below.
     */
    readonly action: pulumi.Output<outputs.monitoring.ScheduledQueryRulesAlertAction>;
    /**
     * List of Resource IDs referred into query.
     */
    readonly authorizedResourceIds: pulumi.Output<string[] | undefined>;
    /**
     * Should the alerts in this Metric Alert be auto resolved? Defaults to `false`.
     * > **Note:** `autoMitigationEnabled` and `throttling` are mutually exclusive and cannot both be set.
     */
    readonly autoMitigationEnabled: pulumi.Output<boolean | undefined>;
    /**
     * The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
     */
    readonly dataSourceId: pulumi.Output<string>;
    /**
     * The description of the scheduled query rule.
     */
    readonly description: pulumi.Output<string | undefined>;
    /**
     * Whether this scheduled query rule is enabled. Default is `true`.
     */
    readonly enabled: pulumi.Output<boolean | undefined>;
    /**
     * Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
     */
    readonly frequency: pulumi.Output<number>;
    /**
     * Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
     */
    readonly location: pulumi.Output<string>;
    /**
     * The name of the scheduled query rule. Changing this forces a new resource to be created.
     */
    readonly name: pulumi.Output<string>;
    /**
     * Log search query.
     */
    readonly query: pulumi.Output<string>;
    /**
     * The type of query results. Possible values are `ResultCount` and `Number`. Default is `ResultCount`. If set to `ResultCount`, `query` must include an `AggregatedValue` column of a numeric type, for example, `Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m)`.
     */
    readonly queryType: pulumi.Output<string | undefined>;
    /**
     * The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
     */
    readonly resourceGroupName: pulumi.Output<string>;
    /**
     * Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
     */
    readonly severity: pulumi.Output<number | undefined>;
    /**
     * A mapping of tags to assign to the resource.
     */
    readonly tags: pulumi.Output<{
        [key: string]: string;
    } | undefined>;
    /**
     * Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
     */
    readonly throttling: pulumi.Output<number | undefined>;
    /**
     * Time window for which data needs to be fetched for query (must be greater than or equal to `frequency`). Values must be between 5 and 2880 (inclusive).
     */
    readonly timeWindow: pulumi.Output<number>;
    /**
     * A `trigger` block as defined below.
     */
    readonly trigger: pulumi.Output<outputs.monitoring.ScheduledQueryRulesAlertTrigger>;
    /**
     * Create a ScheduledQueryRulesAlert 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: ScheduledQueryRulesAlertArgs, opts?: pulumi.CustomResourceOptions);
}
/**
 * Input properties used for looking up and filtering ScheduledQueryRulesAlert resources.
 */
export interface ScheduledQueryRulesAlertState {
    /**
     * An `action` block as defined below.
     */
    action?: pulumi.Input<inputs.monitoring.ScheduledQueryRulesAlertAction | undefined>;
    /**
     * List of Resource IDs referred into query.
     */
    authorizedResourceIds?: pulumi.Input<pulumi.Input<string>[] | undefined>;
    /**
     * Should the alerts in this Metric Alert be auto resolved? Defaults to `false`.
     * > **Note:** `autoMitigationEnabled` and `throttling` are mutually exclusive and cannot both be set.
     */
    autoMitigationEnabled?: pulumi.Input<boolean | undefined>;
    /**
     * The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
     */
    dataSourceId?: pulumi.Input<string | undefined>;
    /**
     * The description of the scheduled query rule.
     */
    description?: pulumi.Input<string | undefined>;
    /**
     * Whether this scheduled query rule is enabled. Default is `true`.
     */
    enabled?: pulumi.Input<boolean | undefined>;
    /**
     * Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
     */
    frequency?: pulumi.Input<number | undefined>;
    /**
     * Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
     */
    location?: pulumi.Input<string | undefined>;
    /**
     * The name of the scheduled query rule. Changing this forces a new resource to be created.
     */
    name?: pulumi.Input<string | undefined>;
    /**
     * Log search query.
     */
    query?: pulumi.Input<string | undefined>;
    /**
     * The type of query results. Possible values are `ResultCount` and `Number`. Default is `ResultCount`. If set to `ResultCount`, `query` must include an `AggregatedValue` column of a numeric type, for example, `Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m)`.
     */
    queryType?: pulumi.Input<string | undefined>;
    /**
     * The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
     */
    resourceGroupName?: pulumi.Input<string | undefined>;
    /**
     * Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
     */
    severity?: pulumi.Input<number | undefined>;
    /**
     * A mapping of tags to assign to the resource.
     */
    tags?: pulumi.Input<{
        [key: string]: pulumi.Input<string>;
    } | undefined>;
    /**
     * Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
     */
    throttling?: pulumi.Input<number | undefined>;
    /**
     * Time window for which data needs to be fetched for query (must be greater than or equal to `frequency`). Values must be between 5 and 2880 (inclusive).
     */
    timeWindow?: pulumi.Input<number | undefined>;
    /**
     * A `trigger` block as defined below.
     */
    trigger?: pulumi.Input<inputs.monitoring.ScheduledQueryRulesAlertTrigger | undefined>;
}
/**
 * The set of arguments for constructing a ScheduledQueryRulesAlert resource.
 */
export interface ScheduledQueryRulesAlertArgs {
    /**
     * An `action` block as defined below.
     */
    action: pulumi.Input<inputs.monitoring.ScheduledQueryRulesAlertAction>;
    /**
     * List of Resource IDs referred into query.
     */
    authorizedResourceIds?: pulumi.Input<pulumi.Input<string>[] | undefined>;
    /**
     * Should the alerts in this Metric Alert be auto resolved? Defaults to `false`.
     * > **Note:** `autoMitigationEnabled` and `throttling` are mutually exclusive and cannot both be set.
     */
    autoMitigationEnabled?: pulumi.Input<boolean | undefined>;
    /**
     * The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
     */
    dataSourceId: pulumi.Input<string>;
    /**
     * The description of the scheduled query rule.
     */
    description?: pulumi.Input<string | undefined>;
    /**
     * Whether this scheduled query rule is enabled. Default is `true`.
     */
    enabled?: pulumi.Input<boolean | undefined>;
    /**
     * Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
     */
    frequency: pulumi.Input<number>;
    /**
     * Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
     */
    location?: pulumi.Input<string | undefined>;
    /**
     * The name of the scheduled query rule. Changing this forces a new resource to be created.
     */
    name?: pulumi.Input<string | undefined>;
    /**
     * Log search query.
     */
    query: pulumi.Input<string>;
    /**
     * The type of query results. Possible values are `ResultCount` and `Number`. Default is `ResultCount`. If set to `ResultCount`, `query` must include an `AggregatedValue` column of a numeric type, for example, `Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m)`.
     */
    queryType?: pulumi.Input<string | undefined>;
    /**
     * The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
     */
    resourceGroupName: pulumi.Input<string>;
    /**
     * Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
     */
    severity?: pulumi.Input<number | undefined>;
    /**
     * A mapping of tags to assign to the resource.
     */
    tags?: pulumi.Input<{
        [key: string]: pulumi.Input<string>;
    } | undefined>;
    /**
     * Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
     */
    throttling?: pulumi.Input<number | undefined>;
    /**
     * Time window for which data needs to be fetched for query (must be greater than or equal to `frequency`). Values must be between 5 and 2880 (inclusive).
     */
    timeWindow: pulumi.Input<number>;
    /**
     * A `trigger` block as defined below.
     */
    trigger: pulumi.Input<inputs.monitoring.ScheduledQueryRulesAlertTrigger>;
}
//# sourceMappingURL=scheduledQueryRulesAlert.d.ts.map