# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables

class GetProjectAlertRuleResult:
    """
    A collection of values returned by getProjectAlertRule.
    """
    def __init__(__self__, annotations=None, group_id=None, group_interval_seconds=None, group_wait_seconds=None, id=None, inherited=None, labels=None, metric_rule=None, name=None, pod_rule=None, project_id=None, repeat_interval_seconds=None, severity=None, workload_rule=None):
        if annotations and not isinstance(annotations, dict):
            raise TypeError("Expected argument 'annotations' to be a dict")
        __self__.annotations = annotations
        """
        (Computed) The project alert rule annotations (map)
        """
        if group_id and not isinstance(group_id, str):
            raise TypeError("Expected argument 'group_id' to be a str")
        __self__.group_id = group_id
        """
        (Computed) The project alert rule alert group ID (string)
        """
        if group_interval_seconds and not isinstance(group_interval_seconds, float):
            raise TypeError("Expected argument 'group_interval_seconds' to be a float")
        __self__.group_interval_seconds = group_interval_seconds
        """
        (Computed) The project alert rule group interval seconds. Default: `180` (int)
        """
        if group_wait_seconds and not isinstance(group_wait_seconds, float):
            raise TypeError("Expected argument 'group_wait_seconds' to be a float")
        __self__.group_wait_seconds = group_wait_seconds
        """
        (Computed) The project alert rule group wait seconds. Default: `180` (int)
        """
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        The provider-assigned unique ID for this managed resource.
        """
        if inherited and not isinstance(inherited, bool):
            raise TypeError("Expected argument 'inherited' to be a bool")
        __self__.inherited = inherited
        """
        (Computed) The project alert rule inherited. Default: `true` (bool)
        """
        if labels and not isinstance(labels, dict):
            raise TypeError("Expected argument 'labels' to be a dict")
        __self__.labels = labels
        """
        (Computed) The project alert rule labels (map)
        """
        if metric_rule and not isinstance(metric_rule, dict):
            raise TypeError("Expected argument 'metric_rule' to be a dict")
        __self__.metric_rule = metric_rule
        """
        (Computed) The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
        """
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        __self__.name = name
        if pod_rule and not isinstance(pod_rule, dict):
            raise TypeError("Expected argument 'pod_rule' to be a dict")
        __self__.pod_rule = pod_rule
        """
        (Computed) The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
        """
        if project_id and not isinstance(project_id, str):
            raise TypeError("Expected argument 'project_id' to be a str")
        __self__.project_id = project_id
        if repeat_interval_seconds and not isinstance(repeat_interval_seconds, float):
            raise TypeError("Expected argument 'repeat_interval_seconds' to be a float")
        __self__.repeat_interval_seconds = repeat_interval_seconds
        """
        (Computed) The project alert rule wait seconds. Default: `3600` (int)
        """
        if severity and not isinstance(severity, str):
            raise TypeError("Expected argument 'severity' to be a str")
        __self__.severity = severity
        """
        (Computed) The project alert rule severity. Supported values : `"critical" | "info" | "warning"`. Default: `critical` (string)
        """
        if workload_rule and not isinstance(workload_rule, dict):
            raise TypeError("Expected argument 'workload_rule' to be a dict")
        __self__.workload_rule = workload_rule
        """
        (Computed) The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
        """
class AwaitableGetProjectAlertRuleResult(GetProjectAlertRuleResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetProjectAlertRuleResult(
            annotations=self.annotations,
            group_id=self.group_id,
            group_interval_seconds=self.group_interval_seconds,
            group_wait_seconds=self.group_wait_seconds,
            id=self.id,
            inherited=self.inherited,
            labels=self.labels,
            metric_rule=self.metric_rule,
            name=self.name,
            pod_rule=self.pod_rule,
            project_id=self.project_id,
            repeat_interval_seconds=self.repeat_interval_seconds,
            severity=self.severity,
            workload_rule=self.workload_rule)

def get_project_alert_rule(labels=None,name=None,project_id=None,opts=None):
    """
    Use this data source to retrieve information about a Rancher v2 project alert rule.




    :param dict labels: (Computed) The project alert rule labels (map)
    :param str name: The project alert rule name (string)
    :param str project_id: The project id where create project alert rule (string)
    """
    __args__ = dict()


    __args__['labels'] = labels
    __args__['name'] = name
    __args__['projectId'] = project_id
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('rancher2:index/getProjectAlertRule:getProjectAlertRule', __args__, opts=opts).value

    return AwaitableGetProjectAlertRuleResult(
        annotations=__ret__.get('annotations'),
        group_id=__ret__.get('groupId'),
        group_interval_seconds=__ret__.get('groupIntervalSeconds'),
        group_wait_seconds=__ret__.get('groupWaitSeconds'),
        id=__ret__.get('id'),
        inherited=__ret__.get('inherited'),
        labels=__ret__.get('labels'),
        metric_rule=__ret__.get('metricRule'),
        name=__ret__.get('name'),
        pod_rule=__ret__.get('podRule'),
        project_id=__ret__.get('projectId'),
        repeat_interval_seconds=__ret__.get('repeatIntervalSeconds'),
        severity=__ret__.get('severity'),
        workload_rule=__ret__.get('workloadRule'))
