# 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__, create_time=None, description=None, health_check=None, id=None, ip_address_type=None, listeners=None, project_name=None, protocol=None, scheduler=None, server_count=None, server_group_id=None, server_group_name=None, server_group_type=None, servers=None, status=None, sticky_session_config=None, tags=None, update_time=None, vpc_id=None):
        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 health_check and not isinstance(health_check, dict):
            raise TypeError("Expected argument 'health_check' to be a dict")
        pulumi.set(__self__, "health_check", health_check)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ip_address_type and not isinstance(ip_address_type, str):
            raise TypeError("Expected argument 'ip_address_type' to be a str")
        pulumi.set(__self__, "ip_address_type", ip_address_type)
        if listeners and not isinstance(listeners, list):
            raise TypeError("Expected argument 'listeners' to be a list")
        pulumi.set(__self__, "listeners", listeners)
        if project_name and not isinstance(project_name, str):
            raise TypeError("Expected argument 'project_name' to be a str")
        pulumi.set(__self__, "project_name", project_name)
        if protocol and not isinstance(protocol, str):
            raise TypeError("Expected argument 'protocol' to be a str")
        pulumi.set(__self__, "protocol", protocol)
        if scheduler and not isinstance(scheduler, str):
            raise TypeError("Expected argument 'scheduler' to be a str")
        pulumi.set(__self__, "scheduler", scheduler)
        if server_count and not isinstance(server_count, int):
            raise TypeError("Expected argument 'server_count' to be a int")
        pulumi.set(__self__, "server_count", server_count)
        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 server_group_type and not isinstance(server_group_type, str):
            raise TypeError("Expected argument 'server_group_type' to be a str")
        pulumi.set(__self__, "server_group_type", server_group_type)
        if servers and not isinstance(servers, list):
            raise TypeError("Expected argument 'servers' to be a list")
        pulumi.set(__self__, "servers", servers)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if sticky_session_config and not isinstance(sticky_session_config, dict):
            raise TypeError("Expected argument 'sticky_session_config' to be a dict")
        pulumi.set(__self__, "sticky_session_config", sticky_session_config)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        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)
        if vpc_id and not isinstance(vpc_id, str):
            raise TypeError("Expected argument 'vpc_id' to be a str")
        pulumi.set(__self__, "vpc_id", vpc_id)

    @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:
        """
        后端服务器组的描述。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="healthCheck")
    def health_check(self) -> 'outputs.GetServerGroupHealthCheckResult':
        """
        服务器组健康检查配置信息。
        """
        return pulumi.get(self, "health_check")

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

    @property
    @pulumi.getter(name="ipAddressType")
    def ip_address_type(self) -> builtins.str:
        """
        服务器组的IP地址类型。目前只支持 IPv4
        """
        return pulumi.get(self, "ip_address_type")

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

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        """
        后端服务器组所属项目名称。
        """
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter
    def protocol(self) -> builtins.str:
        """
        后端协议：HTTP，HTTPS。
        """
        return pulumi.get(self, "protocol")

    @property
    @pulumi.getter
    def scheduler(self) -> builtins.str:
        """
        调度算法。取值：wrr：加权轮询。wlc：加权最小连接数。sh：源地址哈希。
        """
        return pulumi.get(self, "scheduler")

    @property
    @pulumi.getter(name="serverCount")
    def server_count(self) -> builtins.int:
        """
        服务器组内后端服务器的个数。
        """
        return pulumi.get(self, "server_count")

    @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:
        """
        后端服务器组的名称。
        """
        return pulumi.get(self, "server_group_name")

    @property
    @pulumi.getter(name="serverGroupType")
    def server_group_type(self) -> builtins.str:
        """
        后端服务器组的类型。instance：服务器类型，该类型服务器组支持添加 ecs、eni 实例作为后端服务器。ip：IP类型，该类型服务器组支持添加 IP 地址作为后端服务器。
        """
        return pulumi.get(self, "server_group_type")

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

    @property
    @pulumi.getter
    def status(self) -> builtins.str:
        """
        服务器组状态。Creating：创建中。Active：运行中。Configuring：配置中。Deleting：删除中。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter(name="stickySessionConfig")
    def sticky_session_config(self) -> 'outputs.GetServerGroupStickySessionConfigResult':
        """
        会话保持功能的参数信息。
        """
        return pulumi.get(self, "sticky_session_config")

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

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

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


