platform-api-python-client 4.28.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 +43 -10
- platform_api_python_client/api/external_api.py +6332 -1348
- platform_api_python_client/api_client.py +1 -1
- platform_api_python_client/configuration.py +1 -1
- platform_api_python_client/models/__init__.py +42 -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/cloud_provider.py +5 -0
- platform_api_python_client/models/cluster_credential.py +2 -2
- platform_api_python_client/models/create_compute_deployment_request.py +40 -7
- platform_api_python_client/models/create_dynamo_deployment_request.py +97 -6
- platform_api_python_client/models/create_inference_v3_deployment_request.py +59 -2
- platform_api_python_client/models/create_job_deployment_request.py +43 -10
- platform_api_python_client/models/create_object_volume_request.py +19 -19
- platform_api_python_client/models/deployment_response.py +23 -23
- platform_api_python_client/models/deployment_type.py +14 -0
- platform_api_python_client/models/{c_serve_recipe_perf.py → dynamo_communications_input.py} +12 -19
- platform_api_python_client/models/dynamo_communications_output.py +91 -0
- platform_api_python_client/models/dynamo_image.py +105 -0
- platform_api_python_client/models/dynamo_kv_transfer_configuration.py +88 -0
- platform_api_python_client/models/dynamo_kv_transfer_policy.py +37 -0
- 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 +37 -17
- platform_api_python_client/models/dynamo_worker_pools.py +23 -16
- 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 +45 -4
- platform_api_python_client/models/get_deployment_response.py +26 -2
- platform_api_python_client/models/get_deployment_usage_response.py +19 -4
- platform_api_python_client/models/get_dynamo_deployment_response.py +89 -5
- platform_api_python_client/models/get_inference_deployment_response.py +25 -1
- platform_api_python_client/models/get_inference_v3_deployment_response.py +67 -2
- platform_api_python_client/models/get_job_deployment_response.py +52 -11
- platform_api_python_client/models/get_object_volume_response.py +2 -16
- platform_api_python_client/models/hardware_instance_response.py +6 -4
- 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/list_insights_response.py +95 -0
- platform_api_python_client/models/metric.py +13 -0
- platform_api_python_client/models/pool.py +116 -0
- platform_api_python_client/models/unified_get_compute_deployment_response.py +177 -0
- 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/unified_get_job_deployment_response.py +204 -0
- 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/unified_write_inference_v3_deployment_request.py +207 -0
- 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/models/validation_error.py +12 -3
- platform_api_python_client/models/volume_mount.py +1 -1
- {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/METADATA +1 -1
- {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/RECORD +76 -43
- {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/WHEEL +1 -1
- platform_api_python_client/models/create_c_serve_v3_deployment_request.py +0 -182
- platform_api_python_client/models/get_c_serve_v2_deployment_response.py +0 -169
- platform_api_python_client/models/get_c_serve_v3_deployment_response.py +0 -170
- {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/top_level.txt +0 -0
|
@@ -1,182 +0,0 @@
|
|
|
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, StrictBool, StrictInt, StrictStr, field_validator
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from typing_extensions import Annotated
|
|
23
|
-
from platform_api_python_client.models.c_serve_v2_recipe import CServeV2Recipe
|
|
24
|
-
from typing import Optional, Set
|
|
25
|
-
from typing_extensions import Self
|
|
26
|
-
|
|
27
|
-
class CreateCServeV3DeploymentRequest(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
CreateCServeV3DeploymentRequest
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
max_surge: Optional[StrictInt] = None
|
|
32
|
-
max_unavailable: Optional[StrictInt] = None
|
|
33
|
-
name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
|
|
34
|
-
cluster_id: StrictInt
|
|
35
|
-
hardware_instance_id: StrictInt
|
|
36
|
-
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
37
|
-
chart_revision: Optional[StrictStr] = None
|
|
38
|
-
recipe: CServeV2Recipe
|
|
39
|
-
cserve_version: Optional[StrictStr] = None
|
|
40
|
-
hf_token: Optional[StrictStr] = None
|
|
41
|
-
endpoint_bearer_token: Optional[StrictStr] = None
|
|
42
|
-
endpoint_certificate_authority: Optional[StrictStr] = None
|
|
43
|
-
min_replicas: StrictInt
|
|
44
|
-
max_replicas: StrictInt
|
|
45
|
-
concurrency: Optional[StrictInt] = None
|
|
46
|
-
cooldown_period: Optional[StrictInt] = None
|
|
47
|
-
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
48
|
-
enable_logging: Optional[StrictBool] = True
|
|
49
|
-
enable_node_model_cache: Optional[StrictBool] = False
|
|
50
|
-
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.")
|
|
51
|
-
__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", "concurrency", "cooldown_period", "env_vars", "enable_logging", "enable_node_model_cache", "session_affinity"]
|
|
52
|
-
|
|
53
|
-
@field_validator('name')
|
|
54
|
-
def name_validate_regular_expression(cls, value):
|
|
55
|
-
"""Validates the regular expression"""
|
|
56
|
-
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
57
|
-
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
58
|
-
return value
|
|
59
|
-
|
|
60
|
-
model_config = ConfigDict(
|
|
61
|
-
populate_by_name=True,
|
|
62
|
-
validate_assignment=True,
|
|
63
|
-
protected_namespaces=(),
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def to_str(self) -> str:
|
|
68
|
-
"""Returns the string representation of the model using alias"""
|
|
69
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
70
|
-
|
|
71
|
-
def to_json(self) -> str:
|
|
72
|
-
"""Returns the JSON representation of the model using alias"""
|
|
73
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
74
|
-
return json.dumps(self.to_dict())
|
|
75
|
-
|
|
76
|
-
@classmethod
|
|
77
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
78
|
-
"""Create an instance of CreateCServeV3DeploymentRequest from a JSON string"""
|
|
79
|
-
return cls.from_dict(json.loads(json_str))
|
|
80
|
-
|
|
81
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
82
|
-
"""Return the dictionary representation of the model using alias.
|
|
83
|
-
|
|
84
|
-
This has the following differences from calling pydantic's
|
|
85
|
-
`self.model_dump(by_alias=True)`:
|
|
86
|
-
|
|
87
|
-
* `None` is only added to the output dict for nullable fields that
|
|
88
|
-
were set at model initialization. Other fields with value `None`
|
|
89
|
-
are ignored.
|
|
90
|
-
"""
|
|
91
|
-
excluded_fields: Set[str] = set([
|
|
92
|
-
])
|
|
93
|
-
|
|
94
|
-
_dict = self.model_dump(
|
|
95
|
-
by_alias=True,
|
|
96
|
-
exclude=excluded_fields,
|
|
97
|
-
exclude_none=True,
|
|
98
|
-
)
|
|
99
|
-
# override the default output from pydantic by calling `to_dict()` of recipe
|
|
100
|
-
if self.recipe:
|
|
101
|
-
_dict['recipe'] = self.recipe.to_dict()
|
|
102
|
-
# set to None if max_surge (nullable) is None
|
|
103
|
-
# and model_fields_set contains the field
|
|
104
|
-
if self.max_surge is None and "max_surge" in self.model_fields_set:
|
|
105
|
-
_dict['max_surge'] = None
|
|
106
|
-
|
|
107
|
-
# set to None if max_unavailable (nullable) is None
|
|
108
|
-
# and model_fields_set contains the field
|
|
109
|
-
if self.max_unavailable is None and "max_unavailable" in self.model_fields_set:
|
|
110
|
-
_dict['max_unavailable'] = None
|
|
111
|
-
|
|
112
|
-
# set to None if user_annotations (nullable) is None
|
|
113
|
-
# and model_fields_set contains the field
|
|
114
|
-
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
115
|
-
_dict['user_annotations'] = None
|
|
116
|
-
|
|
117
|
-
# set to None if cserve_version (nullable) is None
|
|
118
|
-
# and model_fields_set contains the field
|
|
119
|
-
if self.cserve_version is None and "cserve_version" in self.model_fields_set:
|
|
120
|
-
_dict['cserve_version'] = None
|
|
121
|
-
|
|
122
|
-
# set to None if hf_token (nullable) is None
|
|
123
|
-
# and model_fields_set contains the field
|
|
124
|
-
if self.hf_token is None and "hf_token" in self.model_fields_set:
|
|
125
|
-
_dict['hf_token'] = None
|
|
126
|
-
|
|
127
|
-
# set to None if endpoint_bearer_token (nullable) is None
|
|
128
|
-
# and model_fields_set contains the field
|
|
129
|
-
if self.endpoint_bearer_token is None and "endpoint_bearer_token" in self.model_fields_set:
|
|
130
|
-
_dict['endpoint_bearer_token'] = None
|
|
131
|
-
|
|
132
|
-
# set to None if endpoint_certificate_authority (nullable) is None
|
|
133
|
-
# and model_fields_set contains the field
|
|
134
|
-
if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
|
|
135
|
-
_dict['endpoint_certificate_authority'] = None
|
|
136
|
-
|
|
137
|
-
# set to None if concurrency (nullable) is None
|
|
138
|
-
# and model_fields_set contains the field
|
|
139
|
-
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
140
|
-
_dict['concurrency'] = None
|
|
141
|
-
|
|
142
|
-
# set to None if cooldown_period (nullable) is None
|
|
143
|
-
# and model_fields_set contains the field
|
|
144
|
-
if self.cooldown_period is None and "cooldown_period" in self.model_fields_set:
|
|
145
|
-
_dict['cooldown_period'] = None
|
|
146
|
-
|
|
147
|
-
return _dict
|
|
148
|
-
|
|
149
|
-
@classmethod
|
|
150
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
151
|
-
"""Create an instance of CreateCServeV3DeploymentRequest from a dict"""
|
|
152
|
-
if obj is None:
|
|
153
|
-
return None
|
|
154
|
-
|
|
155
|
-
if not isinstance(obj, dict):
|
|
156
|
-
return cls.model_validate(obj)
|
|
157
|
-
|
|
158
|
-
_obj = cls.model_validate({
|
|
159
|
-
"max_surge": obj.get("max_surge"),
|
|
160
|
-
"max_unavailable": obj.get("max_unavailable"),
|
|
161
|
-
"name": obj.get("name"),
|
|
162
|
-
"cluster_id": obj.get("cluster_id"),
|
|
163
|
-
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
164
|
-
"user_annotations": obj.get("user_annotations"),
|
|
165
|
-
"chart_revision": obj.get("chart_revision"),
|
|
166
|
-
"recipe": CServeV2Recipe.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
|
|
167
|
-
"cserve_version": obj.get("cserve_version"),
|
|
168
|
-
"hf_token": obj.get("hf_token"),
|
|
169
|
-
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
|
|
170
|
-
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
171
|
-
"min_replicas": obj.get("min_replicas"),
|
|
172
|
-
"max_replicas": obj.get("max_replicas"),
|
|
173
|
-
"concurrency": obj.get("concurrency"),
|
|
174
|
-
"cooldown_period": obj.get("cooldown_period"),
|
|
175
|
-
"env_vars": obj.get("env_vars"),
|
|
176
|
-
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
|
|
177
|
-
"enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False,
|
|
178
|
-
"session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False
|
|
179
|
-
})
|
|
180
|
-
return _obj
|
|
181
|
-
|
|
182
|
-
|
|
@@ -1,169 +0,0 @@
|
|
|
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 datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
-
from platform_api_python_client.models.c_serve_v2_recipe import CServeV2Recipe
|
|
24
|
-
from platform_api_python_client.models.deployment_status import DeploymentStatus
|
|
25
|
-
from platform_api_python_client.models.deployment_type import DeploymentType
|
|
26
|
-
from typing import Optional, Set
|
|
27
|
-
from typing_extensions import Self
|
|
28
|
-
|
|
29
|
-
class GetCServeV2DeploymentResponse(BaseModel):
|
|
30
|
-
"""
|
|
31
|
-
GetCServeV2DeploymentResponse
|
|
32
|
-
""" # noqa: E501
|
|
33
|
-
creator_email: StrictStr
|
|
34
|
-
cluster_id: StrictInt
|
|
35
|
-
id: StrictInt
|
|
36
|
-
name: StrictStr
|
|
37
|
-
endpoint_url: StrictStr
|
|
38
|
-
image_url: Optional[StrictStr] = None
|
|
39
|
-
type: DeploymentType
|
|
40
|
-
status: DeploymentStatus
|
|
41
|
-
created_at: datetime
|
|
42
|
-
hardware_instance_id: StrictInt
|
|
43
|
-
revision_number: StrictInt
|
|
44
|
-
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
45
|
-
recipe: CServeV2Recipe
|
|
46
|
-
cserve_version: Optional[StrictStr] = None
|
|
47
|
-
min_scale: StrictInt
|
|
48
|
-
max_scale: StrictInt
|
|
49
|
-
initial_scale: Optional[StrictInt] = None
|
|
50
|
-
endpoint_certificate_authority: Optional[StrictStr] = None
|
|
51
|
-
endpoint_bearer_token: Optional[StrictStr] = None
|
|
52
|
-
concurrency: Optional[StrictInt] = None
|
|
53
|
-
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
54
|
-
__properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "recipe", "cserve_version", "min_scale", "max_scale", "initial_scale", "endpoint_certificate_authority", "endpoint_bearer_token", "concurrency", "env_vars"]
|
|
55
|
-
|
|
56
|
-
model_config = ConfigDict(
|
|
57
|
-
populate_by_name=True,
|
|
58
|
-
validate_assignment=True,
|
|
59
|
-
protected_namespaces=(),
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
def to_str(self) -> str:
|
|
64
|
-
"""Returns the string representation of the model using alias"""
|
|
65
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
66
|
-
|
|
67
|
-
def to_json(self) -> str:
|
|
68
|
-
"""Returns the JSON representation of the model using alias"""
|
|
69
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
70
|
-
return json.dumps(self.to_dict())
|
|
71
|
-
|
|
72
|
-
@classmethod
|
|
73
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
74
|
-
"""Create an instance of GetCServeV2DeploymentResponse from a JSON string"""
|
|
75
|
-
return cls.from_dict(json.loads(json_str))
|
|
76
|
-
|
|
77
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
78
|
-
"""Return the dictionary representation of the model using alias.
|
|
79
|
-
|
|
80
|
-
This has the following differences from calling pydantic's
|
|
81
|
-
`self.model_dump(by_alias=True)`:
|
|
82
|
-
|
|
83
|
-
* `None` is only added to the output dict for nullable fields that
|
|
84
|
-
were set at model initialization. Other fields with value `None`
|
|
85
|
-
are ignored.
|
|
86
|
-
"""
|
|
87
|
-
excluded_fields: Set[str] = set([
|
|
88
|
-
])
|
|
89
|
-
|
|
90
|
-
_dict = self.model_dump(
|
|
91
|
-
by_alias=True,
|
|
92
|
-
exclude=excluded_fields,
|
|
93
|
-
exclude_none=True,
|
|
94
|
-
)
|
|
95
|
-
# override the default output from pydantic by calling `to_dict()` of recipe
|
|
96
|
-
if self.recipe:
|
|
97
|
-
_dict['recipe'] = self.recipe.to_dict()
|
|
98
|
-
# set to None if image_url (nullable) is None
|
|
99
|
-
# and model_fields_set contains the field
|
|
100
|
-
if self.image_url is None and "image_url" in self.model_fields_set:
|
|
101
|
-
_dict['image_url'] = None
|
|
102
|
-
|
|
103
|
-
# set to None if user_annotations (nullable) is None
|
|
104
|
-
# and model_fields_set contains the field
|
|
105
|
-
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
106
|
-
_dict['user_annotations'] = None
|
|
107
|
-
|
|
108
|
-
# set to None if cserve_version (nullable) is None
|
|
109
|
-
# and model_fields_set contains the field
|
|
110
|
-
if self.cserve_version is None and "cserve_version" in self.model_fields_set:
|
|
111
|
-
_dict['cserve_version'] = None
|
|
112
|
-
|
|
113
|
-
# set to None if initial_scale (nullable) is None
|
|
114
|
-
# and model_fields_set contains the field
|
|
115
|
-
if self.initial_scale is None and "initial_scale" in self.model_fields_set:
|
|
116
|
-
_dict['initial_scale'] = None
|
|
117
|
-
|
|
118
|
-
# set to None if endpoint_certificate_authority (nullable) is None
|
|
119
|
-
# and model_fields_set contains the field
|
|
120
|
-
if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
|
|
121
|
-
_dict['endpoint_certificate_authority'] = None
|
|
122
|
-
|
|
123
|
-
# set to None if endpoint_bearer_token (nullable) is None
|
|
124
|
-
# and model_fields_set contains the field
|
|
125
|
-
if self.endpoint_bearer_token is None and "endpoint_bearer_token" in self.model_fields_set:
|
|
126
|
-
_dict['endpoint_bearer_token'] = None
|
|
127
|
-
|
|
128
|
-
# set to None if concurrency (nullable) is None
|
|
129
|
-
# and model_fields_set contains the field
|
|
130
|
-
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
131
|
-
_dict['concurrency'] = None
|
|
132
|
-
|
|
133
|
-
return _dict
|
|
134
|
-
|
|
135
|
-
@classmethod
|
|
136
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
137
|
-
"""Create an instance of GetCServeV2DeploymentResponse from a dict"""
|
|
138
|
-
if obj is None:
|
|
139
|
-
return None
|
|
140
|
-
|
|
141
|
-
if not isinstance(obj, dict):
|
|
142
|
-
return cls.model_validate(obj)
|
|
143
|
-
|
|
144
|
-
_obj = cls.model_validate({
|
|
145
|
-
"creator_email": obj.get("creator_email"),
|
|
146
|
-
"cluster_id": obj.get("cluster_id"),
|
|
147
|
-
"id": obj.get("id"),
|
|
148
|
-
"name": obj.get("name"),
|
|
149
|
-
"endpoint_url": obj.get("endpoint_url"),
|
|
150
|
-
"image_url": obj.get("image_url"),
|
|
151
|
-
"type": obj.get("type"),
|
|
152
|
-
"status": obj.get("status"),
|
|
153
|
-
"created_at": obj.get("created_at"),
|
|
154
|
-
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
155
|
-
"revision_number": obj.get("revision_number"),
|
|
156
|
-
"user_annotations": obj.get("user_annotations"),
|
|
157
|
-
"recipe": CServeV2Recipe.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
|
|
158
|
-
"cserve_version": obj.get("cserve_version"),
|
|
159
|
-
"min_scale": obj.get("min_scale"),
|
|
160
|
-
"max_scale": obj.get("max_scale"),
|
|
161
|
-
"initial_scale": obj.get("initial_scale"),
|
|
162
|
-
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
163
|
-
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
|
|
164
|
-
"concurrency": obj.get("concurrency"),
|
|
165
|
-
"env_vars": obj.get("env_vars")
|
|
166
|
-
})
|
|
167
|
-
return _obj
|
|
168
|
-
|
|
169
|
-
|
|
@@ -1,170 +0,0 @@
|
|
|
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 datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
-
from platform_api_python_client.models.c_serve_v2_recipe import CServeV2Recipe
|
|
24
|
-
from platform_api_python_client.models.deployment_status import DeploymentStatus
|
|
25
|
-
from platform_api_python_client.models.deployment_type import DeploymentType
|
|
26
|
-
from typing import Optional, Set
|
|
27
|
-
from typing_extensions import Self
|
|
28
|
-
|
|
29
|
-
class GetCServeV3DeploymentResponse(BaseModel):
|
|
30
|
-
"""
|
|
31
|
-
GetCServeV3DeploymentResponse
|
|
32
|
-
""" # noqa: E501
|
|
33
|
-
creator_email: StrictStr
|
|
34
|
-
cluster_id: StrictInt
|
|
35
|
-
id: StrictInt
|
|
36
|
-
name: StrictStr
|
|
37
|
-
endpoint_url: StrictStr
|
|
38
|
-
image_url: Optional[StrictStr] = None
|
|
39
|
-
type: DeploymentType
|
|
40
|
-
status: DeploymentStatus
|
|
41
|
-
created_at: datetime
|
|
42
|
-
hardware_instance_id: StrictInt
|
|
43
|
-
revision_number: StrictInt
|
|
44
|
-
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
45
|
-
recipe: CServeV2Recipe
|
|
46
|
-
cserve_version: Optional[StrictStr] = None
|
|
47
|
-
min_replicas: StrictInt
|
|
48
|
-
max_replicas: StrictInt
|
|
49
|
-
endpoint_certificate_authority: Optional[StrictStr] = None
|
|
50
|
-
endpoint_bearer_token: Optional[StrictStr] = None
|
|
51
|
-
concurrency: Optional[StrictInt] = None
|
|
52
|
-
cooldown_period: Optional[StrictInt] = 1800
|
|
53
|
-
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
54
|
-
enable_logging: Optional[StrictBool] = True
|
|
55
|
-
enable_node_model_cache: Optional[StrictBool] = False
|
|
56
|
-
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.")
|
|
57
|
-
__properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "recipe", "cserve_version", "min_replicas", "max_replicas", "endpoint_certificate_authority", "endpoint_bearer_token", "concurrency", "cooldown_period", "env_vars", "enable_logging", "enable_node_model_cache", "session_affinity"]
|
|
58
|
-
|
|
59
|
-
model_config = ConfigDict(
|
|
60
|
-
populate_by_name=True,
|
|
61
|
-
validate_assignment=True,
|
|
62
|
-
protected_namespaces=(),
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
def to_str(self) -> str:
|
|
67
|
-
"""Returns the string representation of the model using alias"""
|
|
68
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
69
|
-
|
|
70
|
-
def to_json(self) -> str:
|
|
71
|
-
"""Returns the JSON representation of the model using alias"""
|
|
72
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
73
|
-
return json.dumps(self.to_dict())
|
|
74
|
-
|
|
75
|
-
@classmethod
|
|
76
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
77
|
-
"""Create an instance of GetCServeV3DeploymentResponse from a JSON string"""
|
|
78
|
-
return cls.from_dict(json.loads(json_str))
|
|
79
|
-
|
|
80
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
81
|
-
"""Return the dictionary representation of the model using alias.
|
|
82
|
-
|
|
83
|
-
This has the following differences from calling pydantic's
|
|
84
|
-
`self.model_dump(by_alias=True)`:
|
|
85
|
-
|
|
86
|
-
* `None` is only added to the output dict for nullable fields that
|
|
87
|
-
were set at model initialization. Other fields with value `None`
|
|
88
|
-
are ignored.
|
|
89
|
-
"""
|
|
90
|
-
excluded_fields: Set[str] = set([
|
|
91
|
-
])
|
|
92
|
-
|
|
93
|
-
_dict = self.model_dump(
|
|
94
|
-
by_alias=True,
|
|
95
|
-
exclude=excluded_fields,
|
|
96
|
-
exclude_none=True,
|
|
97
|
-
)
|
|
98
|
-
# override the default output from pydantic by calling `to_dict()` of recipe
|
|
99
|
-
if self.recipe:
|
|
100
|
-
_dict['recipe'] = self.recipe.to_dict()
|
|
101
|
-
# set to None if image_url (nullable) is None
|
|
102
|
-
# and model_fields_set contains the field
|
|
103
|
-
if self.image_url is None and "image_url" in self.model_fields_set:
|
|
104
|
-
_dict['image_url'] = None
|
|
105
|
-
|
|
106
|
-
# set to None if user_annotations (nullable) is None
|
|
107
|
-
# and model_fields_set contains the field
|
|
108
|
-
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
109
|
-
_dict['user_annotations'] = None
|
|
110
|
-
|
|
111
|
-
# set to None if cserve_version (nullable) is None
|
|
112
|
-
# and model_fields_set contains the field
|
|
113
|
-
if self.cserve_version is None and "cserve_version" in self.model_fields_set:
|
|
114
|
-
_dict['cserve_version'] = None
|
|
115
|
-
|
|
116
|
-
# set to None if endpoint_certificate_authority (nullable) is None
|
|
117
|
-
# and model_fields_set contains the field
|
|
118
|
-
if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
|
|
119
|
-
_dict['endpoint_certificate_authority'] = None
|
|
120
|
-
|
|
121
|
-
# set to None if endpoint_bearer_token (nullable) is None
|
|
122
|
-
# and model_fields_set contains the field
|
|
123
|
-
if self.endpoint_bearer_token is None and "endpoint_bearer_token" in self.model_fields_set:
|
|
124
|
-
_dict['endpoint_bearer_token'] = None
|
|
125
|
-
|
|
126
|
-
# set to None if concurrency (nullable) is None
|
|
127
|
-
# and model_fields_set contains the field
|
|
128
|
-
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
129
|
-
_dict['concurrency'] = None
|
|
130
|
-
|
|
131
|
-
return _dict
|
|
132
|
-
|
|
133
|
-
@classmethod
|
|
134
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
135
|
-
"""Create an instance of GetCServeV3DeploymentResponse from a dict"""
|
|
136
|
-
if obj is None:
|
|
137
|
-
return None
|
|
138
|
-
|
|
139
|
-
if not isinstance(obj, dict):
|
|
140
|
-
return cls.model_validate(obj)
|
|
141
|
-
|
|
142
|
-
_obj = cls.model_validate({
|
|
143
|
-
"creator_email": obj.get("creator_email"),
|
|
144
|
-
"cluster_id": obj.get("cluster_id"),
|
|
145
|
-
"id": obj.get("id"),
|
|
146
|
-
"name": obj.get("name"),
|
|
147
|
-
"endpoint_url": obj.get("endpoint_url"),
|
|
148
|
-
"image_url": obj.get("image_url"),
|
|
149
|
-
"type": obj.get("type"),
|
|
150
|
-
"status": obj.get("status"),
|
|
151
|
-
"created_at": obj.get("created_at"),
|
|
152
|
-
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
153
|
-
"revision_number": obj.get("revision_number"),
|
|
154
|
-
"user_annotations": obj.get("user_annotations"),
|
|
155
|
-
"recipe": CServeV2Recipe.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
|
|
156
|
-
"cserve_version": obj.get("cserve_version"),
|
|
157
|
-
"min_replicas": obj.get("min_replicas"),
|
|
158
|
-
"max_replicas": obj.get("max_replicas"),
|
|
159
|
-
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
160
|
-
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
|
|
161
|
-
"concurrency": obj.get("concurrency"),
|
|
162
|
-
"cooldown_period": obj.get("cooldown_period") if obj.get("cooldown_period") is not None else 1800,
|
|
163
|
-
"env_vars": obj.get("env_vars"),
|
|
164
|
-
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
|
|
165
|
-
"enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False,
|
|
166
|
-
"session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False
|
|
167
|
-
})
|
|
168
|
-
return _obj
|
|
169
|
-
|
|
170
|
-
|
|
File without changes
|