diff --git a/agentplatform/_genai/types/__init__.py b/agentplatform/_genai/types/__init__.py index 40378c1d0f..1c122ccd3a 100644 --- a/agentplatform/_genai/types/__init__.py +++ b/agentplatform/_genai/types/__init__.py @@ -1995,6 +1995,9 @@ from .common import SandboxEnvironmentTemplateOperationDict from .common import SandboxEnvironmentTemplateOperationOrDict from .common import SandboxEnvironmentTemplateOrDict +from .common import SandboxEnvironmentTemplatePersistentDiskConfig +from .common import SandboxEnvironmentTemplatePersistentDiskConfigDict +from .common import SandboxEnvironmentTemplatePersistentDiskConfigOrDict from .common import SandboxEnvironmentTemplateResourceRequirements from .common import SandboxEnvironmentTemplateResourceRequirementsDict from .common import SandboxEnvironmentTemplateResourceRequirementsOrDict @@ -3516,6 +3519,9 @@ "CreateSandboxEnvironmentTemplateConfig", "CreateSandboxEnvironmentTemplateConfigDict", "CreateSandboxEnvironmentTemplateConfigOrDict", + "SandboxEnvironmentTemplatePersistentDiskConfig", + "SandboxEnvironmentTemplatePersistentDiskConfigDict", + "SandboxEnvironmentTemplatePersistentDiskConfigOrDict", "SandboxEnvironmentTemplate", "SandboxEnvironmentTemplateDict", "SandboxEnvironmentTemplateOrDict", diff --git a/agentplatform/_genai/types/common.py b/agentplatform/_genai/types/common.py index d59acc7cfa..56efc40a53 100644 --- a/agentplatform/_genai/types/common.py +++ b/agentplatform/_genai/types/common.py @@ -1733,7 +1733,7 @@ def evaluate(instance: dict[str, Any]) -> float: ) code_execution_region: Optional[str] = Field( default=None, - description="""Optional. The region to use for code execution. If set, the Code Execution Sandbox will be invoked in the specified region regardless of the request's originating region. Must be a region where the Code Execution Sandbox is available. Supported regions: northamerica-northeast1, southamerica-east1, us-central1, us-east1, us-east4, us-west1, us-west4, europe-central2, europe-north1, europe-southwest1, europe-west1, europe-west2, europe-west3, europe-west4, europe-west6, europe-west8, europe-west9, me-west1, asia-east1, asia-east2, asia-northeast1, asia-northeast3, asia-south1, asia-south2, asia-southeast1, australia-southeast2. If unset, the request's originating region is used; requests from regions where the sandbox is unavailable will fail with UNIMPLEMENTED.""", + description="""Optional. The region to use for code execution. If set, the Code Execution Sandbox will be invoked in the specified region regardless of the request's originating region. Must be a region where the Code Execution Sandbox is available. For the current list of [supported regions](https://cloud.google.com/vertex-ai/generative-ai/docs/agent-engine/locations). If unset, the request's originating region is used; requests from regions where the sandbox is unavailable will fail with UNIMPLEMENTED.""", ) @@ -1755,7 +1755,7 @@ def evaluate(instance: dict[str, Any]) -> float: are available to the function as instance[field_name].""" code_execution_region: Optional[str] - """Optional. The region to use for code execution. If set, the Code Execution Sandbox will be invoked in the specified region regardless of the request's originating region. Must be a region where the Code Execution Sandbox is available. Supported regions: northamerica-northeast1, southamerica-east1, us-central1, us-east1, us-east4, us-west1, us-west4, europe-central2, europe-north1, europe-southwest1, europe-west1, europe-west2, europe-west3, europe-west4, europe-west6, europe-west8, europe-west9, me-west1, asia-east1, asia-east2, asia-northeast1, asia-northeast3, asia-south1, asia-south2, asia-southeast1, australia-southeast2. If unset, the request's originating region is used; requests from regions where the sandbox is unavailable will fail with UNIMPLEMENTED.""" + """Optional. The region to use for code execution. If set, the Code Execution Sandbox will be invoked in the specified region regardless of the request's originating region. Must be a region where the Code Execution Sandbox is available. For the current list of [supported regions](https://cloud.google.com/vertex-ai/generative-ai/docs/agent-engine/locations). If unset, the request's originating region is used; requests from regions where the sandbox is unavailable will fail with UNIMPLEMENTED.""" CustomCodeExecutionSpecOrDict = Union[ @@ -18001,6 +18001,42 @@ class _CreateSandboxEnvironmentTemplateRequestParametersDict(TypedDict, total=Fa ] +class SandboxEnvironmentTemplatePersistentDiskConfig(_common.BaseModel): + """Configuration for attaching a persistent disk (PD) to each SandboxEnvironment created from this template. A persistent disk provides durable, per-sandbox block storage whose contents survive across the sandbox lifecycle events that this service supports (e.g. pause/resume), unlike ephemeral local storage which is lost when the underlying runtime is torn down.""" + + enabled: Optional[bool] = Field( + default=None, + description="""Optional. Whether a persistent disk is attached to sandboxes created from this template. Defaults to `false`. This flag lets a template carry (and preserve) disk configuration while keeping the disk detached, so it can be toggled on later without re-specifying the rest of the config. When `false`, the remaining fields in this message are ignored.""", + ) + mount_path: Optional[str] = Field( + default=None, + description="""Optional. The absolute path inside the sandbox container at which the persistent disk is mounted. Defaults to `/workspace` when unset. Ignored when `enabled` is `false`. Only writes beneath this path land on the disk. Writes elsewhere go to the container's writable layer, which counts against the container's ephemeral storage and is lost when the sandbox's runtime is torn down, so this should be the directory the workload actually writes to. Paths that would shadow the container's system directories (for example `/etc`, `/proc`, or `/usr` itself) are rejected.""", + ) + size_gb: Optional[int] = Field( + default=None, + description="""Optional. The size of the persistent disk in GB. Must be non-negative. When `enabled` is `true`, a positive value is required; when unset or zero while enabled, the service applies a default size. Ignored when `enabled` is `false`.""", + ) + + +class SandboxEnvironmentTemplatePersistentDiskConfigDict(TypedDict, total=False): + """Configuration for attaching a persistent disk (PD) to each SandboxEnvironment created from this template. A persistent disk provides durable, per-sandbox block storage whose contents survive across the sandbox lifecycle events that this service supports (e.g. pause/resume), unlike ephemeral local storage which is lost when the underlying runtime is torn down.""" + + enabled: Optional[bool] + """Optional. Whether a persistent disk is attached to sandboxes created from this template. Defaults to `false`. This flag lets a template carry (and preserve) disk configuration while keeping the disk detached, so it can be toggled on later without re-specifying the rest of the config. When `false`, the remaining fields in this message are ignored.""" + + mount_path: Optional[str] + """Optional. The absolute path inside the sandbox container at which the persistent disk is mounted. Defaults to `/workspace` when unset. Ignored when `enabled` is `false`. Only writes beneath this path land on the disk. Writes elsewhere go to the container's writable layer, which counts against the container's ephemeral storage and is lost when the sandbox's runtime is torn down, so this should be the directory the workload actually writes to. Paths that would shadow the container's system directories (for example `/etc`, `/proc`, or `/usr` itself) are rejected.""" + + size_gb: Optional[int] + """Optional. The size of the persistent disk in GB. Must be non-negative. When `enabled` is `true`, a positive value is required; when unset or zero while enabled, the service applies a default size. Ignored when `enabled` is `false`.""" + + +SandboxEnvironmentTemplatePersistentDiskConfigOrDict = Union[ + SandboxEnvironmentTemplatePersistentDiskConfig, + SandboxEnvironmentTemplatePersistentDiskConfigDict, +] + + class SandboxEnvironmentTemplate(_common.BaseModel): """A sandbox environment template.""" @@ -18050,6 +18086,12 @@ class SandboxEnvironmentTemplate(_common.BaseModel): default=None, description="""Optional. Immutable. Whether to provision the SandboxEnvironmentTemplate via the GKE TD pool.""", ) + persistent_disk_config: Optional[SandboxEnvironmentTemplatePersistentDiskConfig] = ( + Field( + default=None, + description="""Optional. Configuration for attaching a persistent disk (PD) to each SandboxEnvironment created from this template. When unset (or when `enabled` is `false`), sandboxes created from this template are not backed by a persistent disk and rely on ephemeral storage only. See PersistentDiskConfig for details.""", + ) + ) class SandboxEnvironmentTemplateDict(TypedDict, total=False): @@ -18089,6 +18131,9 @@ class SandboxEnvironmentTemplateDict(TypedDict, total=False): use_gke_td: Optional[bool] """Optional. Immutable. Whether to provision the SandboxEnvironmentTemplate via the GKE TD pool.""" + persistent_disk_config: Optional[SandboxEnvironmentTemplatePersistentDiskConfigDict] + """Optional. Configuration for attaching a persistent disk (PD) to each SandboxEnvironment created from this template. When unset (or when `enabled` is `false`), sandboxes created from this template are not backed by a persistent disk and rely on ephemeral storage only. See PersistentDiskConfig for details.""" + SandboxEnvironmentTemplateOrDict = Union[ SandboxEnvironmentTemplate, SandboxEnvironmentTemplateDict