<reponame>Dwonczykj/gember_deploy<filename>sdk/dotnet/Tencentcloud/Clb/GetListenerRules.cs// *** 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.Clb
{
    public static class GetListenerRules
    {
        /// <summary>
        /// Use this data source to query detailed information of CLB listener rule
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var foo = Output.Create(Tencentcloud.Clb.GetListenerRules.InvokeAsync(new Tencentcloud.Clb.GetListenerRulesArgs
        ///         {
        ///             ClbId = "lb-k2zjp9lv",
        ///             Domain = "abc.com",
        ///             ListenerId = "lbl-mwr6vbtv",
        ///             RuleId = "loc-inem40hz",
        ///             Scheduler = "WRR",
        ///             Url = "/",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetListenerRulesResult> InvokeAsync(GetListenerRulesArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetListenerRulesResult>("tencentcloud:Clb/getListenerRules:getListenerRules", args ?? new GetListenerRulesArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query detailed information of CLB listener rule
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var foo = Output.Create(Tencentcloud.Clb.GetListenerRules.InvokeAsync(new Tencentcloud.Clb.GetListenerRulesArgs
        ///         {
        ///             ClbId = "lb-k2zjp9lv",
        ///             Domain = "abc.com",
        ///             ListenerId = "lbl-mwr6vbtv",
        ///             RuleId = "loc-inem40hz",
        ///             Scheduler = "WRR",
        ///             Url = "/",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetListenerRulesResult> Invoke(GetListenerRulesInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetListenerRulesResult>("tencentcloud:Clb/getListenerRules:getListenerRules", args ?? new GetListenerRulesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetListenerRulesArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// ID of the CLB to be queried.
        /// </summary>
        [Input("clbId", required: true)]
        public string ClbId { get; set; } = null!;

        /// <summary>
        /// Domain name of the forwarding rule to be queried.
        /// </summary>
        [Input("domain")]
        public string? Domain { get; set; }

        /// <summary>
        /// ID of the CLB listener to be queried.
        /// </summary>
        [Input("listenerId", required: true)]
        public string ListenerId { get; set; } = null!;

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

        /// <summary>
        /// ID of the forwarding rule to be queried.
        /// </summary>
        [Input("ruleId")]
        public string? RuleId { get; set; }

        /// <summary>
        /// Scheduling method of the forwarding rule of thr CLB listener, and available values include `WRR`, `IP HASH` and `LEAST_CONN`. The default is `WRR`.
        /// </summary>
        [Input("scheduler")]
        public string? Scheduler { get; set; }

        /// <summary>
        /// Url of the forwarding rule to be queried.
        /// </summary>
        [Input("url")]
        public string? Url { get; set; }

        public GetListenerRulesArgs()
        {
        }
    }

    public sealed class GetListenerRulesInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// ID of the CLB to be queried.
        /// </summary>
        [Input("clbId", required: true)]
        public Input<string> ClbId { get; set; } = null!;

        /// <summary>
        /// Domain name of the forwarding rule to be queried.
        /// </summary>
        [Input("domain")]
        public Input<string>? Domain { get; set; }

        /// <summary>
        /// ID of the CLB listener to be queried.
        /// </summary>
        [Input("listenerId", required: true)]
        public Input<string> ListenerId { get; set; } = null!;

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

        /// <summary>
        /// ID of the forwarding rule to be queried.
        /// </summary>
        [Input("ruleId")]
        public Input<string>? RuleId { get; set; }

        /// <summary>
        /// Scheduling method of the forwarding rule of thr CLB listener, and available values include `WRR`, `IP HASH` and `LEAST_CONN`. The default is `WRR`.
        /// </summary>
        [Input("scheduler")]
        public Input<string>? Scheduler { get; set; }

        /// <summary>
        /// Url of the forwarding rule to be queried.
        /// </summary>
        [Input("url")]
        public Input<string>? Url { get; set; }

        public GetListenerRulesInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetListenerRulesResult
    {
        /// <summary>
        /// ID of the CLB.
        /// </summary>
        public readonly string ClbId;
        public readonly string? Domain;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// ID of the listener.
        /// </summary>
        public readonly string ListenerId;
        public readonly string? ResultOutputFile;
        /// <summary>
        /// ID of the rule.
        /// </summary>
        public readonly string? RuleId;
        /// <summary>
        /// A list of forward rules of listeners. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetListenerRulesRuleListResult> RuleLists;
        /// <summary>
        /// Scheduling method of the CLB listener, and available values include 'WRR', 'IP_HASH' and 'LEAST_CONN'. The default is 'WRR'. NOTES: TCP/UDP/TCP_SSL listener allows direct configuration, HTTP/HTTPS listener needs to be configured in tencentcloud_clb_listener_rule.
        /// </summary>
        public readonly string? Scheduler;
        public readonly string? Url;

        [OutputConstructor]
        private GetListenerRulesResult(
            string clbId,

            string? domain,

            string id,

            string listenerId,

            string? resultOutputFile,

            string? ruleId,

            ImmutableArray<Outputs.GetListenerRulesRuleListResult> ruleLists,

            string? scheduler,

            string? url)
        {
            ClbId = clbId;
            Domain = domain;
            Id = id;
            ListenerId = listenerId;
            ResultOutputFile = resultOutputFile;
            RuleId = ruleId;
            RuleLists = ruleLists;
            Scheduler = scheduler;
            Url = url;
        }
    }
}
