# 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__ = [
    'GetSandboxResult',
    'AwaitableGetSandboxResult',
    'get_sandbox',
    'get_sandbox_output',
]

@pulumi.output_type
class GetSandboxResult:
    """
    A collection of values returned by getSandbox.
    """
    def __init__(__self__, availability_zone=None, cpu_milli=None, created_time=None, envs=None, error_code=None, error_message=None, expire_at=None, function_id=None, id=None, instance_image_info=None, instance_tos_mount_config=None, instance_type=None, max_concurrency=None, memory_mb=None, metadatas=None, pending=None, request_timeout=None, revision_number=None, sandbox_id=None, status=None, timeout=None):
        if availability_zone and not isinstance(availability_zone, str):
            raise TypeError("Expected argument 'availability_zone' to be a str")
        pulumi.set(__self__, "availability_zone", availability_zone)
        if cpu_milli and not isinstance(cpu_milli, int):
            raise TypeError("Expected argument 'cpu_milli' to be a int")
        pulumi.set(__self__, "cpu_milli", cpu_milli)
        if created_time and not isinstance(created_time, str):
            raise TypeError("Expected argument 'created_time' to be a str")
        pulumi.set(__self__, "created_time", created_time)
        if envs and not isinstance(envs, list):
            raise TypeError("Expected argument 'envs' to be a list")
        pulumi.set(__self__, "envs", envs)
        if error_code and not isinstance(error_code, str):
            raise TypeError("Expected argument 'error_code' to be a str")
        pulumi.set(__self__, "error_code", error_code)
        if error_message and not isinstance(error_message, str):
            raise TypeError("Expected argument 'error_message' to be a str")
        pulumi.set(__self__, "error_message", error_message)
        if expire_at and not isinstance(expire_at, str):
            raise TypeError("Expected argument 'expire_at' to be a str")
        pulumi.set(__self__, "expire_at", expire_at)
        if function_id and not isinstance(function_id, str):
            raise TypeError("Expected argument 'function_id' to be a str")
        pulumi.set(__self__, "function_id", function_id)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if instance_image_info and not isinstance(instance_image_info, dict):
            raise TypeError("Expected argument 'instance_image_info' to be a dict")
        pulumi.set(__self__, "instance_image_info", instance_image_info)
        if instance_tos_mount_config and not isinstance(instance_tos_mount_config, dict):
            raise TypeError("Expected argument 'instance_tos_mount_config' to be a dict")
        pulumi.set(__self__, "instance_tos_mount_config", instance_tos_mount_config)
        if instance_type and not isinstance(instance_type, str):
            raise TypeError("Expected argument 'instance_type' to be a str")
        pulumi.set(__self__, "instance_type", instance_type)
        if max_concurrency and not isinstance(max_concurrency, int):
            raise TypeError("Expected argument 'max_concurrency' to be a int")
        pulumi.set(__self__, "max_concurrency", max_concurrency)
        if memory_mb and not isinstance(memory_mb, int):
            raise TypeError("Expected argument 'memory_mb' to be a int")
        pulumi.set(__self__, "memory_mb", memory_mb)
        if metadatas and not isinstance(metadatas, list):
            raise TypeError("Expected argument 'metadatas' to be a list")
        pulumi.set(__self__, "metadatas", metadatas)
        if pending and not isinstance(pending, bool):
            raise TypeError("Expected argument 'pending' to be a bool")
        pulumi.set(__self__, "pending", pending)
        if request_timeout and not isinstance(request_timeout, int):
            raise TypeError("Expected argument 'request_timeout' to be a int")
        pulumi.set(__self__, "request_timeout", request_timeout)
        if revision_number and not isinstance(revision_number, int):
            raise TypeError("Expected argument 'revision_number' to be a int")
        pulumi.set(__self__, "revision_number", revision_number)
        if sandbox_id and not isinstance(sandbox_id, str):
            raise TypeError("Expected argument 'sandbox_id' to be a str")
        pulumi.set(__self__, "sandbox_id", sandbox_id)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if timeout and not isinstance(timeout, int):
            raise TypeError("Expected argument 'timeout' to be a int")
        pulumi.set(__self__, "timeout", timeout)

    @property
    @pulumi.getter(name="availabilityZone")
    def availability_zone(self) -> builtins.str:
        """
        沙箱实例所在可用区 ID。
        """
        return pulumi.get(self, "availability_zone")

    @property
    @pulumi.getter(name="cpuMilli")
    def cpu_milli(self) -> builtins.int:
        """
        沙箱实例 CPU 规格：单位：milli cpu取值范围：250~16000,默认值：1000。
        """
        return pulumi.get(self, "cpu_milli")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> builtins.str:
        """
        沙箱实例创建时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter
    def envs(self) -> Sequence['outputs.GetSandboxEnvResult']:
        """
        沙箱实例环境变量。
        """
        return pulumi.get(self, "envs")

    @property
    @pulumi.getter(name="errorCode")
    def error_code(self) -> builtins.str:
        """
        沙箱实例启动失败错误码。参数值说明：internal*load*request*error：系统内部错误，function*initialize*failed：业务进程初始化错误，function*health*check*failed：健康检查错误，route_terminating：路由删除中，正常启动沙箱实例时，该字段为空。
        """
        return pulumi.get(self, "error_code")

    @property
    @pulumi.getter(name="errorMessage")
    def error_message(self) -> builtins.str:
        """
        沙箱实例启动失败的错误码详情。正常启动沙箱实例时，该字段为空。
        """
        return pulumi.get(self, "error_message")

    @property
    @pulumi.getter(name="expireAt")
    def expire_at(self) -> builtins.str:
        """
        沙箱实例存活时长。
        """
        return pulumi.get(self, "expire_at")

    @property
    @pulumi.getter(name="functionId")
    def function_id(self) -> builtins.str:
        """
        沙箱实例所属的沙箱应用 ID。
        """
        return pulumi.get(self, "function_id")

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

    @property
    @pulumi.getter(name="instanceImageInfo")
    def instance_image_info(self) -> 'outputs.GetSandboxInstanceImageInfoResult':
        """
        沙箱实例镜像信息，包括镜像地址、启动命令、监听端口。
        """
        return pulumi.get(self, "instance_image_info")

    @property
    @pulumi.getter(name="instanceTosMountConfig")
    def instance_tos_mount_config(self) -> 'outputs.GetSandboxInstanceTosMountConfigResult':
        """
        沙箱实例级别对象存储（TOS）存储挂载配置。
        """
        return pulumi.get(self, "instance_tos_mount_config")

    @property
    @pulumi.getter(name="instanceType")
    def instance_type(self) -> builtins.str:
        """
        沙箱实例类型 。参数值说明：elastic：弹性实例，frozen：冻结实例，activated：激活实例，reserved：预留实例。
        """
        return pulumi.get(self, "instance_type")

    @property
    @pulumi.getter(name="maxConcurrency")
    def max_concurrency(self) -> builtins.int:
        """
        单实例请求最大并发数：取值范围：10~1000,默认值：100。
        """
        return pulumi.get(self, "max_concurrency")

    @property
    @pulumi.getter(name="memoryMb")
    def memory_mb(self) -> builtins.int:
        """
        沙箱实例内存规格：单位：MiB，取值范围：512~131072，默认值：2048
        """
        return pulumi.get(self, "memory_mb")

    @property
    @pulumi.getter
    def metadatas(self) -> Sequence['outputs.GetSandboxMetadataResult']:
        """
        沙箱实例标签（Label）元信息，用于标记、筛选实例。格式为<"key":"value">。
        """
        return pulumi.get(self, "metadatas")

    @property
    @pulumi.getter
    def pending(self) -> builtins.bool:
        """
        沙箱实例是否处于 Pending 状态。参数值说明：true：是，false：否。
        """
        return pulumi.get(self, "pending")

    @property
    @pulumi.getter(name="requestTimeout")
    def request_timeout(self) -> builtins.int:
        """
        请求超时时间：单位：秒，取值范围：1~900，正整数。默认值：30。
        """
        return pulumi.get(self, "request_timeout")

    @property
    @pulumi.getter(name="revisionNumber")
    def revision_number(self) -> builtins.int:
        """
        函数实例版本编号。
        """
        return pulumi.get(self, "revision_number")

    @property
    @pulumi.getter(name="sandboxId")
    def sandbox_id(self) -> builtins.str:
        """
        沙箱实例 ID。
        """
        return pulumi.get(self, "sandbox_id")

    @property
    @pulumi.getter
    def status(self) -> builtins.str:
        """
        沙箱实例状态。 参数值说明：Starting：开始启动，Ready：启动完成，Failed：启动失败，Terminating：终止中。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def timeout(self) -> builtins.int:
        """
        沙箱实例存活时长：单位：分钟，取值范围：3～1440，默认值：60。
        """
        return pulumi.get(self, "timeout")