class AwaitableGetServerGroupResult(GetServerGroupResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetServerGroupResult(
            create_time=self.create_time,
            description=self.description,
            health_check=self.health_check,
            id=self.id,
            ip_address_type=self.ip_address_type,
            listeners=self.listeners,
            project_name=self.project_name,
            protocol=self.protocol,
            scheduler=self.scheduler,
            server_count=self.server_count,
            server_group_id=self.server_group_id,
            server_group_name=self.server_group_name,
            server_group_type=self.server_group_type,
            servers=self.servers,
            status=self.status,
            sticky_session_config=self.sticky_session_config,
            tags=self.tags,
            update_time=self.update_time,
            vpc_id=self.vpc_id)


def get_server_group(id: Optional[builtins.str] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServerGroupResult:
    """
    Data Source schema for Byteplus::ALB::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:alb/getServerGroup:getServerGroup', __args__, opts=opts, typ=GetServerGroupResult).value

    return AwaitableGetServerGroupResult(
        create_time=pulumi.get(__ret__, 'create_time'),
        description=pulumi.get(__ret__, 'description'),
        health_check=pulumi.get(__ret__, 'health_check'),
        id=pulumi.get(__ret__, 'id'),
        ip_address_type=pulumi.get(__ret__, 'ip_address_type'),
        listeners=pulumi.get(__ret__, 'listeners'),
        project_name=pulumi.get(__ret__, 'project_name'),
        protocol=pulumi.get(__ret__, 'protocol'),
        scheduler=pulumi.get(__ret__, 'scheduler'),
        server_count=pulumi.get(__ret__, 'server_count'),
        server_group_id=pulumi.get(__ret__, 'server_group_id'),
        server_group_name=pulumi.get(__ret__, 'server_group_name'),
        server_group_type=pulumi.get(__ret__, 'server_group_type'),
        servers=pulumi.get(__ret__, 'servers'),
        status=pulumi.get(__ret__, 'status'),
        sticky_session_config=pulumi.get(__ret__, 'sticky_session_config'),
        tags=pulumi.get(__ret__, 'tags'),
        update_time=pulumi.get(__ret__, 'update_time'),
        vpc_id=pulumi.get(__ret__, 'vpc_id'))
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::ALB::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:alb/getServerGroup:getServerGroup', __args__, opts=opts, typ=GetServerGroupResult)
    return __ret__.apply(lambda __response__: GetServerGroupResult(
        create_time=pulumi.get(__response__, 'create_time'),
        description=pulumi.get(__response__, 'description'),
        health_check=pulumi.get(__response__, 'health_check'),
        id=pulumi.get(__response__, 'id'),
        ip_address_type=pulumi.get(__response__, 'ip_address_type'),
        listeners=pulumi.get(__response__, 'listeners'),
        project_name=pulumi.get(__response__, 'project_name'),
        protocol=pulumi.get(__response__, 'protocol'),
        scheduler=pulumi.get(__response__, 'scheduler'),
        server_count=pulumi.get(__response__, 'server_count'),
        server_group_id=pulumi.get(__response__, 'server_group_id'),
        server_group_name=pulumi.get(__response__, 'server_group_name'),
        server_group_type=pulumi.get(__response__, 'server_group_type'),
        servers=pulumi.get(__response__, 'servers'),
        status=pulumi.get(__response__, 'status'),
        sticky_session_config=pulumi.get(__response__, 'sticky_session_config'),
        tags=pulumi.get(__response__, 'tags'),
        update_time=pulumi.get(__response__, 'update_time'),
        vpc_id=pulumi.get(__response__, 'vpc_id')))
