platform-api-python-client 4.25.0__py3-none-any.whl → 4.31.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- platform_api_python_client/__init__.py +11 -1
- platform_api_python_client/api/external_api.py +1786 -481
- platform_api_python_client/api_client.py +1 -1
- platform_api_python_client/configuration.py +1 -1
- platform_api_python_client/models/__init__.py +10 -0
- platform_api_python_client/models/cloud_provider.py +5 -0
- platform_api_python_client/models/create_c_serve_v3_deployment_request.py +18 -8
- platform_api_python_client/models/create_compute_deployment_request.py +18 -1
- platform_api_python_client/models/create_dynamo_deployment_request.py +56 -6
- platform_api_python_client/models/create_filesystem_volume_request.py +13 -0
- platform_api_python_client/models/create_inference_v3_deployment_request.py +18 -8
- platform_api_python_client/models/create_job_deployment_request.py +18 -1
- platform_api_python_client/models/create_object_volume_request.py +32 -19
- platform_api_python_client/models/deployment_response.py +21 -6
- platform_api_python_client/models/dynamo_communications_input.py +104 -0
- platform_api_python_client/models/dynamo_communications_output.py +104 -0
- platform_api_python_client/models/dynamo_kv_transfer_configuration.py +101 -0
- platform_api_python_client/models/dynamo_kv_transfer_policy.py +37 -0
- platform_api_python_client/models/dynamo_worker_pool_config.py +38 -5
- platform_api_python_client/models/dynamo_worker_pools.py +24 -4
- platform_api_python_client/models/get_c_serve_v2_deployment_response.py +25 -1
- platform_api_python_client/models/get_c_serve_v3_deployment_response.py +25 -8
- platform_api_python_client/models/get_compute_deployment_response.py +25 -1
- platform_api_python_client/models/get_deployment_response.py +26 -2
- platform_api_python_client/models/get_dynamo_deployment_response.py +47 -5
- platform_api_python_client/models/get_inference_deployment_response.py +25 -1
- platform_api_python_client/models/get_inference_v3_deployment_response.py +23 -6
- platform_api_python_client/models/get_job_deployment_response.py +25 -1
- platform_api_python_client/models/get_object_volume_response.py +2 -16
- platform_api_python_client/models/hardware_instance_response.py +1 -3
- platform_api_python_client/models/hardware_preset_response.py +96 -0
- platform_api_python_client/models/list_hardware_preset_response.py +95 -0
- platform_api_python_client/models/list_organization_gpu_quota_response.py +95 -0
- platform_api_python_client/models/organization_gpu_quota_request.py +88 -0
- platform_api_python_client/models/organization_gpu_quota_response.py +91 -0
- platform_api_python_client/models/validation_error.py +12 -3
- platform_api_python_client/models/volume_mount.py +92 -0
- {platform_api_python_client-4.25.0.dist-info → platform_api_python_client-4.31.0.dist-info}/METADATA +1 -1
- {platform_api_python_client-4.25.0.dist-info → platform_api_python_client-4.31.0.dist-info}/RECORD +41 -31
- {platform_api_python_client-4.25.0.dist-info → platform_api_python_client-4.31.0.dist-info}/WHEEL +0 -0
- {platform_api_python_client-4.25.0.dist-info → platform_api_python_client-4.31.0.dist-info}/top_level.txt +0 -0
|
@@ -90,7 +90,7 @@ class ApiClient:
|
|
|
90
90
|
self.default_headers[header_name] = header_value
|
|
91
91
|
self.cookie = cookie
|
|
92
92
|
# Set default User-Agent.
|
|
93
|
-
self.user_agent = 'OpenAPI-Generator/4.
|
|
93
|
+
self.user_agent = 'OpenAPI-Generator/4.31.0/python'
|
|
94
94
|
self.client_side_validation = configuration.client_side_validation
|
|
95
95
|
|
|
96
96
|
def __enter__(self):
|
|
@@ -392,7 +392,7 @@ class Configuration:
|
|
|
392
392
|
"OS: {env}\n"\
|
|
393
393
|
"Python Version: {pyversion}\n"\
|
|
394
394
|
"Version of the API: 0.1.0\n"\
|
|
395
|
-
"SDK Package Version: 4.
|
|
395
|
+
"SDK Package Version: 4.31.0".\
|
|
396
396
|
format(env=sys.platform, pyversion=sys.version)
|
|
397
397
|
|
|
398
398
|
def get_host_settings(self):
|
|
@@ -60,6 +60,10 @@ from platform_api_python_client.models.deployment_status_v3_response import Depl
|
|
|
60
60
|
from platform_api_python_client.models.deployment_type import DeploymentType
|
|
61
61
|
from platform_api_python_client.models.deployment_usage import DeploymentUsage
|
|
62
62
|
from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue
|
|
63
|
+
from platform_api_python_client.models.dynamo_communications_input import DynamoCommunicationsInput
|
|
64
|
+
from platform_api_python_client.models.dynamo_communications_output import DynamoCommunicationsOutput
|
|
65
|
+
from platform_api_python_client.models.dynamo_kv_transfer_configuration import DynamoKvTransferConfiguration
|
|
66
|
+
from platform_api_python_client.models.dynamo_kv_transfer_policy import DynamoKvTransferPolicy
|
|
63
67
|
from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode
|
|
64
68
|
from platform_api_python_client.models.dynamo_worker_pool_config import DynamoWorkerPoolConfig
|
|
65
69
|
from platform_api_python_client.models.dynamo_worker_pools import DynamoWorkerPools
|
|
@@ -88,6 +92,7 @@ from platform_api_python_client.models.gpu_operator import GpuOperator
|
|
|
88
92
|
from platform_api_python_client.models.gpu_type_capacity import GpuTypeCapacity
|
|
89
93
|
from platform_api_python_client.models.http_validation_error import HTTPValidationError
|
|
90
94
|
from platform_api_python_client.models.hardware_instance_response import HardwareInstanceResponse
|
|
95
|
+
from platform_api_python_client.models.hardware_preset_response import HardwarePresetResponse
|
|
91
96
|
from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials
|
|
92
97
|
from platform_api_python_client.models.ingress_nginx import IngressNginx
|
|
93
98
|
from platform_api_python_client.models.invite_user_request import InviteUserRequest
|
|
@@ -104,6 +109,8 @@ from platform_api_python_client.models.list_deployment_revisions_response import
|
|
|
104
109
|
from platform_api_python_client.models.list_get_cluster_response import ListGetClusterResponse
|
|
105
110
|
from platform_api_python_client.models.list_get_deployment_response import ListGetDeploymentResponse
|
|
106
111
|
from platform_api_python_client.models.list_hardware_instance_response import ListHardwareInstanceResponse
|
|
112
|
+
from platform_api_python_client.models.list_hardware_preset_response import ListHardwarePresetResponse
|
|
113
|
+
from platform_api_python_client.models.list_organization_gpu_quota_response import ListOrganizationGpuQuotaResponse
|
|
107
114
|
from platform_api_python_client.models.list_prebuilt_image_response import ListPrebuiltImageResponse
|
|
108
115
|
from platform_api_python_client.models.list_service_accounts_response import ListServiceAccountsResponse
|
|
109
116
|
from platform_api_python_client.models.list_user_vault_items_response import ListUserVaultItemsResponse
|
|
@@ -115,6 +122,8 @@ from platform_api_python_client.models.metrics_server import MetricsServer
|
|
|
115
122
|
from platform_api_python_client.models.network_operator import NetworkOperator
|
|
116
123
|
from platform_api_python_client.models.object_storage_provider import ObjectStorageProvider
|
|
117
124
|
from platform_api_python_client.models.opentelemetry_collector import OpentelemetryCollector
|
|
125
|
+
from platform_api_python_client.models.organization_gpu_quota_request import OrganizationGpuQuotaRequest
|
|
126
|
+
from platform_api_python_client.models.organization_gpu_quota_response import OrganizationGpuQuotaResponse
|
|
118
127
|
from platform_api_python_client.models.pod_details import PodDetails
|
|
119
128
|
from platform_api_python_client.models.pod_status import PodStatus
|
|
120
129
|
from platform_api_python_client.models.prebuilt_image_response import PrebuiltImageResponse
|
|
@@ -139,5 +148,6 @@ from platform_api_python_client.models.validation_error_loc_inner import Validat
|
|
|
139
148
|
from platform_api_python_client.models.vault_scope import VaultScope
|
|
140
149
|
from platform_api_python_client.models.volume_access_mode import VolumeAccessMode
|
|
141
150
|
from platform_api_python_client.models.volume_backend import VolumeBackend
|
|
151
|
+
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
142
152
|
from platform_api_python_client.models.volume_status import VolumeStatus
|
|
143
153
|
from platform_api_python_client.models.volume_status_response import VolumeStatusResponse
|
|
@@ -30,6 +30,11 @@ class CloudProvider(str, Enum):
|
|
|
30
30
|
AWS = 'aws'
|
|
31
31
|
AZURE = 'azure'
|
|
32
32
|
NEBIUS = 'nebius'
|
|
33
|
+
LAMBDA = 'lambda'
|
|
34
|
+
VULTR = 'vultr'
|
|
35
|
+
INTEL = 'intel'
|
|
36
|
+
COREWEAVE = 'coreweave'
|
|
37
|
+
UNKNOWN = 'unknown'
|
|
33
38
|
|
|
34
39
|
@classmethod
|
|
35
40
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, Strict
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from platform_api_python_client.models.c_serve_v2_recipe import CServeV2Recipe
|
|
24
|
+
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
24
25
|
from typing import Optional, Set
|
|
25
26
|
from typing_extensions import Self
|
|
26
27
|
|
|
@@ -35,6 +36,8 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
35
36
|
hardware_instance_id: StrictInt
|
|
36
37
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
37
38
|
chart_revision: Optional[StrictStr] = None
|
|
39
|
+
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
40
|
+
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
38
41
|
recipe: CServeV2Recipe
|
|
39
42
|
cserve_version: Optional[StrictStr] = None
|
|
40
43
|
hf_token: Optional[StrictStr] = None
|
|
@@ -42,14 +45,13 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
42
45
|
endpoint_certificate_authority: Optional[StrictStr] = None
|
|
43
46
|
min_replicas: StrictInt
|
|
44
47
|
max_replicas: StrictInt
|
|
45
|
-
initial_replicas: Optional[StrictInt] = None
|
|
46
48
|
concurrency: Optional[StrictInt] = None
|
|
47
49
|
cooldown_period: Optional[StrictInt] = None
|
|
48
50
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
49
51
|
enable_logging: Optional[StrictBool] = True
|
|
50
52
|
enable_node_model_cache: Optional[StrictBool] = False
|
|
51
53
|
session_affinity: Optional[StrictBool] = Field(default=False, description="Enable best-effort sticky routing via the `X-Session-Id` request header. Requests carrying the same header value land on the same pod, improving KV cache reuse for agentic workloads. Requests without the header are routed at random. Affinity is NOT durable: scaling, rollouts, restarts, or readiness-probe transitions will remap sessions to different pods. Do not use for irreplaceable in-pod state.")
|
|
52
|
-
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "recipe", "cserve_version", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_replicas", "max_replicas", "
|
|
54
|
+
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "recipe", "cserve_version", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "env_vars", "enable_logging", "enable_node_model_cache", "session_affinity"]
|
|
53
55
|
|
|
54
56
|
@field_validator('name')
|
|
55
57
|
def name_validate_regular_expression(cls, value):
|
|
@@ -97,6 +99,13 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
97
99
|
exclude=excluded_fields,
|
|
98
100
|
exclude_none=True,
|
|
99
101
|
)
|
|
102
|
+
# override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
|
|
103
|
+
_items = []
|
|
104
|
+
if self.volume_mounts:
|
|
105
|
+
for _item_volume_mounts in self.volume_mounts:
|
|
106
|
+
if _item_volume_mounts:
|
|
107
|
+
_items.append(_item_volume_mounts.to_dict())
|
|
108
|
+
_dict['volume_mounts'] = _items
|
|
100
109
|
# override the default output from pydantic by calling `to_dict()` of recipe
|
|
101
110
|
if self.recipe:
|
|
102
111
|
_dict['recipe'] = self.recipe.to_dict()
|
|
@@ -115,6 +124,11 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
115
124
|
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
116
125
|
_dict['user_annotations'] = None
|
|
117
126
|
|
|
127
|
+
# set to None if priority (nullable) is None
|
|
128
|
+
# and model_fields_set contains the field
|
|
129
|
+
if self.priority is None and "priority" in self.model_fields_set:
|
|
130
|
+
_dict['priority'] = None
|
|
131
|
+
|
|
118
132
|
# set to None if cserve_version (nullable) is None
|
|
119
133
|
# and model_fields_set contains the field
|
|
120
134
|
if self.cserve_version is None and "cserve_version" in self.model_fields_set:
|
|
@@ -135,11 +149,6 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
135
149
|
if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
|
|
136
150
|
_dict['endpoint_certificate_authority'] = None
|
|
137
151
|
|
|
138
|
-
# set to None if initial_replicas (nullable) is None
|
|
139
|
-
# and model_fields_set contains the field
|
|
140
|
-
if self.initial_replicas is None and "initial_replicas" in self.model_fields_set:
|
|
141
|
-
_dict['initial_replicas'] = None
|
|
142
|
-
|
|
143
152
|
# set to None if concurrency (nullable) is None
|
|
144
153
|
# and model_fields_set contains the field
|
|
145
154
|
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
@@ -169,6 +178,8 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
169
178
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
170
179
|
"user_annotations": obj.get("user_annotations"),
|
|
171
180
|
"chart_revision": obj.get("chart_revision"),
|
|
181
|
+
"volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
|
|
182
|
+
"priority": obj.get("priority"),
|
|
172
183
|
"recipe": CServeV2Recipe.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
|
|
173
184
|
"cserve_version": obj.get("cserve_version"),
|
|
174
185
|
"hf_token": obj.get("hf_token"),
|
|
@@ -176,7 +187,6 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
176
187
|
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
177
188
|
"min_replicas": obj.get("min_replicas"),
|
|
178
189
|
"max_replicas": obj.get("max_replicas"),
|
|
179
|
-
"initial_replicas": obj.get("initial_replicas"),
|
|
180
190
|
"concurrency": obj.get("concurrency"),
|
|
181
191
|
"cooldown_period": obj.get("cooldown_period"),
|
|
182
192
|
"env_vars": obj.get("env_vars"),
|
|
@@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, Strict
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials
|
|
24
|
+
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
24
25
|
from typing import Optional, Set
|
|
25
26
|
from typing_extensions import Self
|
|
26
27
|
|
|
@@ -33,11 +34,13 @@ class CreateComputeDeploymentRequest(BaseModel):
|
|
|
33
34
|
hardware_instance_id: StrictInt
|
|
34
35
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
35
36
|
chart_revision: Optional[StrictStr] = None
|
|
37
|
+
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
38
|
+
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
36
39
|
image_url: StrictStr
|
|
37
40
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
38
41
|
ssh_public_key: StrictStr
|
|
39
42
|
enable_logging: Optional[StrictBool] = False
|
|
40
|
-
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "image_url", "image_pull_secret_credentials", "ssh_public_key", "enable_logging"]
|
|
43
|
+
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "image_url", "image_pull_secret_credentials", "ssh_public_key", "enable_logging"]
|
|
41
44
|
|
|
42
45
|
@field_validator('name')
|
|
43
46
|
def name_validate_regular_expression(cls, value):
|
|
@@ -85,6 +88,13 @@ class CreateComputeDeploymentRequest(BaseModel):
|
|
|
85
88
|
exclude=excluded_fields,
|
|
86
89
|
exclude_none=True,
|
|
87
90
|
)
|
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
|
|
92
|
+
_items = []
|
|
93
|
+
if self.volume_mounts:
|
|
94
|
+
for _item_volume_mounts in self.volume_mounts:
|
|
95
|
+
if _item_volume_mounts:
|
|
96
|
+
_items.append(_item_volume_mounts.to_dict())
|
|
97
|
+
_dict['volume_mounts'] = _items
|
|
88
98
|
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
89
99
|
if self.image_pull_secret_credentials:
|
|
90
100
|
_dict['image_pull_secret_credentials'] = self.image_pull_secret_credentials.to_dict()
|
|
@@ -93,6 +103,11 @@ class CreateComputeDeploymentRequest(BaseModel):
|
|
|
93
103
|
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
94
104
|
_dict['user_annotations'] = None
|
|
95
105
|
|
|
106
|
+
# set to None if priority (nullable) is None
|
|
107
|
+
# and model_fields_set contains the field
|
|
108
|
+
if self.priority is None and "priority" in self.model_fields_set:
|
|
109
|
+
_dict['priority'] = None
|
|
110
|
+
|
|
96
111
|
# set to None if image_pull_secret_credentials (nullable) is None
|
|
97
112
|
# and model_fields_set contains the field
|
|
98
113
|
if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
|
|
@@ -115,6 +130,8 @@ class CreateComputeDeploymentRequest(BaseModel):
|
|
|
115
130
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
116
131
|
"user_annotations": obj.get("user_annotations"),
|
|
117
132
|
"chart_revision": obj.get("chart_revision"),
|
|
133
|
+
"volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
|
|
134
|
+
"priority": obj.get("priority"),
|
|
118
135
|
"image_url": obj.get("image_url"),
|
|
119
136
|
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
120
137
|
"ssh_public_key": obj.get("ssh_public_key"),
|
|
@@ -21,14 +21,16 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, Strict
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from platform_api_python_client.models.backend_protocol import BackendProtocol
|
|
24
|
+
from platform_api_python_client.models.dynamo_communications_input import DynamoCommunicationsInput
|
|
24
25
|
from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode
|
|
25
26
|
from platform_api_python_client.models.dynamo_worker_pools import DynamoWorkerPools
|
|
27
|
+
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
26
28
|
from typing import Optional, Set
|
|
27
29
|
from typing_extensions import Self
|
|
28
30
|
|
|
29
31
|
class CreateDynamoDeploymentRequest(BaseModel):
|
|
30
32
|
"""
|
|
31
|
-
Create a Dynamo deployment.
|
|
33
|
+
Create a Dynamo deployment. Hardware and scaling live under ``worker_pools``: aggregated mode uses exactly ``worker_pools.worker``; disaggregated mode uses exactly ``worker_pools.prefill`` and ``worker_pools.decode`` (fixed-size until per-role autoscaling ships). The top-level ``hardware_instance_id`` / ``min_replicas`` / ``max_replicas`` / ``concurrency`` / ``cooldown_period`` fields are the deprecated aggregated-only spelling; they stay accepted and may accompany ``worker_pools`` when they agree with it. ``parse_dynamo_topology`` owns every topology rule for both spellings.
|
|
32
34
|
""" # noqa: E501
|
|
33
35
|
max_surge: Optional[StrictInt] = None
|
|
34
36
|
max_unavailable: Optional[StrictInt] = None
|
|
@@ -37,12 +39,16 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
37
39
|
hardware_instance_id: Optional[StrictInt] = None
|
|
38
40
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
39
41
|
chart_revision: Optional[StrictStr] = None
|
|
42
|
+
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
43
|
+
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
40
44
|
serving_mode: Optional[DynamoServingMode] = None
|
|
41
45
|
worker_pools: Optional[DynamoWorkerPools] = None
|
|
46
|
+
communications: Optional[DynamoCommunicationsInput] = None
|
|
42
47
|
model: StrictStr
|
|
43
48
|
served_model_name: Optional[StrictStr] = None
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
runtime_version: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Dynamo runtime image tag (for example 1.4.0). Defaults to the platform's current release; GET /prebuilt-images?type=dynamo lists the versions the platform has validated, but any tag may be requested. require_gpu_direct_rdma needs an EFA-capable image. Changing it restarts every component of a running deployment.")
|
|
50
|
+
min_replicas: Optional[StrictInt] = None
|
|
51
|
+
max_replicas: Optional[StrictInt] = None
|
|
46
52
|
concurrency: Optional[StrictInt] = None
|
|
47
53
|
cooldown_period: Optional[StrictInt] = None
|
|
48
54
|
extra_args: Optional[StrictStr] = None
|
|
@@ -53,7 +59,7 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
53
59
|
enable_logging: Optional[StrictBool] = True
|
|
54
60
|
enable_node_model_cache: Optional[StrictBool] = False
|
|
55
61
|
backend_protocol: Optional[BackendProtocol] = None
|
|
56
|
-
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "serving_mode", "worker_pools", "model", "served_model_name", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "extra_args", "hf_token", "env_vars", "endpoint_bearer_token", "endpoint_certificate_authority", "enable_logging", "enable_node_model_cache", "backend_protocol"]
|
|
62
|
+
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "serving_mode", "worker_pools", "communications", "model", "served_model_name", "runtime_version", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "extra_args", "hf_token", "env_vars", "endpoint_bearer_token", "endpoint_certificate_authority", "enable_logging", "enable_node_model_cache", "backend_protocol"]
|
|
57
63
|
|
|
58
64
|
@field_validator('name')
|
|
59
65
|
def name_validate_regular_expression(cls, value):
|
|
@@ -62,6 +68,16 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
62
68
|
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
63
69
|
return value
|
|
64
70
|
|
|
71
|
+
@field_validator('runtime_version')
|
|
72
|
+
def runtime_version_validate_regular_expression(cls, value):
|
|
73
|
+
"""Validates the regular expression"""
|
|
74
|
+
if value is None:
|
|
75
|
+
return value
|
|
76
|
+
|
|
77
|
+
if not re.match(r"^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$", value):
|
|
78
|
+
raise ValueError(r"must validate the regular expression /^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$/")
|
|
79
|
+
return value
|
|
80
|
+
|
|
65
81
|
model_config = ConfigDict(
|
|
66
82
|
populate_by_name=True,
|
|
67
83
|
validate_assignment=True,
|
|
@@ -101,9 +117,19 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
101
117
|
exclude=excluded_fields,
|
|
102
118
|
exclude_none=True,
|
|
103
119
|
)
|
|
120
|
+
# override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
|
|
121
|
+
_items = []
|
|
122
|
+
if self.volume_mounts:
|
|
123
|
+
for _item_volume_mounts in self.volume_mounts:
|
|
124
|
+
if _item_volume_mounts:
|
|
125
|
+
_items.append(_item_volume_mounts.to_dict())
|
|
126
|
+
_dict['volume_mounts'] = _items
|
|
104
127
|
# override the default output from pydantic by calling `to_dict()` of worker_pools
|
|
105
128
|
if self.worker_pools:
|
|
106
129
|
_dict['worker_pools'] = self.worker_pools.to_dict()
|
|
130
|
+
# override the default output from pydantic by calling `to_dict()` of communications
|
|
131
|
+
if self.communications:
|
|
132
|
+
_dict['communications'] = self.communications.to_dict()
|
|
107
133
|
# set to None if max_surge (nullable) is None
|
|
108
134
|
# and model_fields_set contains the field
|
|
109
135
|
if self.max_surge is None and "max_surge" in self.model_fields_set:
|
|
@@ -124,16 +150,36 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
124
150
|
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
125
151
|
_dict['user_annotations'] = None
|
|
126
152
|
|
|
153
|
+
# set to None if priority (nullable) is None
|
|
154
|
+
# and model_fields_set contains the field
|
|
155
|
+
if self.priority is None and "priority" in self.model_fields_set:
|
|
156
|
+
_dict['priority'] = None
|
|
157
|
+
|
|
127
158
|
# set to None if worker_pools (nullable) is None
|
|
128
159
|
# and model_fields_set contains the field
|
|
129
160
|
if self.worker_pools is None and "worker_pools" in self.model_fields_set:
|
|
130
161
|
_dict['worker_pools'] = None
|
|
131
162
|
|
|
163
|
+
# set to None if communications (nullable) is None
|
|
164
|
+
# and model_fields_set contains the field
|
|
165
|
+
if self.communications is None and "communications" in self.model_fields_set:
|
|
166
|
+
_dict['communications'] = None
|
|
167
|
+
|
|
132
168
|
# set to None if served_model_name (nullable) is None
|
|
133
169
|
# and model_fields_set contains the field
|
|
134
170
|
if self.served_model_name is None and "served_model_name" in self.model_fields_set:
|
|
135
171
|
_dict['served_model_name'] = None
|
|
136
172
|
|
|
173
|
+
# set to None if min_replicas (nullable) is None
|
|
174
|
+
# and model_fields_set contains the field
|
|
175
|
+
if self.min_replicas is None and "min_replicas" in self.model_fields_set:
|
|
176
|
+
_dict['min_replicas'] = None
|
|
177
|
+
|
|
178
|
+
# set to None if max_replicas (nullable) is None
|
|
179
|
+
# and model_fields_set contains the field
|
|
180
|
+
if self.max_replicas is None and "max_replicas" in self.model_fields_set:
|
|
181
|
+
_dict['max_replicas'] = None
|
|
182
|
+
|
|
137
183
|
# set to None if concurrency (nullable) is None
|
|
138
184
|
# and model_fields_set contains the field
|
|
139
185
|
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
@@ -183,12 +229,16 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
183
229
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
184
230
|
"user_annotations": obj.get("user_annotations"),
|
|
185
231
|
"chart_revision": obj.get("chart_revision"),
|
|
232
|
+
"volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
|
|
233
|
+
"priority": obj.get("priority"),
|
|
186
234
|
"serving_mode": obj.get("serving_mode"),
|
|
187
235
|
"worker_pools": DynamoWorkerPools.from_dict(obj["worker_pools"]) if obj.get("worker_pools") is not None else None,
|
|
236
|
+
"communications": DynamoCommunicationsInput.from_dict(obj["communications"]) if obj.get("communications") is not None else None,
|
|
188
237
|
"model": obj.get("model"),
|
|
189
238
|
"served_model_name": obj.get("served_model_name"),
|
|
190
|
-
"
|
|
191
|
-
"
|
|
239
|
+
"runtime_version": obj.get("runtime_version"),
|
|
240
|
+
"min_replicas": obj.get("min_replicas"),
|
|
241
|
+
"max_replicas": obj.get("max_replicas"),
|
|
192
242
|
"concurrency": obj.get("concurrency"),
|
|
193
243
|
"cooldown_period": obj.get("cooldown_period"),
|
|
194
244
|
"extra_args": obj.get("extra_args"),
|
|
@@ -32,6 +32,7 @@ class CreateFilesystemVolumeRequest(BaseModel):
|
|
|
32
32
|
backend: StrictStr
|
|
33
33
|
size_gb: Optional[Annotated[int, Field(le=65536, strict=True, ge=1)]] = 100
|
|
34
34
|
storage_class: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = None
|
|
35
|
+
additional_properties: Dict[str, Any] = {}
|
|
35
36
|
__properties: ClassVar[List[str]] = ["name", "cluster_id", "backend", "size_gb", "storage_class"]
|
|
36
37
|
|
|
37
38
|
@field_validator('name')
|
|
@@ -88,8 +89,10 @@ class CreateFilesystemVolumeRequest(BaseModel):
|
|
|
88
89
|
* `None` is only added to the output dict for nullable fields that
|
|
89
90
|
were set at model initialization. Other fields with value `None`
|
|
90
91
|
are ignored.
|
|
92
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
91
93
|
"""
|
|
92
94
|
excluded_fields: Set[str] = set([
|
|
95
|
+
"additional_properties",
|
|
93
96
|
])
|
|
94
97
|
|
|
95
98
|
_dict = self.model_dump(
|
|
@@ -97,6 +100,11 @@ class CreateFilesystemVolumeRequest(BaseModel):
|
|
|
97
100
|
exclude=excluded_fields,
|
|
98
101
|
exclude_none=True,
|
|
99
102
|
)
|
|
103
|
+
# puts key-value pairs in additional_properties in the top level
|
|
104
|
+
if self.additional_properties is not None:
|
|
105
|
+
for _key, _value in self.additional_properties.items():
|
|
106
|
+
_dict[_key] = _value
|
|
107
|
+
|
|
100
108
|
# set to None if storage_class (nullable) is None
|
|
101
109
|
# and model_fields_set contains the field
|
|
102
110
|
if self.storage_class is None and "storage_class" in self.model_fields_set:
|
|
@@ -120,6 +128,11 @@ class CreateFilesystemVolumeRequest(BaseModel):
|
|
|
120
128
|
"size_gb": obj.get("size_gb") if obj.get("size_gb") is not None else 100,
|
|
121
129
|
"storage_class": obj.get("storage_class")
|
|
122
130
|
})
|
|
131
|
+
# store additional fields in additional_properties
|
|
132
|
+
for _key in obj.keys():
|
|
133
|
+
if _key not in cls.__properties:
|
|
134
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
135
|
+
|
|
123
136
|
return _obj
|
|
124
137
|
|
|
125
138
|
|
|
@@ -24,6 +24,7 @@ from platform_api_python_client.models.backend_protocol import BackendProtocol
|
|
|
24
24
|
from platform_api_python_client.models.config_file_mount import ConfigFileMount
|
|
25
25
|
from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials
|
|
26
26
|
from platform_api_python_client.models.metrics_config import MetricsConfig
|
|
27
|
+
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
27
28
|
from typing import Optional, Set
|
|
28
29
|
from typing_extensions import Self
|
|
29
30
|
|
|
@@ -38,12 +39,13 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
38
39
|
hardware_instance_id: StrictInt
|
|
39
40
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
40
41
|
chart_revision: Optional[StrictStr] = None
|
|
42
|
+
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
43
|
+
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
41
44
|
image_url: StrictStr
|
|
42
45
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
43
46
|
port: Annotated[int, Field(le=65535, strict=True, ge=1)]
|
|
44
47
|
min_replicas: StrictInt
|
|
45
48
|
max_replicas: StrictInt
|
|
46
|
-
initial_replicas: Optional[StrictInt] = None
|
|
47
49
|
concurrency: Optional[StrictInt] = None
|
|
48
50
|
cooldown_period: Optional[StrictInt] = None
|
|
49
51
|
healthcheck: Optional[StrictStr] = None
|
|
@@ -58,7 +60,7 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
58
60
|
session_affinity: Optional[StrictBool] = Field(default=False, description="Enable best-effort sticky routing via the `X-Session-Id` request header. Requests carrying the same header value land on the same pod, improving KV cache reuse for agentic workloads. Requests without the header are routed at random. Affinity is NOT durable: scaling, rollouts, restarts, or readiness-probe transitions will remap sessions to different pods. Do not use for irreplaceable in-pod state.")
|
|
59
61
|
config_file: Optional[ConfigFileMount] = None
|
|
60
62
|
metrics: Optional[MetricsConfig] = None
|
|
61
|
-
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "image_url", "image_pull_secret_credentials", "port", "min_replicas", "max_replicas", "
|
|
63
|
+
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "image_url", "image_pull_secret_credentials", "port", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "endpoint_certificate_authority", "hf_token", "backend_protocol", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"]
|
|
62
64
|
|
|
63
65
|
@field_validator('name')
|
|
64
66
|
def name_validate_regular_expression(cls, value):
|
|
@@ -106,6 +108,13 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
106
108
|
exclude=excluded_fields,
|
|
107
109
|
exclude_none=True,
|
|
108
110
|
)
|
|
111
|
+
# override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
|
|
112
|
+
_items = []
|
|
113
|
+
if self.volume_mounts:
|
|
114
|
+
for _item_volume_mounts in self.volume_mounts:
|
|
115
|
+
if _item_volume_mounts:
|
|
116
|
+
_items.append(_item_volume_mounts.to_dict())
|
|
117
|
+
_dict['volume_mounts'] = _items
|
|
109
118
|
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
110
119
|
if self.image_pull_secret_credentials:
|
|
111
120
|
_dict['image_pull_secret_credentials'] = self.image_pull_secret_credentials.to_dict()
|
|
@@ -130,16 +139,16 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
130
139
|
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
131
140
|
_dict['user_annotations'] = None
|
|
132
141
|
|
|
142
|
+
# set to None if priority (nullable) is None
|
|
143
|
+
# and model_fields_set contains the field
|
|
144
|
+
if self.priority is None and "priority" in self.model_fields_set:
|
|
145
|
+
_dict['priority'] = None
|
|
146
|
+
|
|
133
147
|
# set to None if image_pull_secret_credentials (nullable) is None
|
|
134
148
|
# and model_fields_set contains the field
|
|
135
149
|
if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
|
|
136
150
|
_dict['image_pull_secret_credentials'] = None
|
|
137
151
|
|
|
138
|
-
# set to None if initial_replicas (nullable) is None
|
|
139
|
-
# and model_fields_set contains the field
|
|
140
|
-
if self.initial_replicas is None and "initial_replicas" in self.model_fields_set:
|
|
141
|
-
_dict['initial_replicas'] = None
|
|
142
|
-
|
|
143
152
|
# set to None if concurrency (nullable) is None
|
|
144
153
|
# and model_fields_set contains the field
|
|
145
154
|
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
@@ -209,12 +218,13 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
209
218
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
210
219
|
"user_annotations": obj.get("user_annotations"),
|
|
211
220
|
"chart_revision": obj.get("chart_revision"),
|
|
221
|
+
"volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
|
|
222
|
+
"priority": obj.get("priority"),
|
|
212
223
|
"image_url": obj.get("image_url"),
|
|
213
224
|
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
214
225
|
"port": obj.get("port"),
|
|
215
226
|
"min_replicas": obj.get("min_replicas"),
|
|
216
227
|
"max_replicas": obj.get("max_replicas"),
|
|
217
|
-
"initial_replicas": obj.get("initial_replicas"),
|
|
218
228
|
"concurrency": obj.get("concurrency"),
|
|
219
229
|
"cooldown_period": obj.get("cooldown_period"),
|
|
220
230
|
"healthcheck": obj.get("healthcheck"),
|
|
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from platform_api_python_client.models.config_file_mount import ConfigFileMount
|
|
24
24
|
from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials
|
|
25
|
+
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
25
26
|
from typing import Optional, Set
|
|
26
27
|
from typing_extensions import Self
|
|
27
28
|
|
|
@@ -34,6 +35,8 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
34
35
|
hardware_instance_id: StrictInt
|
|
35
36
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
36
37
|
chart_revision: Optional[StrictStr] = None
|
|
38
|
+
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
39
|
+
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
37
40
|
image_url: StrictStr
|
|
38
41
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
39
42
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
@@ -44,7 +47,7 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
44
47
|
active_deadline_seconds: Optional[StrictInt] = None
|
|
45
48
|
enable_logging: Optional[StrictBool] = True
|
|
46
49
|
config_file: Optional[ConfigFileMount] = None
|
|
47
|
-
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "image_url", "image_pull_secret_credentials", "env_vars", "command", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "enable_logging", "config_file"]
|
|
50
|
+
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "image_url", "image_pull_secret_credentials", "env_vars", "command", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "enable_logging", "config_file"]
|
|
48
51
|
|
|
49
52
|
@field_validator('name')
|
|
50
53
|
def name_validate_regular_expression(cls, value):
|
|
@@ -92,6 +95,13 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
92
95
|
exclude=excluded_fields,
|
|
93
96
|
exclude_none=True,
|
|
94
97
|
)
|
|
98
|
+
# override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
|
|
99
|
+
_items = []
|
|
100
|
+
if self.volume_mounts:
|
|
101
|
+
for _item_volume_mounts in self.volume_mounts:
|
|
102
|
+
if _item_volume_mounts:
|
|
103
|
+
_items.append(_item_volume_mounts.to_dict())
|
|
104
|
+
_dict['volume_mounts'] = _items
|
|
95
105
|
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
96
106
|
if self.image_pull_secret_credentials:
|
|
97
107
|
_dict['image_pull_secret_credentials'] = self.image_pull_secret_credentials.to_dict()
|
|
@@ -103,6 +113,11 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
103
113
|
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
104
114
|
_dict['user_annotations'] = None
|
|
105
115
|
|
|
116
|
+
# set to None if priority (nullable) is None
|
|
117
|
+
# and model_fields_set contains the field
|
|
118
|
+
if self.priority is None and "priority" in self.model_fields_set:
|
|
119
|
+
_dict['priority'] = None
|
|
120
|
+
|
|
106
121
|
# set to None if image_pull_secret_credentials (nullable) is None
|
|
107
122
|
# and model_fields_set contains the field
|
|
108
123
|
if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
|
|
@@ -145,6 +160,8 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
145
160
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
146
161
|
"user_annotations": obj.get("user_annotations"),
|
|
147
162
|
"chart_revision": obj.get("chart_revision"),
|
|
163
|
+
"volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
|
|
164
|
+
"priority": obj.get("priority"),
|
|
148
165
|
"image_url": obj.get("image_url"),
|
|
149
166
|
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
150
167
|
"env_vars": obj.get("env_vars"),
|
|
@@ -32,13 +32,12 @@ class CreateObjectVolumeRequest(BaseModel):
|
|
|
32
32
|
cluster_id: StrictInt
|
|
33
33
|
backend: StrictStr
|
|
34
34
|
provider: Optional[ObjectStorageProvider] = None
|
|
35
|
-
bucket: Annotated[str, Field(min_length=3, strict=True, max_length=
|
|
36
|
-
region: Annotated[str, Field(min_length=1, strict=True)]
|
|
37
|
-
prefix: Optional[
|
|
35
|
+
bucket: Annotated[str, Field(min_length=3, strict=True, max_length=255)]
|
|
36
|
+
region: Annotated[str, Field(min_length=1, strict=True, max_length=63)]
|
|
37
|
+
prefix: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None
|
|
38
38
|
read_only: Optional[StrictBool] = False
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
__properties: ClassVar[List[str]] = ["name", "cluster_id", "backend", "provider", "bucket", "region", "prefix", "read_only", "volume_attributes", "mount_options"]
|
|
39
|
+
additional_properties: Dict[str, Any] = {}
|
|
40
|
+
__properties: ClassVar[List[str]] = ["name", "cluster_id", "backend", "provider", "bucket", "region", "prefix", "read_only"]
|
|
42
41
|
|
|
43
42
|
@field_validator('name')
|
|
44
43
|
def name_validate_regular_expression(cls, value):
|
|
@@ -54,6 +53,20 @@ class CreateObjectVolumeRequest(BaseModel):
|
|
|
54
53
|
raise ValueError("must be one of enum values ('object')")
|
|
55
54
|
return value
|
|
56
55
|
|
|
56
|
+
@field_validator('bucket')
|
|
57
|
+
def bucket_validate_regular_expression(cls, value):
|
|
58
|
+
"""Validates the regular expression"""
|
|
59
|
+
if not re.match(r"^(?:[0-9A-Za-z._-]+|arn:[a-z0-9-]+:s3(?:-outposts|-object-lambda)?:[0-9A-Za-z._:\/+=,@-]+)$", value):
|
|
60
|
+
raise ValueError(r"must validate the regular expression /^(?:[0-9A-Za-z._-]+|arn:[a-z0-9-]+:s3(?:-outposts|-object-lambda)?:[0-9A-Za-z._:\/+=,@-]+)$/")
|
|
61
|
+
return value
|
|
62
|
+
|
|
63
|
+
@field_validator('region')
|
|
64
|
+
def region_validate_regular_expression(cls, value):
|
|
65
|
+
"""Validates the regular expression"""
|
|
66
|
+
if not re.match(r"^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$", value):
|
|
67
|
+
raise ValueError(r"must validate the regular expression /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/")
|
|
68
|
+
return value
|
|
69
|
+
|
|
57
70
|
model_config = ConfigDict(
|
|
58
71
|
populate_by_name=True,
|
|
59
72
|
validate_assignment=True,
|
|
@@ -84,8 +97,10 @@ class CreateObjectVolumeRequest(BaseModel):
|
|
|
84
97
|
* `None` is only added to the output dict for nullable fields that
|
|
85
98
|
were set at model initialization. Other fields with value `None`
|
|
86
99
|
are ignored.
|
|
100
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
87
101
|
"""
|
|
88
102
|
excluded_fields: Set[str] = set([
|
|
103
|
+
"additional_properties",
|
|
89
104
|
])
|
|
90
105
|
|
|
91
106
|
_dict = self.model_dump(
|
|
@@ -93,21 +108,16 @@ class CreateObjectVolumeRequest(BaseModel):
|
|
|
93
108
|
exclude=excluded_fields,
|
|
94
109
|
exclude_none=True,
|
|
95
110
|
)
|
|
111
|
+
# puts key-value pairs in additional_properties in the top level
|
|
112
|
+
if self.additional_properties is not None:
|
|
113
|
+
for _key, _value in self.additional_properties.items():
|
|
114
|
+
_dict[_key] = _value
|
|
115
|
+
|
|
96
116
|
# set to None if prefix (nullable) is None
|
|
97
117
|
# and model_fields_set contains the field
|
|
98
118
|
if self.prefix is None and "prefix" in self.model_fields_set:
|
|
99
119
|
_dict['prefix'] = None
|
|
100
120
|
|
|
101
|
-
# set to None if volume_attributes (nullable) is None
|
|
102
|
-
# and model_fields_set contains the field
|
|
103
|
-
if self.volume_attributes is None and "volume_attributes" in self.model_fields_set:
|
|
104
|
-
_dict['volume_attributes'] = None
|
|
105
|
-
|
|
106
|
-
# set to None if mount_options (nullable) is None
|
|
107
|
-
# and model_fields_set contains the field
|
|
108
|
-
if self.mount_options is None and "mount_options" in self.model_fields_set:
|
|
109
|
-
_dict['mount_options'] = None
|
|
110
|
-
|
|
111
121
|
return _dict
|
|
112
122
|
|
|
113
123
|
@classmethod
|
|
@@ -127,10 +137,13 @@ class CreateObjectVolumeRequest(BaseModel):
|
|
|
127
137
|
"bucket": obj.get("bucket"),
|
|
128
138
|
"region": obj.get("region"),
|
|
129
139
|
"prefix": obj.get("prefix"),
|
|
130
|
-
"read_only": obj.get("read_only") if obj.get("read_only") is not None else False
|
|
131
|
-
"volume_attributes": obj.get("volume_attributes"),
|
|
132
|
-
"mount_options": obj.get("mount_options")
|
|
140
|
+
"read_only": obj.get("read_only") if obj.get("read_only") is not None else False
|
|
133
141
|
})
|
|
142
|
+
# store additional fields in additional_properties
|
|
143
|
+
for _key in obj.keys():
|
|
144
|
+
if _key not in cls.__properties:
|
|
145
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
146
|
+
|
|
134
147
|
return _obj
|
|
135
148
|
|
|
136
149
|
|