# 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 Alert(pulumi.CustomResource):
    alert_description: pulumi.Output[str]
    """
    Alert description.
    """
    alert_displayname: pulumi.Output[str]
    """
    Alert displayname.
    """
    alert_name: pulumi.Output[str]
    """
    Name of logstore for configuring alarm service.
    """
    condition: pulumi.Output[str]
    """
    Conditional expression, such as: count> 100.
    """
    dashboard: pulumi.Output[str]
    mute_until: pulumi.Output[float]
    """
    Timestamp, notifications before closing again.
    """
    notification_lists: pulumi.Output[list]
    """
    Alarm information notification list.

      * `content` (`str`) - Notice content of alarm.
      * `emailLists` (`list`) - Email address list.   
      * `mobileLists` (`list`) - SMS sending mobile number.
      * `serviceUri` (`str`) - Request address.
      * `type` (`str`) - Notification type. support Email, SMS, DingTalk.
    """
    notify_threshold: pulumi.Output[float]
    """
    Notification threshold, which is not notified until the number of triggers is reached. The default is 1.
    """
    project_name: pulumi.Output[str]
    """
    The project name.
    """
    query_lists: pulumi.Output[list]
    """
    Multiple conditions for configured alarm query.

      * `chartTitle` (`str`) - chart title
      * `end` (`str`) - end time. example: 20s.
      * `logstore` (`str`) - Query logstore
      * `query` (`str`) - query corresponding to chart. example: * AND aliyun.
      * `start` (`str`) - begin time. example: -60s.
      * `timeSpanType` (`str`) - default Custom. No need to configure this parameter.
    """
    schedule_interval: pulumi.Output[str]
    """
    Execution interval. 60 seconds minimum, such as 60s, 1h.
    """
    schedule_type: pulumi.Output[str]
    """
    Default FixedRate. No need to configure this parameter.
    """
    throttling: pulumi.Output[str]
    """
    Notification interval, default is no interval. Support number + unit type, for example 60s, 1h.
    """
    def __init__(__self__, resource_name, opts=None, alert_description=None, alert_displayname=None, alert_name=None, condition=None, dashboard=None, mute_until=None, notification_lists=None, notify_threshold=None, project_name=None, query_lists=None, schedule_interval=None, schedule_type=None, throttling=None, __props__=None, __name__=None, __opts__=None):
        """
        Log alert is a unit of log service, which is used to monitor and alert the user's logstore status information. 
        Log Service enables you to configure alerts based on the charts in a dashboard to monitor the service status in real time.

        > **NOTE:** Available in 1.78.0

        > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/r/log_alert.html.markdown.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] alert_description: Alert description.
        :param pulumi.Input[str] alert_displayname: Alert displayname.
        :param pulumi.Input[str] alert_name: Name of logstore for configuring alarm service.
        :param pulumi.Input[str] condition: Conditional expression, such as: count> 100.
        :param pulumi.Input[float] mute_until: Timestamp, notifications before closing again.
        :param pulumi.Input[list] notification_lists: Alarm information notification list.
        :param pulumi.Input[float] notify_threshold: Notification threshold, which is not notified until the number of triggers is reached. The default is 1.
        :param pulumi.Input[str] project_name: The project name.
        :param pulumi.Input[list] query_lists: Multiple conditions for configured alarm query.
        :param pulumi.Input[str] schedule_interval: Execution interval. 60 seconds minimum, such as 60s, 1h.
        :param pulumi.Input[str] schedule_type: Default FixedRate. No need to configure this parameter.
        :param pulumi.Input[str] throttling: Notification interval, default is no interval. Support number + unit type, for example 60s, 1h.

        The **notification_lists** object supports the following:

          * `content` (`pulumi.Input[str]`) - Notice content of alarm.
          * `emailLists` (`pulumi.Input[list]`) - Email address list.   
          * `mobileLists` (`pulumi.Input[list]`) - SMS sending mobile number.
          * `serviceUri` (`pulumi.Input[str]`) - Request address.
          * `type` (`pulumi.Input[str]`) - Notification type. support Email, SMS, DingTalk.

        The **query_lists** object supports the following:

          * `chartTitle` (`pulumi.Input[str]`) - chart title
          * `end` (`pulumi.Input[str]`) - end time. example: 20s.
          * `logstore` (`pulumi.Input[str]`) - Query logstore
          * `query` (`pulumi.Input[str]`) - query corresponding to chart. example: * AND aliyun.
          * `start` (`pulumi.Input[str]`) - begin time. example: -60s.
          * `timeSpanType` (`pulumi.Input[str]`) - default Custom. No need to configure this parameter.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            __props__['alert_description'] = alert_description
            if alert_displayname is None:
                raise TypeError("Missing required property 'alert_displayname'")
            __props__['alert_displayname'] = alert_displayname
            if alert_name is None:
                raise TypeError("Missing required property 'alert_name'")
            __props__['alert_name'] = alert_name
            if condition is None:
                raise TypeError("Missing required property 'condition'")
            __props__['condition'] = condition
            if dashboard is None:
                raise TypeError("Missing required property 'dashboard'")
            __props__['dashboard'] = dashboard
            __props__['mute_until'] = mute_until
            if notification_lists is None:
                raise TypeError("Missing required property 'notification_lists'")
            __props__['notification_lists'] = notification_lists
            __props__['notify_threshold'] = notify_threshold
            if project_name is None:
                raise TypeError("Missing required property 'project_name'")
            __props__['project_name'] = project_name
            if query_lists is None:
                raise TypeError("Missing required property 'query_lists'")
            __props__['query_lists'] = query_lists
            __props__['schedule_interval'] = schedule_interval
            __props__['schedule_type'] = schedule_type
            __props__['throttling'] = throttling
        super(Alert, __self__).__init__(
            'alicloud:log/alert:Alert',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, alert_description=None, alert_displayname=None, alert_name=None, condition=None, dashboard=None, mute_until=None, notification_lists=None, notify_threshold=None, project_name=None, query_lists=None, schedule_interval=None, schedule_type=None, throttling=None):
        """
        Get an existing Alert resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] alert_description: Alert description.
        :param pulumi.Input[str] alert_displayname: Alert displayname.
        :param pulumi.Input[str] alert_name: Name of logstore for configuring alarm service.
        :param pulumi.Input[str] condition: Conditional expression, such as: count> 100.
        :param pulumi.Input[float] mute_until: Timestamp, notifications before closing again.
        :param pulumi.Input[list] notification_lists: Alarm information notification list.
        :param pulumi.Input[float] notify_threshold: Notification threshold, which is not notified until the number of triggers is reached. The default is 1.
        :param pulumi.Input[str] project_name: The project name.
        :param pulumi.Input[list] query_lists: Multiple conditions for configured alarm query.
        :param pulumi.Input[str] schedule_interval: Execution interval. 60 seconds minimum, such as 60s, 1h.
        :param pulumi.Input[str] schedule_type: Default FixedRate. No need to configure this parameter.
        :param pulumi.Input[str] throttling: Notification interval, default is no interval. Support number + unit type, for example 60s, 1h.

        The **notification_lists** object supports the following:

          * `content` (`pulumi.Input[str]`) - Notice content of alarm.
          * `emailLists` (`pulumi.Input[list]`) - Email address list.   
          * `mobileLists` (`pulumi.Input[list]`) - SMS sending mobile number.
          * `serviceUri` (`pulumi.Input[str]`) - Request address.
          * `type` (`pulumi.Input[str]`) - Notification type. support Email, SMS, DingTalk.

        The **query_lists** object supports the following:

          * `chartTitle` (`pulumi.Input[str]`) - chart title
          * `end` (`pulumi.Input[str]`) - end time. example: 20s.
          * `logstore` (`pulumi.Input[str]`) - Query logstore
          * `query` (`pulumi.Input[str]`) - query corresponding to chart. example: * AND aliyun.
          * `start` (`pulumi.Input[str]`) - begin time. example: -60s.
          * `timeSpanType` (`pulumi.Input[str]`) - default Custom. No need to configure this parameter.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["alert_description"] = alert_description
        __props__["alert_displayname"] = alert_displayname
        __props__["alert_name"] = alert_name
        __props__["condition"] = condition
        __props__["dashboard"] = dashboard
        __props__["mute_until"] = mute_until
        __props__["notification_lists"] = notification_lists
        __props__["notify_threshold"] = notify_threshold
        __props__["project_name"] = project_name
        __props__["query_lists"] = query_lists
        __props__["schedule_interval"] = schedule_interval
        __props__["schedule_type"] = schedule_type
        __props__["throttling"] = throttling
        return Alert(resource_name, opts=opts, __props__=__props__)
    def translate_output_property(self, prop):
        return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

