# 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 builtins
import copy
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
from . import outputs

__all__ = [
    'GetServerGroupResult',
    'AwaitableGetServerGroupResult',
    'get_server_group',
    'get_server_group_output',
]

@pulumi.output_type
class GetServerGroupResult:
    """
    A collection of values returned by getServerGroup.
    """
    def __init__(__self__, address_ip_version=None, any_port_enabled=None, create_time=None, description=None, id=None, listeners=None, load_balancer_id=None, server_group_id=None, server_group_name=None, servers=None, tags=None, type=None, update_time=None):
        if address_ip_version and not isinstance(address_ip_version, str):
            raise TypeError("Expected argument 'address_ip_version' to be a str")
        pulumi.set(__self__, "address_ip_version", address_ip_version)
        if any_port_enabled and not isinstance(any_port_enabled, str):
            raise TypeError("Expected argument 'any_port_enabled' to be a str")
        pulumi.set(__self__, "any_port_enabled", any_port_enabled)
        if create_time and not isinstance(create_time, str):
            raise TypeError("Expected argument 'create_time' to be a str")
        pulumi.set(__self__, "create_time", create_time)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if listeners and not isinstance(listeners, list):
            raise TypeError("Expected argument 'listeners' to be a list")
        pulumi.set(__self__, "listeners", listeners)
        if load_balancer_id and not isinstance(load_balancer_id, str):
            raise TypeError("Expected argument 'load_balancer_id' to be a str")
        pulumi.set(__self__, "load_balancer_id", load_balancer_id)
        if server_group_id and not isinstance(server_group_id, str):
            raise TypeError("Expected argument 'server_group_id' to be a str")
        pulumi.set(__self__, "server_group_id", server_group_id)
        if server_group_name and not isinstance(server_group_name, str):
            raise TypeError("Expected argument 'server_group_name' to be a str")
        pulumi.set(__self__, "server_group_name", server_group_name)
        if servers and not isinstance(servers, list):
            raise TypeError("Expected argument 'servers' to be a list")
        pulumi.set(__self__, "servers", servers)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        pulumi.set(__self__, "type", type)
        if update_time and not isinstance(update_time, str):
            raise TypeError("Expected argument 'update_time' to be a str")
        pulumi.set(__self__, "update_time", update_time)

    @property
    @pulumi.getter(name="addressIpVersion")
    def address_ip_version(self) -> builtins.str:
        """
        后端服务器组的IP地址类型。ipv4：后端服务器组为IPv4类型。ipv6：后端服务器组为IPv6类型。
        """
        return pulumi.get(self, "address_ip_version")

    @property
    @pulumi.getter(name="anyPortEnabled")
    def any_port_enabled(self) -> builtins.str:
        """
        是否开启全端口转发。on：开启全端口转发。off：关闭全端口转发。
        """
        return pulumi.get(self, "any_port_enabled")

    @property
    @pulumi.getter(name="createTime")
    def create_time(self) -> builtins.str:
        """
        后端服务器组的创建时间。
        """
        return pulumi.get(self, "create_time")

    @property
    @pulumi.getter
    def description(self) -> builtins.str:
        """
        后端服务器组的描述。必须以字母、数字或中文开头，可包含字母、数字、中文及以下特殊字符：英文逗号（,）、点号（.）、下划线（_）、空格（ ）、等号（=）、中划线（-）、中文逗号（，）、中文句号（。）。长度限制为0 ～ 255个符。不填则默认为空字符串。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def listeners(self) -> Sequence['outputs.GetServerGroupListenerResult']:
        """
        后端服务器组关联的监听器信息。
        """
        return pulumi.get(self, "listeners")

    @property
    @pulumi.getter(name="loadBalancerId")
    def load_balancer_id(self) -> builtins.str:
        """
        后端服务器组所属的CLB实例ID。
        """
        return pulumi.get(self, "load_balancer_id")

    @property
    @pulumi.getter(name="serverGroupId")
    def server_group_id(self) -> builtins.str:
        """
        后端服务器组的ID。
        """
        return pulumi.get(self, "server_group_id")

    @property
    @pulumi.getter(name="serverGroupName")
    def server_group_name(self) -> builtins.str:
        """
        后端服务器组的名称。必须以字母、数字或中文开头，可包含字母、数字、中文及以下特殊字符：点号（.）、下划线（_）和中划线（-）。限制为1 ～ 128个字符。不填默认为后端服务器组ID。
        """
        return pulumi.get(self, "server_group_name")

    @property
    @pulumi.getter
    def servers(self) -> Sequence['outputs.GetServerGroupServerResult']:
        """
        后端服务器组中服务器的信息。
        """
        return pulumi.get(self, "servers")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetServerGroupTagResult']:
        """
        标签信息。
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter
    def type(self) -> builtins.str:
        """
        后端服务器组的类型。instance：表示该后端服务器组只能添加云服务器的主网卡或辅助网卡作为后端服务器。ip：表示该后端服务器组只能添加IP地址作为后端服务器。
        """
        return pulumi.get(self, "type")

    @property
    @pulumi.getter(name="updateTime")
    def update_time(self) -> builtins.str:
        """
        后端服务器组的最近操作时间。
        """
        return pulumi.get(self, "update_time")


class AwaitableGetServerGroupResult(GetServerGroupResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetServerGroupResult(
            address_ip_version=self.address_ip_version,
            any_port_enabled=self.any_port_enabled,
            create_time=self.create_time,
            description=self.description,
            id=self.id,
            listeners=self.listeners,
            load_balancer_id=self.load_balancer_id,
            server_group_id=self.server_group_id,
            server_group_name=self.server_group_name,
            servers=self.servers,
            tags=self.tags,
            type=self.type,
            update_time=self.update_time)


def get_server_group(id: Optional[builtins.str] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServerGroupResult:
    """
    Data Source schema for Byteplus::CLB::ServerGroup


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:clb/getServerGroup:getServerGroup', __args__, opts=opts, typ=GetServerGroupResult).value

    return AwaitableGetServerGroupResult(
        address_ip_version=pulumi.get(__ret__, 'address_ip_version'),
        any_port_enabled=pulumi.get(__ret__, 'any_port_enabled'),
        create_time=pulumi.get(__ret__, 'create_time'),
        description=pulumi.get(__ret__, 'description'),
        id=pulumi.get(__ret__, 'id'),
        listeners=pulumi.get(__ret__, 'listeners'),
        load_balancer_id=pulumi.get(__ret__, 'load_balancer_id'),
        server_group_id=pulumi.get(__ret__, 'server_group_id'),
        server_group_name=pulumi.get(__ret__, 'server_group_name'),
        servers=pulumi.get(__ret__, 'servers'),
        tags=pulumi.get(__ret__, 'tags'),
        type=pulumi.get(__ret__, 'type'),
        update_time=pulumi.get(__ret__, 'update_time'))
def get_server_group_output(id: Optional[pulumi.Input[builtins.str]] = None,
                            opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetServerGroupResult]:
    """
    Data Source schema for Byteplus::CLB::ServerGroup


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:clb/getServerGroup:getServerGroup', __args__, opts=opts, typ=GetServerGroupResult)
    return __ret__.apply(lambda __response__: GetServerGroupResult(
        address_ip_version=pulumi.get(__response__, 'address_ip_version'),
        any_port_enabled=pulumi.get(__response__, 'any_port_enabled'),
        create_time=pulumi.get(__response__, 'create_time'),
        description=pulumi.get(__response__, 'description'),
        id=pulumi.get(__response__, 'id'),
        listeners=pulumi.get(__response__, 'listeners'),
        load_balancer_id=pulumi.get(__response__, 'load_balancer_id'),
        server_group_id=pulumi.get(__response__, 'server_group_id'),
        server_group_name=pulumi.get(__response__, 'server_group_name'),
        servers=pulumi.get(__response__, 'servers'),
        tags=pulumi.get(__response__, 'tags'),
        type=pulumi.get(__response__, 'type'),
        update_time=pulumi.get(__response__, 'update_time')))
