<reponame>Dwonczykj/gember_deploy// *** 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! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Monitor
{
    public static class GetData
    {
        /// <summary>
        /// Use this data source to query monitor data. for complex queries, use (https://github.com/tencentyun/tencentcloud-exporter)
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var instances = Output.Create(Tencentcloud.Instances.GetInstance.InvokeAsync());
        ///         var cvmMonitorData = instances.Apply(instances =&gt; Output.Create(Tencentcloud.Monitor.GetData.InvokeAsync(new Tencentcloud.Monitor.GetDataArgs
        ///         {
        ///             Namespace = "QCE/CVM",
        ///             MetricName = "CPUUsage",
        ///             Dimensions = 
        ///             {
        ///                 new Tencentcloud.Monitor.Inputs.GetDataDimensionArgs
        ///                 {
        ///                     Name = "InstanceId",
        ///                     Value = instances.InstanceLists?[0]?.InstanceId,
        ///                 },
        ///             },
        ///             Period = 300,
        ///             StartTime = "2020-04-28T18:45:00+08:00",
        ///             EndTime = "2020-04-28T19:00:00+08:00",
        ///         })));
        ///         var cosMonitorData = Output.Create(Tencentcloud.Monitor.GetData.InvokeAsync(new Tencentcloud.Monitor.GetDataArgs
        ///         {
        ///             Namespace = "QCE/COS",
        ///             MetricName = "InternetTraffic",
        ///             Dimensions = 
        ///             {
        ///                 new Tencentcloud.Monitor.Inputs.GetDataDimensionArgs
        ///                 {
        ///                     Name = "appid",
        ///                     Value = "1258798060",
        ///                 },
        ///                 new Tencentcloud.Monitor.Inputs.GetDataDimensionArgs
        ///                 {
        ///                     Name = "bucket",
        ///                     Value = "test-1258798060",
        ///                 },
        ///             },
        ///             Period = 300,
        ///             StartTime = "2020-04-28T18:30:00+08:00",
        ///             EndTime = "2020-04-28T19:00:00+08:00",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetDataResult> InvokeAsync(GetDataArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetDataResult>("tencentcloud:Monitor/getData:getData", args ?? new GetDataArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query monitor data. for complex queries, use (https://github.com/tencentyun/tencentcloud-exporter)
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var instances = Output.Create(Tencentcloud.Instances.GetInstance.InvokeAsync());
        ///         var cvmMonitorData = instances.Apply(instances =&gt; Output.Create(Tencentcloud.Monitor.GetData.InvokeAsync(new Tencentcloud.Monitor.GetDataArgs
        ///         {
        ///             Namespace = "QCE/CVM",
        ///             MetricName = "CPUUsage",
        ///             Dimensions = 
        ///             {
        ///                 new Tencentcloud.Monitor.Inputs.GetDataDimensionArgs
        ///                 {
        ///                     Name = "InstanceId",
        ///                     Value = instances.InstanceLists?[0]?.InstanceId,
        ///                 },
        ///             },
        ///             Period = 300,
        ///             StartTime = "2020-04-28T18:45:00+08:00",
        ///             EndTime = "2020-04-28T19:00:00+08:00",
        ///         })));
        ///         var cosMonitorData = Output.Create(Tencentcloud.Monitor.GetData.InvokeAsync(new Tencentcloud.Monitor.GetDataArgs
        ///         {
        ///             Namespace = "QCE/COS",
        ///             MetricName = "InternetTraffic",
        ///             Dimensions = 
        ///             {
        ///                 new Tencentcloud.Monitor.Inputs.GetDataDimensionArgs
        ///                 {
        ///                     Name = "appid",
        ///                     Value = "1258798060",
        ///                 },
        ///                 new Tencentcloud.Monitor.Inputs.GetDataDimensionArgs
        ///                 {
        ///                     Name = "bucket",
        ///                     Value = "test-1258798060",
        ///                 },
        ///             },
        ///             Period = 300,
        ///             StartTime = "2020-04-28T18:30:00+08:00",
        ///             EndTime = "2020-04-28T19:00:00+08:00",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetDataResult> Invoke(GetDataInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetDataResult>("tencentcloud:Monitor/getData:getData", args ?? new GetDataInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetDataArgs : Pulumi.InvokeArgs
    {
        [Input("dimensions", required: true)]
        private List<Inputs.GetDataDimensionArgs>? _dimensions;

        /// <summary>
        /// Dimensional composition of instance objects.
        /// </summary>
        public List<Inputs.GetDataDimensionArgs> Dimensions
        {
            get => _dimensions ?? (_dimensions = new List<Inputs.GetDataDimensionArgs>());
            set => _dimensions = value;
        }

        /// <summary>
        /// End time for this query, eg:`2018-09-22T20:00:00+08:00`.
        /// </summary>
        [Input("endTime", required: true)]
        public string EndTime { get; set; } = null!;

        /// <summary>
        /// Metric name, please refer to the documentation of monitor interface of each product.
        /// </summary>
        [Input("metricName", required: true)]
        public string MetricName { get; set; } = null!;

        /// <summary>
        /// Namespace of each cloud product in monitor system, refer to `data.tencentcloud_monitor_product_namespace`.
        /// </summary>
        [Input("namespace", required: true)]
        public string Namespace { get; set; } = null!;

        /// <summary>
        /// Statistical period.
        /// </summary>
        [Input("period")]
        public int? Period { get; set; }

        /// <summary>
        /// Used to store results.
        /// </summary>
        [Input("resultOutputFile")]
        public string? ResultOutputFile { get; set; }

        /// <summary>
        /// Start time for this query, eg:`2018-09-22T19:51:23+08:00`.
        /// </summary>
        [Input("startTime", required: true)]
        public string StartTime { get; set; } = null!;

        public GetDataArgs()
        {
        }
    }

    public sealed class GetDataInvokeArgs : Pulumi.InvokeArgs
    {
        [Input("dimensions", required: true)]
        private InputList<Inputs.GetDataDimensionInputArgs>? _dimensions;

        /// <summary>
        /// Dimensional composition of instance objects.
        /// </summary>
        public InputList<Inputs.GetDataDimensionInputArgs> Dimensions
        {
            get => _dimensions ?? (_dimensions = new InputList<Inputs.GetDataDimensionInputArgs>());
            set => _dimensions = value;
        }

        /// <summary>
        /// End time for this query, eg:`2018-09-22T20:00:00+08:00`.
        /// </summary>
        [Input("endTime", required: true)]
        public Input<string> EndTime { get; set; } = null!;

        /// <summary>
        /// Metric name, please refer to the documentation of monitor interface of each product.
        /// </summary>
        [Input("metricName", required: true)]
        public Input<string> MetricName { get; set; } = null!;

        /// <summary>
        /// Namespace of each cloud product in monitor system, refer to `data.tencentcloud_monitor_product_namespace`.
        /// </summary>
        [Input("namespace", required: true)]
        public Input<string> Namespace { get; set; } = null!;

        /// <summary>
        /// Statistical period.
        /// </summary>
        [Input("period")]
        public Input<int>? Period { get; set; }

        /// <summary>
        /// Used to store results.
        /// </summary>
        [Input("resultOutputFile")]
        public Input<string>? ResultOutputFile { get; set; }

        /// <summary>
        /// Start time for this query, eg:`2018-09-22T19:51:23+08:00`.
        /// </summary>
        [Input("startTime", required: true)]
        public Input<string> StartTime { get; set; } = null!;

        public GetDataInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetDataResult
    {
        public readonly ImmutableArray<Outputs.GetDataDimensionResult> Dimensions;
        public readonly string EndTime;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// A list data point. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetDataListResult> Lists;
        public readonly string MetricName;
        public readonly string Namespace;
        public readonly int? Period;
        public readonly string? ResultOutputFile;
        public readonly string StartTime;

        [OutputConstructor]
        private GetDataResult(
            ImmutableArray<Outputs.GetDataDimensionResult> dimensions,

            string endTime,

            string id,

            ImmutableArray<Outputs.GetDataListResult> lists,

            string metricName,

            string @namespace,

            int? period,

            string? resultOutputFile,

            string startTime)
        {
            Dimensions = dimensions;
            EndTime = endTime;
            Id = id;
            Lists = lists;
            MetricName = metricName;
            Namespace = @namespace;
            Period = period;
            ResultOutputFile = resultOutputFile;
            StartTime = startTime;
        }
    }
}
