diff --git a/tests/unit/vertexai/genai/replays/test_get_agent_engine_sandbox.py b/tests/unit/vertexai/genai/replays/test_get_agent_engine_sandbox.py index b82a74a397..b5029897b7 100644 --- a/tests/unit/vertexai/genai/replays/test_get_agent_engine_sandbox.py +++ b/tests/unit/vertexai/genai/replays/test_get_agent_engine_sandbox.py @@ -38,6 +38,7 @@ def test_get_sandbox(client): ) assert isinstance(sandbox, types.SandboxEnvironment) assert sandbox.name == operation.response.name + assert isinstance(sandbox.state, types.SandboxState) pytestmark = pytest_helper.setup( diff --git a/vertexai/_genai/types/__init__.py b/vertexai/_genai/types/__init__.py index 4182fbbd8c..05e83628b3 100644 --- a/vertexai/_genai/types/__init__.py +++ b/vertexai/_genai/types/__init__.py @@ -1179,6 +1179,7 @@ from .common import SandboxEnvironmentTemplateWarmPoolConfig from .common import SandboxEnvironmentTemplateWarmPoolConfigDict from .common import SandboxEnvironmentTemplateWarmPoolConfigOrDict +from .common import SandboxState from .common import SavedQuery from .common import SavedQueryDict from .common import SavedQueryOrDict @@ -2641,6 +2642,7 @@ "Operator", "Language", "MachineConfig", + "SandboxState", "Protocol", "DefaultContainerCategory", "PostSnapshotAction", diff --git a/vertexai/_genai/types/common.py b/vertexai/_genai/types/common.py index 6ce66a054c..61d3b99cec 100644 --- a/vertexai/_genai/types/common.py +++ b/vertexai/_genai/types/common.py @@ -324,6 +324,23 @@ class MachineConfig(_common.CaseInSensitiveEnum): """The default value: milligcu 4000, memory 4 Gib""" +class SandboxState(_common.CaseInSensitiveEnum): + """Output only. The runtime state of the SandboxEnvironment.""" + + STATE_UNSPECIFIED = "STATE_UNSPECIFIED" + """The default value. This value is unused.""" + STATE_PROVISIONING = "STATE_PROVISIONING" + """Runtime resources are being allocated for the sandbox environment.""" + STATE_RUNNING = "STATE_RUNNING" + """Sandbox runtime is ready for serving.""" + STATE_DEPROVISIONING = "STATE_DEPROVISIONING" + """Sandbox runtime is halted, performing tear down tasks.""" + STATE_TERMINATED = "STATE_TERMINATED" + """Sandbox has terminated with underlying runtime failure.""" + STATE_DELETED = "STATE_DELETED" + """Sandbox runtime has been deleted.""" + + class Protocol(_common.CaseInSensitiveEnum): """Protocol for port. Defaults to TCP if not specified.""" @@ -12356,7 +12373,7 @@ class SandboxEnvironment(_common.BaseModel): default=None, description="""Optional. The configuration of the SandboxEnvironment.""", ) - state: Optional[State] = Field( + state: Optional[SandboxState] = Field( default=None, description="""Output only. The runtime state of the SandboxEnvironment.""", ) @@ -12408,7 +12425,7 @@ class SandboxEnvironmentDict(TypedDict, total=False): spec: Optional[SandboxEnvironmentSpecDict] """Optional. The configuration of the SandboxEnvironment.""" - state: Optional[State] + state: Optional[SandboxState] """Output only. The runtime state of the SandboxEnvironment.""" ttl: Optional[str]