class AwaitableGetSandboxResult(GetSandboxResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSandboxResult(
            availability_zone=self.availability_zone,
            cpu_milli=self.cpu_milli,
            created_time=self.created_time,
            envs=self.envs,
            error_code=self.error_code,
            error_message=self.error_message,
            expire_at=self.expire_at,
            function_id=self.function_id,
            id=self.id,
            instance_image_info=self.instance_image_info,
            instance_tos_mount_config=self.instance_tos_mount_config,
            instance_type=self.instance_type,
            max_concurrency=self.max_concurrency,
            memory_mb=self.memory_mb,
            metadatas=self.metadatas,
            pending=self.pending,
            request_timeout=self.request_timeout,
            revision_number=self.revision_number,
            sandbox_id=self.sandbox_id,
            status=self.status,
            timeout=self.timeout)


def get_sandbox(id: Optional[builtins.str] = None,
                opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSandboxResult:
    """
    Data Source schema for Byteplus::VEFAAS::Sandbox


    :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:vefaas/getSandbox:getSandbox', __args__, opts=opts, typ=GetSandboxResult).value

    return AwaitableGetSandboxResult(
        availability_zone=pulumi.get(__ret__, 'availability_zone'),
        cpu_milli=pulumi.get(__ret__, 'cpu_milli'),
        created_time=pulumi.get(__ret__, 'created_time'),
        envs=pulumi.get(__ret__, 'envs'),
        error_code=pulumi.get(__ret__, 'error_code'),
        error_message=pulumi.get(__ret__, 'error_message'),
        expire_at=pulumi.get(__ret__, 'expire_at'),
        function_id=pulumi.get(__ret__, 'function_id'),
        id=pulumi.get(__ret__, 'id'),
        instance_image_info=pulumi.get(__ret__, 'instance_image_info'),
        instance_tos_mount_config=pulumi.get(__ret__, 'instance_tos_mount_config'),
        instance_type=pulumi.get(__ret__, 'instance_type'),
        max_concurrency=pulumi.get(__ret__, 'max_concurrency'),
        memory_mb=pulumi.get(__ret__, 'memory_mb'),
        metadatas=pulumi.get(__ret__, 'metadatas'),
        pending=pulumi.get(__ret__, 'pending'),
        request_timeout=pulumi.get(__ret__, 'request_timeout'),
        revision_number=pulumi.get(__ret__, 'revision_number'),
        sandbox_id=pulumi.get(__ret__, 'sandbox_id'),
        status=pulumi.get(__ret__, 'status'),
        timeout=pulumi.get(__ret__, 'timeout'))
def get_sandbox_output(id: Optional[pulumi.Input[builtins.str]] = None,
                       opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetSandboxResult]:
    """
    Data Source schema for Byteplus::VEFAAS::Sandbox


    :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:vefaas/getSandbox:getSandbox', __args__, opts=opts, typ=GetSandboxResult)
    return __ret__.apply(lambda __response__: GetSandboxResult(
        availability_zone=pulumi.get(__response__, 'availability_zone'),
        cpu_milli=pulumi.get(__response__, 'cpu_milli'),
        created_time=pulumi.get(__response__, 'created_time'),
        envs=pulumi.get(__response__, 'envs'),
        error_code=pulumi.get(__response__, 'error_code'),
        error_message=pulumi.get(__response__, 'error_message'),
        expire_at=pulumi.get(__response__, 'expire_at'),
        function_id=pulumi.get(__response__, 'function_id'),
        id=pulumi.get(__response__, 'id'),
        instance_image_info=pulumi.get(__response__, 'instance_image_info'),
        instance_tos_mount_config=pulumi.get(__response__, 'instance_tos_mount_config'),
        instance_type=pulumi.get(__response__, 'instance_type'),
        max_concurrency=pulumi.get(__response__, 'max_concurrency'),
        memory_mb=pulumi.get(__response__, 'memory_mb'),
        metadatas=pulumi.get(__response__, 'metadatas'),
        pending=pulumi.get(__response__, 'pending'),
        request_timeout=pulumi.get(__response__, 'request_timeout'),
        revision_number=pulumi.get(__response__, 'revision_number'),
        sandbox_id=pulumi.get(__response__, 'sandbox_id'),
        status=pulumi.get(__response__, 'status'),
        timeout=pulumi.get(__response__, 'timeout')))
