All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.insights.outputs.GetScheduledQueryRuleResult Maven / Gradle / Ivy

// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azurenative.insights.outputs;

import com.pulumi.azurenative.insights.outputs.ActionsResponse;
import com.pulumi.azurenative.insights.outputs.IdentityResponse;
import com.pulumi.azurenative.insights.outputs.RuleResolveConfigurationResponse;
import com.pulumi.azurenative.insights.outputs.ScheduledQueryRuleCriteriaResponse;
import com.pulumi.azurenative.insights.outputs.SystemDataResponse;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Double;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class GetScheduledQueryRuleResult {
    /**
     * @return Actions to invoke when the alert fires.
     * 
     */
    private @Nullable ActionsResponse actions;
    /**
     * @return The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert.
     * 
     */
    private @Nullable Boolean autoMitigate;
    /**
     * @return The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert.
     * 
     */
    private @Nullable Boolean checkWorkspaceAlertsStorageConfigured;
    /**
     * @return The api-version used when creating this alert rule
     * 
     */
    private String createdWithApiVersion;
    /**
     * @return The rule criteria that defines the conditions of the scheduled query rule.
     * 
     */
    private ScheduledQueryRuleCriteriaResponse criteria;
    /**
     * @return The description of the scheduled query rule.
     * 
     */
    private @Nullable String description;
    /**
     * @return The display name of the alert rule
     * 
     */
    private @Nullable String displayName;
    /**
     * @return The flag which indicates whether this scheduled query rule is enabled. Value should be true or false
     * 
     */
    private Boolean enabled;
    /**
     * @return The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention.  Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
     * 
     */
    private String etag;
    /**
     * @return How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert.
     * 
     */
    private @Nullable String evaluationFrequency;
    /**
     * @return Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
     * 
     */
    private String id;
    /**
     * @return The identity of the resource.
     * 
     */
    private @Nullable IdentityResponse identity;
    /**
     * @return True if alert rule is legacy Log Analytic rule
     * 
     */
    private Boolean isLegacyLogAnalyticsRule;
    /**
     * @return The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false.
     * 
     */
    private Boolean isWorkspaceAlertsStorageConfigured;
    /**
     * @return Indicates the type of scheduled query rule. The default is LogAlert.
     * 
     */
    private @Nullable String kind;
    /**
     * @return The geo-location where the resource lives
     * 
     */
    private String location;
    /**
     * @return Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert.
     * 
     */
    private @Nullable String muteActionsDuration;
    /**
     * @return The name of the resource
     * 
     */
    private String name;
    /**
     * @return If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert.
     * 
     */
    private @Nullable String overrideQueryTimeRange;
    /**
     * @return Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert.
     * 
     */
    private @Nullable RuleResolveConfigurationResponse resolveConfiguration;
    /**
     * @return The list of resource id's that this scheduled query rule is scoped to.
     * 
     */
    private List scopes;
    /**
     * @return Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert.
     * 
     */
    private @Nullable Double severity;
    /**
     * @return The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert.
     * 
     */
    private @Nullable Boolean skipQueryValidation;
    /**
     * @return SystemData of ScheduledQueryRule.
     * 
     */
    private SystemDataResponse systemData;
    /**
     * @return Resource tags.
     * 
     */
    private @Nullable Map tags;
    /**
     * @return List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert
     * 
     */
    private @Nullable List targetResourceTypes;
    /**
     * @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
     * 
     */
    private String type;
    /**
     * @return The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert.
     * 
     */
    private @Nullable String windowSize;

    private GetScheduledQueryRuleResult() {}
    /**
     * @return Actions to invoke when the alert fires.
     * 
     */
    public Optional actions() {
        return Optional.ofNullable(this.actions);
    }
    /**
     * @return The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert.
     * 
     */
    public Optional autoMitigate() {
        return Optional.ofNullable(this.autoMitigate);
    }
    /**
     * @return The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert.
     * 
     */
    public Optional checkWorkspaceAlertsStorageConfigured() {
        return Optional.ofNullable(this.checkWorkspaceAlertsStorageConfigured);
    }
    /**
     * @return The api-version used when creating this alert rule
     * 
     */
    public String createdWithApiVersion() {
        return this.createdWithApiVersion;
    }
    /**
     * @return The rule criteria that defines the conditions of the scheduled query rule.
     * 
     */
    public ScheduledQueryRuleCriteriaResponse criteria() {
        return this.criteria;
    }
    /**
     * @return The description of the scheduled query rule.
     * 
     */
    public Optional description() {
        return Optional.ofNullable(this.description);
    }
    /**
     * @return The display name of the alert rule
     * 
     */
    public Optional displayName() {
        return Optional.ofNullable(this.displayName);
    }
    /**
     * @return The flag which indicates whether this scheduled query rule is enabled. Value should be true or false
     * 
     */
    public Boolean enabled() {
        return this.enabled;
    }
    /**
     * @return The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention.  Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
     * 
     */
    public String etag() {
        return this.etag;
    }
    /**
     * @return How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert.
     * 
     */
    public Optional evaluationFrequency() {
        return Optional.ofNullable(this.evaluationFrequency);
    }
    /**
     * @return Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
     * 
     */
    public String id() {
        return this.id;
    }
    /**
     * @return The identity of the resource.
     * 
     */
    public Optional identity() {
        return Optional.ofNullable(this.identity);
    }
    /**
     * @return True if alert rule is legacy Log Analytic rule
     * 
     */
    public Boolean isLegacyLogAnalyticsRule() {
        return this.isLegacyLogAnalyticsRule;
    }
    /**
     * @return The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false.
     * 
     */
    public Boolean isWorkspaceAlertsStorageConfigured() {
        return this.isWorkspaceAlertsStorageConfigured;
    }
    /**
     * @return Indicates the type of scheduled query rule. The default is LogAlert.
     * 
     */
    public Optional kind() {
        return Optional.ofNullable(this.kind);
    }
    /**
     * @return The geo-location where the resource lives
     * 
     */
    public String location() {
        return this.location;
    }
    /**
     * @return Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert.
     * 
     */
    public Optional muteActionsDuration() {
        return Optional.ofNullable(this.muteActionsDuration);
    }
    /**
     * @return The name of the resource
     * 
     */
    public String name() {
        return this.name;
    }
    /**
     * @return If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert.
     * 
     */
    public Optional overrideQueryTimeRange() {
        return Optional.ofNullable(this.overrideQueryTimeRange);
    }
    /**
     * @return Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert.
     * 
     */
    public Optional resolveConfiguration() {
        return Optional.ofNullable(this.resolveConfiguration);
    }
    /**
     * @return The list of resource id's that this scheduled query rule is scoped to.
     * 
     */
    public List scopes() {
        return this.scopes;
    }
    /**
     * @return Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert.
     * 
     */
    public Optional severity() {
        return Optional.ofNullable(this.severity);
    }
    /**
     * @return The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert.
     * 
     */
    public Optional skipQueryValidation() {
        return Optional.ofNullable(this.skipQueryValidation);
    }
    /**
     * @return SystemData of ScheduledQueryRule.
     * 
     */
    public SystemDataResponse systemData() {
        return this.systemData;
    }
    /**
     * @return Resource tags.
     * 
     */
    public Map tags() {
        return this.tags == null ? Map.of() : this.tags;
    }
    /**
     * @return List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert
     * 
     */
    public List targetResourceTypes() {
        return this.targetResourceTypes == null ? List.of() : this.targetResourceTypes;
    }
    /**
     * @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
     * 
     */
    public String type() {
        return this.type;
    }
    /**
     * @return The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert.
     * 
     */
    public Optional windowSize() {
        return Optional.ofNullable(this.windowSize);
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(GetScheduledQueryRuleResult defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable ActionsResponse actions;
        private @Nullable Boolean autoMitigate;
        private @Nullable Boolean checkWorkspaceAlertsStorageConfigured;
        private String createdWithApiVersion;
        private ScheduledQueryRuleCriteriaResponse criteria;
        private @Nullable String description;
        private @Nullable String displayName;
        private Boolean enabled;
        private String etag;
        private @Nullable String evaluationFrequency;
        private String id;
        private @Nullable IdentityResponse identity;
        private Boolean isLegacyLogAnalyticsRule;
        private Boolean isWorkspaceAlertsStorageConfigured;
        private @Nullable String kind;
        private String location;
        private @Nullable String muteActionsDuration;
        private String name;
        private @Nullable String overrideQueryTimeRange;
        private @Nullable RuleResolveConfigurationResponse resolveConfiguration;
        private List scopes;
        private @Nullable Double severity;
        private @Nullable Boolean skipQueryValidation;
        private SystemDataResponse systemData;
        private @Nullable Map tags;
        private @Nullable List targetResourceTypes;
        private String type;
        private @Nullable String windowSize;
        public Builder() {}
        public Builder(GetScheduledQueryRuleResult defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.actions = defaults.actions;
    	      this.autoMitigate = defaults.autoMitigate;
    	      this.checkWorkspaceAlertsStorageConfigured = defaults.checkWorkspaceAlertsStorageConfigured;
    	      this.createdWithApiVersion = defaults.createdWithApiVersion;
    	      this.criteria = defaults.criteria;
    	      this.description = defaults.description;
    	      this.displayName = defaults.displayName;
    	      this.enabled = defaults.enabled;
    	      this.etag = defaults.etag;
    	      this.evaluationFrequency = defaults.evaluationFrequency;
    	      this.id = defaults.id;
    	      this.identity = defaults.identity;
    	      this.isLegacyLogAnalyticsRule = defaults.isLegacyLogAnalyticsRule;
    	      this.isWorkspaceAlertsStorageConfigured = defaults.isWorkspaceAlertsStorageConfigured;
    	      this.kind = defaults.kind;
    	      this.location = defaults.location;
    	      this.muteActionsDuration = defaults.muteActionsDuration;
    	      this.name = defaults.name;
    	      this.overrideQueryTimeRange = defaults.overrideQueryTimeRange;
    	      this.resolveConfiguration = defaults.resolveConfiguration;
    	      this.scopes = defaults.scopes;
    	      this.severity = defaults.severity;
    	      this.skipQueryValidation = defaults.skipQueryValidation;
    	      this.systemData = defaults.systemData;
    	      this.tags = defaults.tags;
    	      this.targetResourceTypes = defaults.targetResourceTypes;
    	      this.type = defaults.type;
    	      this.windowSize = defaults.windowSize;
        }

        @CustomType.Setter
        public Builder actions(@Nullable ActionsResponse actions) {

            this.actions = actions;
            return this;
        }
        @CustomType.Setter
        public Builder autoMitigate(@Nullable Boolean autoMitigate) {

            this.autoMitigate = autoMitigate;
            return this;
        }
        @CustomType.Setter
        public Builder checkWorkspaceAlertsStorageConfigured(@Nullable Boolean checkWorkspaceAlertsStorageConfigured) {

            this.checkWorkspaceAlertsStorageConfigured = checkWorkspaceAlertsStorageConfigured;
            return this;
        }
        @CustomType.Setter
        public Builder createdWithApiVersion(String createdWithApiVersion) {
            if (createdWithApiVersion == null) {
              throw new MissingRequiredPropertyException("GetScheduledQueryRuleResult", "createdWithApiVersion");
            }
            this.createdWithApiVersion = createdWithApiVersion;
            return this;
        }
        @CustomType.Setter
        public Builder criteria(ScheduledQueryRuleCriteriaResponse criteria) {
            if (criteria == null) {
              throw new MissingRequiredPropertyException("GetScheduledQueryRuleResult", "criteria");
            }
            this.criteria = criteria;
            return this;
        }
        @CustomType.Setter
        public Builder description(@Nullable String description) {

            this.description = description;
            return this;
        }
        @CustomType.Setter
        public Builder displayName(@Nullable String displayName) {

            this.displayName = displayName;
            return this;
        }
        @CustomType.Setter
        public Builder enabled(Boolean enabled) {
            if (enabled == null) {
              throw new MissingRequiredPropertyException("GetScheduledQueryRuleResult", "enabled");
            }
            this.enabled = enabled;
            return this;
        }
        @CustomType.Setter
        public Builder etag(String etag) {
            if (etag == null) {
              throw new MissingRequiredPropertyException("GetScheduledQueryRuleResult", "etag");
            }
            this.etag = etag;
            return this;
        }
        @CustomType.Setter
        public Builder evaluationFrequency(@Nullable String evaluationFrequency) {

            this.evaluationFrequency = evaluationFrequency;
            return this;
        }
        @CustomType.Setter
        public Builder id(String id) {
            if (id == null) {
              throw new MissingRequiredPropertyException("GetScheduledQueryRuleResult", "id");
            }
            this.id = id;
            return this;
        }
        @CustomType.Setter
        public Builder identity(@Nullable IdentityResponse identity) {

            this.identity = identity;
            return this;
        }
        @CustomType.Setter
        public Builder isLegacyLogAnalyticsRule(Boolean isLegacyLogAnalyticsRule) {
            if (isLegacyLogAnalyticsRule == null) {
              throw new MissingRequiredPropertyException("GetScheduledQueryRuleResult", "isLegacyLogAnalyticsRule");
            }
            this.isLegacyLogAnalyticsRule = isLegacyLogAnalyticsRule;
            return this;
        }
        @CustomType.Setter
        public Builder isWorkspaceAlertsStorageConfigured(Boolean isWorkspaceAlertsStorageConfigured) {
            if (isWorkspaceAlertsStorageConfigured == null) {
              throw new MissingRequiredPropertyException("GetScheduledQueryRuleResult", "isWorkspaceAlertsStorageConfigured");
            }
            this.isWorkspaceAlertsStorageConfigured = isWorkspaceAlertsStorageConfigured;
            return this;
        }
        @CustomType.Setter
        public Builder kind(@Nullable String kind) {

            this.kind = kind;
            return this;
        }
        @CustomType.Setter
        public Builder location(String location) {
            if (location == null) {
              throw new MissingRequiredPropertyException("GetScheduledQueryRuleResult", "location");
            }
            this.location = location;
            return this;
        }
        @CustomType.Setter
        public Builder muteActionsDuration(@Nullable String muteActionsDuration) {

            this.muteActionsDuration = muteActionsDuration;
            return this;
        }
        @CustomType.Setter
        public Builder name(String name) {
            if (name == null) {
              throw new MissingRequiredPropertyException("GetScheduledQueryRuleResult", "name");
            }
            this.name = name;
            return this;
        }
        @CustomType.Setter
        public Builder overrideQueryTimeRange(@Nullable String overrideQueryTimeRange) {

            this.overrideQueryTimeRange = overrideQueryTimeRange;
            return this;
        }
        @CustomType.Setter
        public Builder resolveConfiguration(@Nullable RuleResolveConfigurationResponse resolveConfiguration) {

            this.resolveConfiguration = resolveConfiguration;
            return this;
        }
        @CustomType.Setter
        public Builder scopes(List scopes) {
            if (scopes == null) {
              throw new MissingRequiredPropertyException("GetScheduledQueryRuleResult", "scopes");
            }
            this.scopes = scopes;
            return this;
        }
        public Builder scopes(String... scopes) {
            return scopes(List.of(scopes));
        }
        @CustomType.Setter
        public Builder severity(@Nullable Double severity) {

            this.severity = severity;
            return this;
        }
        @CustomType.Setter
        public Builder skipQueryValidation(@Nullable Boolean skipQueryValidation) {

            this.skipQueryValidation = skipQueryValidation;
            return this;
        }
        @CustomType.Setter
        public Builder systemData(SystemDataResponse systemData) {
            if (systemData == null) {
              throw new MissingRequiredPropertyException("GetScheduledQueryRuleResult", "systemData");
            }
            this.systemData = systemData;
            return this;
        }
        @CustomType.Setter
        public Builder tags(@Nullable Map tags) {

            this.tags = tags;
            return this;
        }
        @CustomType.Setter
        public Builder targetResourceTypes(@Nullable List targetResourceTypes) {

            this.targetResourceTypes = targetResourceTypes;
            return this;
        }
        public Builder targetResourceTypes(String... targetResourceTypes) {
            return targetResourceTypes(List.of(targetResourceTypes));
        }
        @CustomType.Setter
        public Builder type(String type) {
            if (type == null) {
              throw new MissingRequiredPropertyException("GetScheduledQueryRuleResult", "type");
            }
            this.type = type;
            return this;
        }
        @CustomType.Setter
        public Builder windowSize(@Nullable String windowSize) {

            this.windowSize = windowSize;
            return this;
        }
        public GetScheduledQueryRuleResult build() {
            final var _resultValue = new GetScheduledQueryRuleResult();
            _resultValue.actions = actions;
            _resultValue.autoMitigate = autoMitigate;
            _resultValue.checkWorkspaceAlertsStorageConfigured = checkWorkspaceAlertsStorageConfigured;
            _resultValue.createdWithApiVersion = createdWithApiVersion;
            _resultValue.criteria = criteria;
            _resultValue.description = description;
            _resultValue.displayName = displayName;
            _resultValue.enabled = enabled;
            _resultValue.etag = etag;
            _resultValue.evaluationFrequency = evaluationFrequency;
            _resultValue.id = id;
            _resultValue.identity = identity;
            _resultValue.isLegacyLogAnalyticsRule = isLegacyLogAnalyticsRule;
            _resultValue.isWorkspaceAlertsStorageConfigured = isWorkspaceAlertsStorageConfigured;
            _resultValue.kind = kind;
            _resultValue.location = location;
            _resultValue.muteActionsDuration = muteActionsDuration;
            _resultValue.name = name;
            _resultValue.overrideQueryTimeRange = overrideQueryTimeRange;
            _resultValue.resolveConfiguration = resolveConfiguration;
            _resultValue.scopes = scopes;
            _resultValue.severity = severity;
            _resultValue.skipQueryValidation = skipQueryValidation;
            _resultValue.systemData = systemData;
            _resultValue.tags = tags;
            _resultValue.targetResourceTypes = targetResourceTypes;
            _resultValue.type = type;
            _resultValue.windowSize = windowSize;
            return _resultValue;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy