# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities

__all__ = [
    'GetDerivedMetricResult',
    'AwaitableGetDerivedMetricResult',
    'get_derived_metric',
    'get_derived_metric_output',
]

@pulumi.output_type
class GetDerivedMetricResult:
    """
    A collection of values returned by getDerivedMetric.
    """
    def __init__(__self__, additional_information=None, create_user_id=None, created_epoch_millis=None, deleted=None, hosts_useds=None, id=None, in_trash=None, include_obsolete_metrics=None, last_error_message=None, last_failed_time=None, last_processed_millis=None, last_query_time=None, metrics_useds=None, minutes=None, name=None, points_scanned_at_last_query=None, process_rate_minutes=None, query=None, query_failing=None, query_qb_enabled=None, statuses=None, tags=None, update_user_id=None, updated_epoch_millis=None):
        if additional_information and not isinstance(additional_information, str):
            raise TypeError("Expected argument 'additional_information' to be a str")
        pulumi.set(__self__, "additional_information", additional_information)
        if create_user_id and not isinstance(create_user_id, str):
            raise TypeError("Expected argument 'create_user_id' to be a str")
        pulumi.set(__self__, "create_user_id", create_user_id)
        if created_epoch_millis and not isinstance(created_epoch_millis, int):
            raise TypeError("Expected argument 'created_epoch_millis' to be a int")
        pulumi.set(__self__, "created_epoch_millis", created_epoch_millis)
        if deleted and not isinstance(deleted, bool):
            raise TypeError("Expected argument 'deleted' to be a bool")
        pulumi.set(__self__, "deleted", deleted)
        if hosts_useds and not isinstance(hosts_useds, list):
            raise TypeError("Expected argument 'hosts_useds' to be a list")
        pulumi.set(__self__, "hosts_useds", hosts_useds)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if in_trash and not isinstance(in_trash, bool):
            raise TypeError("Expected argument 'in_trash' to be a bool")
        pulumi.set(__self__, "in_trash", in_trash)
        if include_obsolete_metrics and not isinstance(include_obsolete_metrics, bool):
            raise TypeError("Expected argument 'include_obsolete_metrics' to be a bool")
        pulumi.set(__self__, "include_obsolete_metrics", include_obsolete_metrics)
        if last_error_message and not isinstance(last_error_message, str):
            raise TypeError("Expected argument 'last_error_message' to be a str")
        pulumi.set(__self__, "last_error_message", last_error_message)
        if last_failed_time and not isinstance(last_failed_time, int):
            raise TypeError("Expected argument 'last_failed_time' to be a int")
        pulumi.set(__self__, "last_failed_time", last_failed_time)
        if last_processed_millis and not isinstance(last_processed_millis, int):
            raise TypeError("Expected argument 'last_processed_millis' to be a int")
        pulumi.set(__self__, "last_processed_millis", last_processed_millis)
        if last_query_time and not isinstance(last_query_time, int):
            raise TypeError("Expected argument 'last_query_time' to be a int")
        pulumi.set(__self__, "last_query_time", last_query_time)
        if metrics_useds and not isinstance(metrics_useds, list):
            raise TypeError("Expected argument 'metrics_useds' to be a list")
        pulumi.set(__self__, "metrics_useds", metrics_useds)
        if minutes and not isinstance(minutes, int):
            raise TypeError("Expected argument 'minutes' to be a int")
        pulumi.set(__self__, "minutes", minutes)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if points_scanned_at_last_query and not isinstance(points_scanned_at_last_query, int):
            raise TypeError("Expected argument 'points_scanned_at_last_query' to be a int")
        pulumi.set(__self__, "points_scanned_at_last_query", points_scanned_at_last_query)
        if process_rate_minutes and not isinstance(process_rate_minutes, int):
            raise TypeError("Expected argument 'process_rate_minutes' to be a int")
        pulumi.set(__self__, "process_rate_minutes", process_rate_minutes)
        if query and not isinstance(query, str):
            raise TypeError("Expected argument 'query' to be a str")
        pulumi.set(__self__, "query", query)
        if query_failing and not isinstance(query_failing, bool):
            raise TypeError("Expected argument 'query_failing' to be a bool")
        pulumi.set(__self__, "query_failing", query_failing)
        if query_qb_enabled and not isinstance(query_qb_enabled, bool):
            raise TypeError("Expected argument 'query_qb_enabled' to be a bool")
        pulumi.set(__self__, "query_qb_enabled", query_qb_enabled)
        if statuses and not isinstance(statuses, list):
            raise TypeError("Expected argument 'statuses' to be a list")
        pulumi.set(__self__, "statuses", statuses)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if update_user_id and not isinstance(update_user_id, str):
            raise TypeError("Expected argument 'update_user_id' to be a str")
        pulumi.set(__self__, "update_user_id", update_user_id)
        if updated_epoch_millis and not isinstance(updated_epoch_millis, int):
            raise TypeError("Expected argument 'updated_epoch_millis' to be a int")
        pulumi.set(__self__, "updated_epoch_millis", updated_epoch_millis)

    @_builtins.property
    @pulumi.getter(name="additionalInformation")
    def additional_information(self) -> _builtins.str:
        """
        User-supplied additional explanatory information about the derived metric.
        """
        return pulumi.get(self, "additional_information")

    @_builtins.property
    @pulumi.getter(name="createUserId")
    def create_user_id(self) -> _builtins.str:
        """
        The ID of the user who created the derived metric.
        """
        return pulumi.get(self, "create_user_id")

    @_builtins.property
    @pulumi.getter(name="createdEpochMillis")
    def created_epoch_millis(self) -> _builtins.int:
        """
        The timestamp in epoch milliseconds indicating when the derived metric is created.
        """
        return pulumi.get(self, "created_epoch_millis")

    @_builtins.property
    @pulumi.getter
    def deleted(self) -> _builtins.bool:
        """
        A Boolean flag indicating whether the derived metric is deleted or not.
        """
        return pulumi.get(self, "deleted")

    @_builtins.property
    @pulumi.getter(name="hostsUseds")
    def hosts_useds(self) -> Sequence[_builtins.str]:
        """
        A list of hosts used in the derived metric.
        """
        return pulumi.get(self, "hosts_useds")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        The ID of the derived metric in Wavefront.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter(name="inTrash")
    def in_trash(self) -> _builtins.bool:
        """
        A Boolean variable indicating trash status.
        """
        return pulumi.get(self, "in_trash")

    @_builtins.property
    @pulumi.getter(name="includeObsoleteMetrics")
    def include_obsolete_metrics(self) -> _builtins.bool:
        """
        A Boolean flag indicating whether to include obsolete metrics or not.
        """
        return pulumi.get(self, "include_obsolete_metrics")

    @_builtins.property
    @pulumi.getter(name="lastErrorMessage")
    def last_error_message(self) -> _builtins.str:
        """
        Last error message occurred.
        """
        return pulumi.get(self, "last_error_message")

    @_builtins.property
    @pulumi.getter(name="lastFailedTime")
    def last_failed_time(self) -> _builtins.int:
        """
        Timestamp of the last failed derived metric.
        """
        return pulumi.get(self, "last_failed_time")

    @_builtins.property
    @pulumi.getter(name="lastProcessedMillis")
    def last_processed_millis(self) -> _builtins.int:
        """
        The last processed timestamp.
        """
        return pulumi.get(self, "last_processed_millis")

    @_builtins.property
    @pulumi.getter(name="lastQueryTime")
    def last_query_time(self) -> _builtins.int:
        """
        The timestamp indicating the last time the query was executed.
        """
        return pulumi.get(self, "last_query_time")

    @_builtins.property
    @pulumi.getter(name="metricsUseds")
    def metrics_useds(self) -> Sequence[_builtins.str]:
        """
        A list of metrics used in the derived metric.
        """
        return pulumi.get(self, "metrics_useds")

    @_builtins.property
    @pulumi.getter
    def minutes(self) -> _builtins.int:
        """
        How frequently the query generating the derived metric is run.
        """
        return pulumi.get(self, "minutes")

    @_builtins.property
    @pulumi.getter
    def name(self) -> _builtins.str:
        """
        The name of the derived metric in Wavefront.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="pointsScannedAtLastQuery")
    def points_scanned_at_last_query(self) -> _builtins.int:
        """
        The number of points scanned when last query was executed.
        """
        return pulumi.get(self, "points_scanned_at_last_query")

    @_builtins.property
    @pulumi.getter(name="processRateMinutes")
    def process_rate_minutes(self) -> _builtins.int:
        """
        The specified query is executed every `process_rate_minutes` minutes.
        """
        return pulumi.get(self, "process_rate_minutes")

    @_builtins.property
    @pulumi.getter
    def query(self) -> _builtins.str:
        """
        A Wavefront query that is evaluated at regular intervals (default is 1 minute).
        """
        return pulumi.get(self, "query")

    @_builtins.property
    @pulumi.getter(name="queryFailing")
    def query_failing(self) -> _builtins.bool:
        """
        A Boolean variable indicating whether query is failing for the derived metric.
        """
        return pulumi.get(self, "query_failing")

    @_builtins.property
    @pulumi.getter(name="queryQbEnabled")
    def query_qb_enabled(self) -> _builtins.bool:
        """
        A Boolean flag for enabling `query_qb`
        """
        return pulumi.get(self, "query_qb_enabled")

    @_builtins.property
    @pulumi.getter
    def statuses(self) -> Sequence[_builtins.str]:
        """
        The status of the derived metric.
        """
        return pulumi.get(self, "statuses")

    @_builtins.property
    @pulumi.getter
    def tags(self) -> Sequence[_builtins.str]:
        """
        A set of tags assigned to the derived metric.
        """
        return pulumi.get(self, "tags")

    @_builtins.property
    @pulumi.getter(name="updateUserId")
    def update_user_id(self) -> _builtins.str:
        """
        The ID of the user who updated the derived metric.
        """
        return pulumi.get(self, "update_user_id")

    @_builtins.property
    @pulumi.getter(name="updatedEpochMillis")
    def updated_epoch_millis(self) -> _builtins.int:
        """
        The timestamp in epoch milliseconds indicating when the derived metric is updated.
        """
        return pulumi.get(self, "updated_epoch_millis")


class AwaitableGetDerivedMetricResult(GetDerivedMetricResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDerivedMetricResult(
            additional_information=self.additional_information,
            create_user_id=self.create_user_id,
            created_epoch_millis=self.created_epoch_millis,
            deleted=self.deleted,
            hosts_useds=self.hosts_useds,
            id=self.id,
            in_trash=self.in_trash,
            include_obsolete_metrics=self.include_obsolete_metrics,
            last_error_message=self.last_error_message,
            last_failed_time=self.last_failed_time,
            last_processed_millis=self.last_processed_millis,
            last_query_time=self.last_query_time,
            metrics_useds=self.metrics_useds,
            minutes=self.minutes,
            name=self.name,
            points_scanned_at_last_query=self.points_scanned_at_last_query,
            process_rate_minutes=self.process_rate_minutes,
            query=self.query,
            query_failing=self.query_failing,
            query_qb_enabled=self.query_qb_enabled,
            statuses=self.statuses,
            tags=self.tags,
            update_user_id=self.update_user_id,
            updated_epoch_millis=self.updated_epoch_millis)


def get_derived_metric(id: Optional[_builtins.str] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDerivedMetricResult:
    """
    Use this data source to get information about a certain Wavefront derived metric by its ID.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_wavefront as wavefront

    #Get the information about a derived metric.
    example = wavefront.get_derived_metric(id="derived_metric_id")
    ```


    :param _builtins.str id: The ID associated with the derived metric data to be fetched.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('wavefront:index/getDerivedMetric:getDerivedMetric', __args__, opts=opts, typ=GetDerivedMetricResult).value

    return AwaitableGetDerivedMetricResult(
        additional_information=pulumi.get(__ret__, 'additional_information'),
        create_user_id=pulumi.get(__ret__, 'create_user_id'),
        created_epoch_millis=pulumi.get(__ret__, 'created_epoch_millis'),
        deleted=pulumi.get(__ret__, 'deleted'),
        hosts_useds=pulumi.get(__ret__, 'hosts_useds'),
        id=pulumi.get(__ret__, 'id'),
        in_trash=pulumi.get(__ret__, 'in_trash'),
        include_obsolete_metrics=pulumi.get(__ret__, 'include_obsolete_metrics'),
        last_error_message=pulumi.get(__ret__, 'last_error_message'),
        last_failed_time=pulumi.get(__ret__, 'last_failed_time'),
        last_processed_millis=pulumi.get(__ret__, 'last_processed_millis'),
        last_query_time=pulumi.get(__ret__, 'last_query_time'),
        metrics_useds=pulumi.get(__ret__, 'metrics_useds'),
        minutes=pulumi.get(__ret__, 'minutes'),
        name=pulumi.get(__ret__, 'name'),
        points_scanned_at_last_query=pulumi.get(__ret__, 'points_scanned_at_last_query'),
        process_rate_minutes=pulumi.get(__ret__, 'process_rate_minutes'),
        query=pulumi.get(__ret__, 'query'),
        query_failing=pulumi.get(__ret__, 'query_failing'),
        query_qb_enabled=pulumi.get(__ret__, 'query_qb_enabled'),
        statuses=pulumi.get(__ret__, 'statuses'),
        tags=pulumi.get(__ret__, 'tags'),
        update_user_id=pulumi.get(__ret__, 'update_user_id'),
        updated_epoch_millis=pulumi.get(__ret__, 'updated_epoch_millis'))
def get_derived_metric_output(id: Optional[pulumi.Input[_builtins.str]] = None,
                              opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetDerivedMetricResult]:
    """
    Use this data source to get information about a certain Wavefront derived metric by its ID.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_wavefront as wavefront

    #Get the information about a derived metric.
    example = wavefront.get_derived_metric(id="derived_metric_id")
    ```


    :param _builtins.str id: The ID associated with the derived metric data to be fetched.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('wavefront:index/getDerivedMetric:getDerivedMetric', __args__, opts=opts, typ=GetDerivedMetricResult)
    return __ret__.apply(lambda __response__: GetDerivedMetricResult(
        additional_information=pulumi.get(__response__, 'additional_information'),
        create_user_id=pulumi.get(__response__, 'create_user_id'),
        created_epoch_millis=pulumi.get(__response__, 'created_epoch_millis'),
        deleted=pulumi.get(__response__, 'deleted'),
        hosts_useds=pulumi.get(__response__, 'hosts_useds'),
        id=pulumi.get(__response__, 'id'),
        in_trash=pulumi.get(__response__, 'in_trash'),
        include_obsolete_metrics=pulumi.get(__response__, 'include_obsolete_metrics'),
        last_error_message=pulumi.get(__response__, 'last_error_message'),
        last_failed_time=pulumi.get(__response__, 'last_failed_time'),
        last_processed_millis=pulumi.get(__response__, 'last_processed_millis'),
        last_query_time=pulumi.get(__response__, 'last_query_time'),
        metrics_useds=pulumi.get(__response__, 'metrics_useds'),
        minutes=pulumi.get(__response__, 'minutes'),
        name=pulumi.get(__response__, 'name'),
        points_scanned_at_last_query=pulumi.get(__response__, 'points_scanned_at_last_query'),
        process_rate_minutes=pulumi.get(__response__, 'process_rate_minutes'),
        query=pulumi.get(__response__, 'query'),
        query_failing=pulumi.get(__response__, 'query_failing'),
        query_qb_enabled=pulumi.get(__response__, 'query_qb_enabled'),
        statuses=pulumi.get(__response__, 'statuses'),
        tags=pulumi.get(__response__, 'tags'),
        update_user_id=pulumi.get(__response__, 'update_user_id'),
        updated_epoch_millis=pulumi.get(__response__, 'updated_epoch_millis')))
