platform-api-python-client 4.31.0__py3-none-any.whl → 4.37.1__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 +39 -10
- platform_api_python_client/api/external_api.py +6460 -1203
- platform_api_python_client/api_client.py +1 -1
- platform_api_python_client/configuration.py +1 -1
- platform_api_python_client/models/__init__.py +38 -9
- platform_api_python_client/models/ccl_dynamo_pools.py +116 -0
- platform_api_python_client/models/{create_c_serve_v2_deployment_response.py → ccl_main_pools.py} +12 -13
- platform_api_python_client/models/cluster_credential.py +2 -2
- platform_api_python_client/models/create_compute_deployment_request.py +27 -1
- platform_api_python_client/models/create_dynamo_deployment_request.py +42 -1
- platform_api_python_client/models/create_filesystem_volume_request.py +0 -13
- platform_api_python_client/models/create_inference_v3_deployment_request.py +42 -2
- platform_api_python_client/models/create_job_deployment_request.py +27 -1
- platform_api_python_client/models/create_object_volume_request.py +0 -13
- platform_api_python_client/models/deployment_response.py +12 -27
- platform_api_python_client/models/deployment_type.py +14 -0
- platform_api_python_client/models/dynamo_communications_input.py +0 -13
- platform_api_python_client/models/dynamo_communications_output.py +0 -13
- platform_api_python_client/models/dynamo_image.py +105 -0
- platform_api_python_client/models/dynamo_kv_transfer_configuration.py +0 -13
- platform_api_python_client/models/dynamo_weight_transfer_configuration.py +88 -0
- platform_api_python_client/models/dynamo_weight_transfer_policy.py +36 -0
- platform_api_python_client/models/dynamo_worker_pool_config.py +1 -14
- platform_api_python_client/models/dynamo_worker_pools.py +0 -13
- platform_api_python_client/models/env.py +89 -0
- platform_api_python_client/models/get_cluster_response.py +4 -2
- platform_api_python_client/models/get_compute_deployment_response.py +29 -2
- platform_api_python_client/models/get_deployment_usage_response.py +19 -4
- platform_api_python_client/models/get_dynamo_deployment_response.py +43 -1
- platform_api_python_client/models/get_inference_v3_deployment_response.py +43 -2
- platform_api_python_client/models/get_job_deployment_response.py +29 -2
- platform_api_python_client/models/hardware_instance_response.py +6 -2
- platform_api_python_client/models/image.py +112 -0
- platform_api_python_client/models/ingress.py +103 -0
- platform_api_python_client/models/insight_list_item_response.py +108 -0
- platform_api_python_client/models/insight_resource.py +97 -0
- platform_api_python_client/models/insight_resource_type.py +37 -0
- platform_api_python_client/models/insight_response.py +133 -0
- platform_api_python_client/models/insight_severity.py +40 -0
- platform_api_python_client/models/insight_status.py +39 -0
- platform_api_python_client/models/{c_serve_recipe_response.py → insight_status_change_response.py} +28 -24
- platform_api_python_client/models/{c_serve_recipe_perf.py → list_insights_response.py} +16 -19
- platform_api_python_client/models/metric.py +13 -0
- platform_api_python_client/models/pool.py +116 -0
- platform_api_python_client/models/{get_c_serve_v2_deployment_response.py → unified_get_compute_deployment_response.py} +65 -81
- platform_api_python_client/models/unified_get_deployment_logs_response.py +95 -0
- platform_api_python_client/models/{create_c_serve_v3_deployment_response.py → unified_get_deployment_pods_response.py} +8 -13
- platform_api_python_client/models/unified_get_deployment_response.py +164 -0
- platform_api_python_client/models/unified_get_deployment_revision_response.py +109 -0
- platform_api_python_client/models/unified_get_deployment_rollout_response.py +90 -0
- platform_api_python_client/models/unified_get_deployment_usage_response.py +110 -0
- platform_api_python_client/models/unified_get_dynamo_deployment_response.py +218 -0
- platform_api_python_client/models/unified_get_inference_v3_deployment_response.py +228 -0
- platform_api_python_client/models/{get_c_serve_v3_deployment_response.py → unified_get_job_deployment_response.py} +85 -75
- platform_api_python_client/models/{list_c_serve_recipe_response.py → unified_list_deployment_revisions_response.py} +7 -7
- platform_api_python_client/models/unified_update_deployment_rollout_request.py +87 -0
- platform_api_python_client/models/unified_write_compute_deployment_request.py +154 -0
- platform_api_python_client/models/unified_write_deployment_request.py +164 -0
- platform_api_python_client/models/{c_serve_v2_recipe.py → unified_write_deployment_response.py} +27 -27
- platform_api_python_client/models/unified_write_dynamo_deployment_request.py +197 -0
- platform_api_python_client/models/{create_c_serve_v3_deployment_request.py → unified_write_inference_v3_deployment_request.py} +78 -70
- platform_api_python_client/models/unified_write_job_deployment_request.py +183 -0
- platform_api_python_client/models/update_insight_status_request.py +106 -0
- platform_api_python_client/models/upsert_user_vault_item_request.py +1 -1
- platform_api_python_client/models/usage_availability.py +40 -0
- platform_api_python_client/models/usage_component.py +39 -0
- {platform_api_python_client-4.31.0.dist-info → platform_api_python_client-4.37.1.dist-info}/METADATA +1 -1
- {platform_api_python_client-4.31.0.dist-info → platform_api_python_client-4.37.1.dist-info}/RECORD +70 -41
- {platform_api_python_client-4.31.0.dist-info → platform_api_python_client-4.37.1.dist-info}/WHEEL +1 -1
- {platform_api_python_client-4.31.0.dist-info → platform_api_python_client-4.37.1.dist-info}/top_level.txt +0 -0
|
@@ -41,26 +41,31 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
41
41
|
chart_revision: Optional[StrictStr] = None
|
|
42
42
|
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
43
43
|
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
44
|
+
hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
44
45
|
image_url: StrictStr
|
|
45
46
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
47
|
+
image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
48
|
+
image_pull_secret_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = Field(default=None, description="Name of a pre-existing image pull Secret in the deployment namespace. Created, refreshed and deleted externally. Mutually exclusive with inline registry credentials and image_pull_ref. Include on updates to retain it; null clears it.")
|
|
46
49
|
port: Annotated[int, Field(le=65535, strict=True, ge=1)]
|
|
47
50
|
min_replicas: StrictInt
|
|
48
51
|
max_replicas: StrictInt
|
|
49
52
|
concurrency: Optional[StrictInt] = None
|
|
50
|
-
cooldown_period: Optional[
|
|
53
|
+
cooldown_period: Optional[Annotated[int, Field(le=3600, strict=True, ge=0)]] = None
|
|
51
54
|
healthcheck: Optional[StrictStr] = None
|
|
52
55
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
53
56
|
command: Optional[StrictStr] = None
|
|
54
57
|
endpoint_bearer_token: Optional[StrictStr] = None
|
|
58
|
+
bearer_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
55
59
|
endpoint_certificate_authority: Optional[StrictStr] = None
|
|
56
60
|
hf_token: Optional[StrictStr] = None
|
|
61
|
+
env_vars_refs: Optional[Dict[str, Any]] = None
|
|
57
62
|
backend_protocol: Optional[BackendProtocol] = None
|
|
58
63
|
enable_logging: Optional[StrictBool] = False
|
|
59
64
|
enable_node_model_cache: Optional[StrictBool] = False
|
|
60
65
|
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.")
|
|
61
66
|
config_file: Optional[ConfigFileMount] = None
|
|
62
67
|
metrics: Optional[MetricsConfig] = None
|
|
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"]
|
|
68
|
+
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "hf_token_ref", "image_url", "image_pull_secret_credentials", "image_pull_ref", "image_pull_secret_name", "port", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "bearer_token_ref", "endpoint_certificate_authority", "hf_token", "env_vars_refs", "backend_protocol", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"]
|
|
64
69
|
|
|
65
70
|
@field_validator('name')
|
|
66
71
|
def name_validate_regular_expression(cls, value):
|
|
@@ -69,6 +74,16 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
69
74
|
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
70
75
|
return value
|
|
71
76
|
|
|
77
|
+
@field_validator('image_pull_secret_name')
|
|
78
|
+
def image_pull_secret_name_validate_regular_expression(cls, value):
|
|
79
|
+
"""Validates the regular expression"""
|
|
80
|
+
if value is None:
|
|
81
|
+
return value
|
|
82
|
+
|
|
83
|
+
if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
|
|
84
|
+
raise ValueError(r"must validate the regular expression /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/")
|
|
85
|
+
return value
|
|
86
|
+
|
|
72
87
|
model_config = ConfigDict(
|
|
73
88
|
populate_by_name=True,
|
|
74
89
|
validate_assignment=True,
|
|
@@ -144,11 +159,26 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
144
159
|
if self.priority is None and "priority" in self.model_fields_set:
|
|
145
160
|
_dict['priority'] = None
|
|
146
161
|
|
|
162
|
+
# set to None if hf_token_ref (nullable) is None
|
|
163
|
+
# and model_fields_set contains the field
|
|
164
|
+
if self.hf_token_ref is None and "hf_token_ref" in self.model_fields_set:
|
|
165
|
+
_dict['hf_token_ref'] = None
|
|
166
|
+
|
|
147
167
|
# set to None if image_pull_secret_credentials (nullable) is None
|
|
148
168
|
# and model_fields_set contains the field
|
|
149
169
|
if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
|
|
150
170
|
_dict['image_pull_secret_credentials'] = None
|
|
151
171
|
|
|
172
|
+
# set to None if image_pull_ref (nullable) is None
|
|
173
|
+
# and model_fields_set contains the field
|
|
174
|
+
if self.image_pull_ref is None and "image_pull_ref" in self.model_fields_set:
|
|
175
|
+
_dict['image_pull_ref'] = None
|
|
176
|
+
|
|
177
|
+
# set to None if image_pull_secret_name (nullable) is None
|
|
178
|
+
# and model_fields_set contains the field
|
|
179
|
+
if self.image_pull_secret_name is None and "image_pull_secret_name" in self.model_fields_set:
|
|
180
|
+
_dict['image_pull_secret_name'] = None
|
|
181
|
+
|
|
152
182
|
# set to None if concurrency (nullable) is None
|
|
153
183
|
# and model_fields_set contains the field
|
|
154
184
|
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
@@ -179,6 +209,11 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
179
209
|
if self.endpoint_bearer_token is None and "endpoint_bearer_token" in self.model_fields_set:
|
|
180
210
|
_dict['endpoint_bearer_token'] = None
|
|
181
211
|
|
|
212
|
+
# set to None if bearer_token_ref (nullable) is None
|
|
213
|
+
# and model_fields_set contains the field
|
|
214
|
+
if self.bearer_token_ref is None and "bearer_token_ref" in self.model_fields_set:
|
|
215
|
+
_dict['bearer_token_ref'] = None
|
|
216
|
+
|
|
182
217
|
# set to None if endpoint_certificate_authority (nullable) is None
|
|
183
218
|
# and model_fields_set contains the field
|
|
184
219
|
if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
|
|
@@ -220,8 +255,11 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
220
255
|
"chart_revision": obj.get("chart_revision"),
|
|
221
256
|
"volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
|
|
222
257
|
"priority": obj.get("priority"),
|
|
258
|
+
"hf_token_ref": obj.get("hf_token_ref"),
|
|
223
259
|
"image_url": obj.get("image_url"),
|
|
224
260
|
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
261
|
+
"image_pull_ref": obj.get("image_pull_ref"),
|
|
262
|
+
"image_pull_secret_name": obj.get("image_pull_secret_name"),
|
|
225
263
|
"port": obj.get("port"),
|
|
226
264
|
"min_replicas": obj.get("min_replicas"),
|
|
227
265
|
"max_replicas": obj.get("max_replicas"),
|
|
@@ -231,8 +269,10 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
231
269
|
"env_vars": obj.get("env_vars"),
|
|
232
270
|
"command": obj.get("command"),
|
|
233
271
|
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
|
|
272
|
+
"bearer_token_ref": obj.get("bearer_token_ref"),
|
|
234
273
|
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
235
274
|
"hf_token": obj.get("hf_token"),
|
|
275
|
+
"env_vars_refs": obj.get("env_vars_refs"),
|
|
236
276
|
"backend_protocol": obj.get("backend_protocol"),
|
|
237
277
|
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else False,
|
|
238
278
|
"enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False,
|
|
@@ -39,7 +39,10 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
39
39
|
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
40
40
|
image_url: StrictStr
|
|
41
41
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
42
|
+
image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
43
|
+
image_pull_secret_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = Field(default=None, description="Name of a pre-existing image pull Secret in the deployment namespace. Created, refreshed and deleted externally. Mutually exclusive with inline registry credentials and image_pull_ref. Include on updates to retain it; null clears it.")
|
|
42
44
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
45
|
+
env_vars_refs: Optional[Dict[str, Any]] = None
|
|
43
46
|
command: Optional[StrictStr] = None
|
|
44
47
|
completions: Optional[StrictInt] = 1
|
|
45
48
|
parallelism: Optional[StrictInt] = 1
|
|
@@ -47,7 +50,7 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
47
50
|
active_deadline_seconds: Optional[StrictInt] = None
|
|
48
51
|
enable_logging: Optional[StrictBool] = True
|
|
49
52
|
config_file: Optional[ConfigFileMount] = None
|
|
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"]
|
|
53
|
+
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "image_url", "image_pull_secret_credentials", "image_pull_ref", "image_pull_secret_name", "env_vars", "env_vars_refs", "command", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "enable_logging", "config_file"]
|
|
51
54
|
|
|
52
55
|
@field_validator('name')
|
|
53
56
|
def name_validate_regular_expression(cls, value):
|
|
@@ -56,6 +59,16 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
56
59
|
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
57
60
|
return value
|
|
58
61
|
|
|
62
|
+
@field_validator('image_pull_secret_name')
|
|
63
|
+
def image_pull_secret_name_validate_regular_expression(cls, value):
|
|
64
|
+
"""Validates the regular expression"""
|
|
65
|
+
if value is None:
|
|
66
|
+
return value
|
|
67
|
+
|
|
68
|
+
if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
|
|
69
|
+
raise ValueError(r"must validate the regular expression /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/")
|
|
70
|
+
return value
|
|
71
|
+
|
|
59
72
|
model_config = ConfigDict(
|
|
60
73
|
populate_by_name=True,
|
|
61
74
|
validate_assignment=True,
|
|
@@ -123,6 +136,16 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
123
136
|
if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
|
|
124
137
|
_dict['image_pull_secret_credentials'] = None
|
|
125
138
|
|
|
139
|
+
# set to None if image_pull_ref (nullable) is None
|
|
140
|
+
# and model_fields_set contains the field
|
|
141
|
+
if self.image_pull_ref is None and "image_pull_ref" in self.model_fields_set:
|
|
142
|
+
_dict['image_pull_ref'] = None
|
|
143
|
+
|
|
144
|
+
# set to None if image_pull_secret_name (nullable) is None
|
|
145
|
+
# and model_fields_set contains the field
|
|
146
|
+
if self.image_pull_secret_name is None and "image_pull_secret_name" in self.model_fields_set:
|
|
147
|
+
_dict['image_pull_secret_name'] = None
|
|
148
|
+
|
|
126
149
|
# set to None if env_vars (nullable) is None
|
|
127
150
|
# and model_fields_set contains the field
|
|
128
151
|
if self.env_vars is None and "env_vars" in self.model_fields_set:
|
|
@@ -164,7 +187,10 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
164
187
|
"priority": obj.get("priority"),
|
|
165
188
|
"image_url": obj.get("image_url"),
|
|
166
189
|
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
190
|
+
"image_pull_ref": obj.get("image_pull_ref"),
|
|
191
|
+
"image_pull_secret_name": obj.get("image_pull_secret_name"),
|
|
167
192
|
"env_vars": obj.get("env_vars"),
|
|
193
|
+
"env_vars_refs": obj.get("env_vars_refs"),
|
|
168
194
|
"command": obj.get("command"),
|
|
169
195
|
"completions": obj.get("completions") if obj.get("completions") is not None else 1,
|
|
170
196
|
"parallelism": obj.get("parallelism") if obj.get("parallelism") is not None else 1,
|
|
@@ -36,7 +36,6 @@ class CreateObjectVolumeRequest(BaseModel):
|
|
|
36
36
|
region: Annotated[str, Field(min_length=1, strict=True, max_length=63)]
|
|
37
37
|
prefix: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None
|
|
38
38
|
read_only: Optional[StrictBool] = False
|
|
39
|
-
additional_properties: Dict[str, Any] = {}
|
|
40
39
|
__properties: ClassVar[List[str]] = ["name", "cluster_id", "backend", "provider", "bucket", "region", "prefix", "read_only"]
|
|
41
40
|
|
|
42
41
|
@field_validator('name')
|
|
@@ -97,10 +96,8 @@ class CreateObjectVolumeRequest(BaseModel):
|
|
|
97
96
|
* `None` is only added to the output dict for nullable fields that
|
|
98
97
|
were set at model initialization. Other fields with value `None`
|
|
99
98
|
are ignored.
|
|
100
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
101
99
|
"""
|
|
102
100
|
excluded_fields: Set[str] = set([
|
|
103
|
-
"additional_properties",
|
|
104
101
|
])
|
|
105
102
|
|
|
106
103
|
_dict = self.model_dump(
|
|
@@ -108,11 +105,6 @@ class CreateObjectVolumeRequest(BaseModel):
|
|
|
108
105
|
exclude=excluded_fields,
|
|
109
106
|
exclude_none=True,
|
|
110
107
|
)
|
|
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
|
-
|
|
116
108
|
# set to None if prefix (nullable) is None
|
|
117
109
|
# and model_fields_set contains the field
|
|
118
110
|
if self.prefix is None and "prefix" in self.model_fields_set:
|
|
@@ -139,11 +131,6 @@ class CreateObjectVolumeRequest(BaseModel):
|
|
|
139
131
|
"prefix": obj.get("prefix"),
|
|
140
132
|
"read_only": obj.get("read_only") if obj.get("read_only") is not None else False
|
|
141
133
|
})
|
|
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
|
-
|
|
147
134
|
return _obj
|
|
148
135
|
|
|
149
136
|
|
|
@@ -19,7 +19,6 @@ import pprint
|
|
|
19
19
|
import re # noqa: F401
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
21
21
|
from typing import Optional
|
|
22
|
-
from platform_api_python_client.models.get_c_serve_v3_deployment_response import GetCServeV3DeploymentResponse
|
|
23
22
|
from platform_api_python_client.models.get_compute_deployment_response import GetComputeDeploymentResponse
|
|
24
23
|
from platform_api_python_client.models.get_dynamo_deployment_response import GetDynamoDeploymentResponse
|
|
25
24
|
from platform_api_python_client.models.get_inference_v3_deployment_response import GetInferenceV3DeploymentResponse
|
|
@@ -28,7 +27,7 @@ from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
|
28
27
|
from typing_extensions import Literal, Self
|
|
29
28
|
from pydantic import Field
|
|
30
29
|
|
|
31
|
-
DEPLOYMENTRESPONSE_ANY_OF_SCHEMAS = ["
|
|
30
|
+
DEPLOYMENTRESPONSE_ANY_OF_SCHEMAS = ["GetComputeDeploymentResponse", "GetDynamoDeploymentResponse", "GetInferenceV3DeploymentResponse", "GetJobDeploymentResponse"]
|
|
32
31
|
|
|
33
32
|
class DeploymentResponse(BaseModel):
|
|
34
33
|
"""
|
|
@@ -37,19 +36,17 @@ class DeploymentResponse(BaseModel):
|
|
|
37
36
|
|
|
38
37
|
# data type: GetDynamoDeploymentResponse
|
|
39
38
|
anyof_schema_1_validator: Optional[GetDynamoDeploymentResponse] = None
|
|
40
|
-
# data type: GetCServeV3DeploymentResponse
|
|
41
|
-
anyof_schema_2_validator: Optional[GetCServeV3DeploymentResponse] = None
|
|
42
39
|
# data type: GetInferenceV3DeploymentResponse
|
|
43
|
-
|
|
40
|
+
anyof_schema_2_validator: Optional[GetInferenceV3DeploymentResponse] = None
|
|
44
41
|
# data type: GetComputeDeploymentResponse
|
|
45
|
-
|
|
42
|
+
anyof_schema_3_validator: Optional[GetComputeDeploymentResponse] = None
|
|
46
43
|
# data type: GetJobDeploymentResponse
|
|
47
|
-
|
|
44
|
+
anyof_schema_4_validator: Optional[GetJobDeploymentResponse] = None
|
|
48
45
|
if TYPE_CHECKING:
|
|
49
|
-
actual_instance: Optional[Union[
|
|
46
|
+
actual_instance: Optional[Union[GetComputeDeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse, GetJobDeploymentResponse]] = None
|
|
50
47
|
else:
|
|
51
48
|
actual_instance: Any = None
|
|
52
|
-
any_of_schemas: Set[str] = { "
|
|
49
|
+
any_of_schemas: Set[str] = { "GetComputeDeploymentResponse", "GetDynamoDeploymentResponse", "GetInferenceV3DeploymentResponse", "GetJobDeploymentResponse" }
|
|
53
50
|
|
|
54
51
|
model_config = {
|
|
55
52
|
"validate_assignment": True,
|
|
@@ -76,12 +73,6 @@ class DeploymentResponse(BaseModel):
|
|
|
76
73
|
else:
|
|
77
74
|
return v
|
|
78
75
|
|
|
79
|
-
# validate data type: GetCServeV3DeploymentResponse
|
|
80
|
-
if not isinstance(v, GetCServeV3DeploymentResponse):
|
|
81
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `GetCServeV3DeploymentResponse`")
|
|
82
|
-
else:
|
|
83
|
-
return v
|
|
84
|
-
|
|
85
76
|
# validate data type: GetInferenceV3DeploymentResponse
|
|
86
77
|
if not isinstance(v, GetInferenceV3DeploymentResponse):
|
|
87
78
|
error_messages.append(f"Error! Input type `{type(v)}` is not `GetInferenceV3DeploymentResponse`")
|
|
@@ -102,7 +93,7 @@ class DeploymentResponse(BaseModel):
|
|
|
102
93
|
|
|
103
94
|
if error_messages:
|
|
104
95
|
# no match
|
|
105
|
-
raise ValueError("No match found when setting the actual_instance in DeploymentResponse with anyOf schemas:
|
|
96
|
+
raise ValueError("No match found when setting the actual_instance in DeploymentResponse with anyOf schemas: GetComputeDeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse, GetJobDeploymentResponse. Details: " + ", ".join(error_messages))
|
|
106
97
|
else:
|
|
107
98
|
return v
|
|
108
99
|
|
|
@@ -121,25 +112,19 @@ class DeploymentResponse(BaseModel):
|
|
|
121
112
|
return instance
|
|
122
113
|
except (ValidationError, ValueError) as e:
|
|
123
114
|
error_messages.append(str(e))
|
|
124
|
-
# anyof_schema_2_validator: Optional[
|
|
125
|
-
try:
|
|
126
|
-
instance.actual_instance = GetCServeV3DeploymentResponse.from_json(json_str)
|
|
127
|
-
return instance
|
|
128
|
-
except (ValidationError, ValueError) as e:
|
|
129
|
-
error_messages.append(str(e))
|
|
130
|
-
# anyof_schema_3_validator: Optional[GetInferenceV3DeploymentResponse] = None
|
|
115
|
+
# anyof_schema_2_validator: Optional[GetInferenceV3DeploymentResponse] = None
|
|
131
116
|
try:
|
|
132
117
|
instance.actual_instance = GetInferenceV3DeploymentResponse.from_json(json_str)
|
|
133
118
|
return instance
|
|
134
119
|
except (ValidationError, ValueError) as e:
|
|
135
120
|
error_messages.append(str(e))
|
|
136
|
-
#
|
|
121
|
+
# anyof_schema_3_validator: Optional[GetComputeDeploymentResponse] = None
|
|
137
122
|
try:
|
|
138
123
|
instance.actual_instance = GetComputeDeploymentResponse.from_json(json_str)
|
|
139
124
|
return instance
|
|
140
125
|
except (ValidationError, ValueError) as e:
|
|
141
126
|
error_messages.append(str(e))
|
|
142
|
-
#
|
|
127
|
+
# anyof_schema_4_validator: Optional[GetJobDeploymentResponse] = None
|
|
143
128
|
try:
|
|
144
129
|
instance.actual_instance = GetJobDeploymentResponse.from_json(json_str)
|
|
145
130
|
return instance
|
|
@@ -148,7 +133,7 @@ class DeploymentResponse(BaseModel):
|
|
|
148
133
|
|
|
149
134
|
if error_messages:
|
|
150
135
|
# no match
|
|
151
|
-
raise ValueError("No match found when deserializing the JSON string into DeploymentResponse with anyOf schemas:
|
|
136
|
+
raise ValueError("No match found when deserializing the JSON string into DeploymentResponse with anyOf schemas: GetComputeDeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse, GetJobDeploymentResponse. Details: " + ", ".join(error_messages))
|
|
152
137
|
else:
|
|
153
138
|
return instance
|
|
154
139
|
|
|
@@ -162,7 +147,7 @@ class DeploymentResponse(BaseModel):
|
|
|
162
147
|
else:
|
|
163
148
|
return json.dumps(self.actual_instance)
|
|
164
149
|
|
|
165
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any],
|
|
150
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], GetComputeDeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse, GetJobDeploymentResponse]]:
|
|
166
151
|
"""Returns the dict representation of the actual instance"""
|
|
167
152
|
if self.actual_instance is None:
|
|
168
153
|
return None
|
|
@@ -40,10 +40,24 @@ class DeploymentType(str, Enum):
|
|
|
40
40
|
RAG = 'rag'
|
|
41
41
|
JOB = 'job'
|
|
42
42
|
DYNAMO = 'dynamo'
|
|
43
|
+
CCL_COMPUTE = 'ccl_compute'
|
|
44
|
+
CCL_INFERENCE = 'ccl_inference'
|
|
45
|
+
CCL_JOB = 'ccl_job'
|
|
46
|
+
CCL_DYNAMO = 'ccl_dynamo'
|
|
43
47
|
|
|
44
48
|
@classmethod
|
|
45
49
|
def from_json(cls, json_str: str) -> Self:
|
|
46
50
|
"""Create an instance of DeploymentType from a JSON string"""
|
|
47
51
|
return cls(json.loads(json_str))
|
|
48
52
|
|
|
53
|
+
@classmethod
|
|
54
|
+
def _missing_(cls, value):
|
|
55
|
+
"""Accept a value the server added after this client was generated; it keeps the raw value."""
|
|
56
|
+
if not isinstance(value, str):
|
|
57
|
+
return None
|
|
58
|
+
member = str.__new__(cls, value)
|
|
59
|
+
member._name_ = None
|
|
60
|
+
member._value_ = value
|
|
61
|
+
return member
|
|
62
|
+
|
|
49
63
|
|
|
@@ -28,7 +28,6 @@ class DynamoCommunicationsInput(BaseModel):
|
|
|
28
28
|
DynamoCommunicationsInput
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
kv_transfer: DynamoKvTransferConfiguration
|
|
31
|
-
additional_properties: Dict[str, Any] = {}
|
|
32
31
|
__properties: ClassVar[List[str]] = ["kv_transfer"]
|
|
33
32
|
|
|
34
33
|
model_config = ConfigDict(
|
|
@@ -61,10 +60,8 @@ class DynamoCommunicationsInput(BaseModel):
|
|
|
61
60
|
* `None` is only added to the output dict for nullable fields that
|
|
62
61
|
were set at model initialization. Other fields with value `None`
|
|
63
62
|
are ignored.
|
|
64
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
65
63
|
"""
|
|
66
64
|
excluded_fields: Set[str] = set([
|
|
67
|
-
"additional_properties",
|
|
68
65
|
])
|
|
69
66
|
|
|
70
67
|
_dict = self.model_dump(
|
|
@@ -75,11 +72,6 @@ class DynamoCommunicationsInput(BaseModel):
|
|
|
75
72
|
# override the default output from pydantic by calling `to_dict()` of kv_transfer
|
|
76
73
|
if self.kv_transfer:
|
|
77
74
|
_dict['kv_transfer'] = self.kv_transfer.to_dict()
|
|
78
|
-
# puts key-value pairs in additional_properties in the top level
|
|
79
|
-
if self.additional_properties is not None:
|
|
80
|
-
for _key, _value in self.additional_properties.items():
|
|
81
|
-
_dict[_key] = _value
|
|
82
|
-
|
|
83
75
|
return _dict
|
|
84
76
|
|
|
85
77
|
@classmethod
|
|
@@ -94,11 +86,6 @@ class DynamoCommunicationsInput(BaseModel):
|
|
|
94
86
|
_obj = cls.model_validate({
|
|
95
87
|
"kv_transfer": DynamoKvTransferConfiguration.from_dict(obj["kv_transfer"]) if obj.get("kv_transfer") is not None else None
|
|
96
88
|
})
|
|
97
|
-
# store additional fields in additional_properties
|
|
98
|
-
for _key in obj.keys():
|
|
99
|
-
if _key not in cls.__properties:
|
|
100
|
-
_obj.additional_properties[_key] = obj.get(_key)
|
|
101
|
-
|
|
102
89
|
return _obj
|
|
103
90
|
|
|
104
91
|
|
|
@@ -28,7 +28,6 @@ class DynamoCommunicationsOutput(BaseModel):
|
|
|
28
28
|
DynamoCommunicationsOutput
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
kv_transfer: DynamoKvTransferConfiguration
|
|
31
|
-
additional_properties: Dict[str, Any] = {}
|
|
32
31
|
__properties: ClassVar[List[str]] = ["kv_transfer"]
|
|
33
32
|
|
|
34
33
|
model_config = ConfigDict(
|
|
@@ -61,10 +60,8 @@ class DynamoCommunicationsOutput(BaseModel):
|
|
|
61
60
|
* `None` is only added to the output dict for nullable fields that
|
|
62
61
|
were set at model initialization. Other fields with value `None`
|
|
63
62
|
are ignored.
|
|
64
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
65
63
|
"""
|
|
66
64
|
excluded_fields: Set[str] = set([
|
|
67
|
-
"additional_properties",
|
|
68
65
|
])
|
|
69
66
|
|
|
70
67
|
_dict = self.model_dump(
|
|
@@ -75,11 +72,6 @@ class DynamoCommunicationsOutput(BaseModel):
|
|
|
75
72
|
# override the default output from pydantic by calling `to_dict()` of kv_transfer
|
|
76
73
|
if self.kv_transfer:
|
|
77
74
|
_dict['kv_transfer'] = self.kv_transfer.to_dict()
|
|
78
|
-
# puts key-value pairs in additional_properties in the top level
|
|
79
|
-
if self.additional_properties is not None:
|
|
80
|
-
for _key, _value in self.additional_properties.items():
|
|
81
|
-
_dict[_key] = _value
|
|
82
|
-
|
|
83
75
|
return _dict
|
|
84
76
|
|
|
85
77
|
@classmethod
|
|
@@ -94,11 +86,6 @@ class DynamoCommunicationsOutput(BaseModel):
|
|
|
94
86
|
_obj = cls.model_validate({
|
|
95
87
|
"kv_transfer": DynamoKvTransferConfiguration.from_dict(obj["kv_transfer"]) if obj.get("kv_transfer") is not None else None
|
|
96
88
|
})
|
|
97
|
-
# store additional fields in additional_properties
|
|
98
|
-
for _key in obj.keys():
|
|
99
|
-
if _key not in cls.__properties:
|
|
100
|
-
_obj.additional_properties[_key] = obj.get(_key)
|
|
101
|
-
|
|
102
89
|
return _obj
|
|
103
90
|
|
|
104
91
|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class DynamoImage(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
DynamoImage
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
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.")
|
|
31
|
+
pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["runtime_version", "pull_ref"]
|
|
33
|
+
|
|
34
|
+
@field_validator('runtime_version')
|
|
35
|
+
def runtime_version_validate_regular_expression(cls, value):
|
|
36
|
+
"""Validates the regular expression"""
|
|
37
|
+
if value is None:
|
|
38
|
+
return value
|
|
39
|
+
|
|
40
|
+
if not re.match(r"^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$", value):
|
|
41
|
+
raise ValueError(r"must validate the regular expression /^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$/")
|
|
42
|
+
return value
|
|
43
|
+
|
|
44
|
+
model_config = ConfigDict(
|
|
45
|
+
populate_by_name=True,
|
|
46
|
+
validate_assignment=True,
|
|
47
|
+
protected_namespaces=(),
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def to_str(self) -> str:
|
|
52
|
+
"""Returns the string representation of the model using alias"""
|
|
53
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
54
|
+
|
|
55
|
+
def to_json(self) -> str:
|
|
56
|
+
"""Returns the JSON representation of the model using alias"""
|
|
57
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
58
|
+
return json.dumps(self.to_dict())
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
62
|
+
"""Create an instance of DynamoImage from a JSON string"""
|
|
63
|
+
return cls.from_dict(json.loads(json_str))
|
|
64
|
+
|
|
65
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
66
|
+
"""Return the dictionary representation of the model using alias.
|
|
67
|
+
|
|
68
|
+
This has the following differences from calling pydantic's
|
|
69
|
+
`self.model_dump(by_alias=True)`:
|
|
70
|
+
|
|
71
|
+
* `None` is only added to the output dict for nullable fields that
|
|
72
|
+
were set at model initialization. Other fields with value `None`
|
|
73
|
+
are ignored.
|
|
74
|
+
"""
|
|
75
|
+
excluded_fields: Set[str] = set([
|
|
76
|
+
])
|
|
77
|
+
|
|
78
|
+
_dict = self.model_dump(
|
|
79
|
+
by_alias=True,
|
|
80
|
+
exclude=excluded_fields,
|
|
81
|
+
exclude_none=True,
|
|
82
|
+
)
|
|
83
|
+
# set to None if pull_ref (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.pull_ref is None and "pull_ref" in self.model_fields_set:
|
|
86
|
+
_dict['pull_ref'] = None
|
|
87
|
+
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of DynamoImage from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"runtime_version": obj.get("runtime_version"),
|
|
101
|
+
"pull_ref": obj.get("pull_ref")
|
|
102
|
+
})
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -28,7 +28,6 @@ class DynamoKvTransferConfiguration(BaseModel):
|
|
|
28
28
|
DynamoKvTransferConfiguration
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
policy: DynamoKvTransferPolicy = Field(description="allow_tcp uses platform-managed NIXL/UCX and permits TCP; it does not force TCP or guarantee RDMA. require_gpu_direct_rdma selects EKS EFA device requirements and GPU-buffer transfer over LIBFABRIC without TCP fallback. A compatible EFA chart and runtime image are prerequisites; the API does not validate their capabilities. Device availability is resolved during scheduling.")
|
|
31
|
-
additional_properties: Dict[str, Any] = {}
|
|
32
31
|
__properties: ClassVar[List[str]] = ["policy"]
|
|
33
32
|
|
|
34
33
|
model_config = ConfigDict(
|
|
@@ -61,10 +60,8 @@ class DynamoKvTransferConfiguration(BaseModel):
|
|
|
61
60
|
* `None` is only added to the output dict for nullable fields that
|
|
62
61
|
were set at model initialization. Other fields with value `None`
|
|
63
62
|
are ignored.
|
|
64
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
65
63
|
"""
|
|
66
64
|
excluded_fields: Set[str] = set([
|
|
67
|
-
"additional_properties",
|
|
68
65
|
])
|
|
69
66
|
|
|
70
67
|
_dict = self.model_dump(
|
|
@@ -72,11 +69,6 @@ class DynamoKvTransferConfiguration(BaseModel):
|
|
|
72
69
|
exclude=excluded_fields,
|
|
73
70
|
exclude_none=True,
|
|
74
71
|
)
|
|
75
|
-
# puts key-value pairs in additional_properties in the top level
|
|
76
|
-
if self.additional_properties is not None:
|
|
77
|
-
for _key, _value in self.additional_properties.items():
|
|
78
|
-
_dict[_key] = _value
|
|
79
|
-
|
|
80
72
|
return _dict
|
|
81
73
|
|
|
82
74
|
@classmethod
|
|
@@ -91,11 +83,6 @@ class DynamoKvTransferConfiguration(BaseModel):
|
|
|
91
83
|
_obj = cls.model_validate({
|
|
92
84
|
"policy": obj.get("policy")
|
|
93
85
|
})
|
|
94
|
-
# store additional fields in additional_properties
|
|
95
|
-
for _key in obj.keys():
|
|
96
|
-
if _key not in cls.__properties:
|
|
97
|
-
_obj.additional_properties[_key] = obj.get(_key)
|
|
98
|
-
|
|
99
86
|
return _obj
|
|
100
87
|
|
|
101
88
|
|