platform-api-python-client 4.9.0__py3-none-any.whl → 4.9.7__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 +5 -1
- platform_api_python_client/api/external_api.py +538 -0
- platform_api_python_client/api_client.py +1 -1
- platform_api_python_client/configuration.py +1 -1
- platform_api_python_client/models/__init__.py +4 -0
- platform_api_python_client/models/config_file_mount.py +99 -0
- platform_api_python_client/models/create_c_serve_v3_deployment_request.py +11 -2
- platform_api_python_client/models/create_inference_v3_deployment_request.py +29 -2
- platform_api_python_client/models/create_job_deployment_request.py +139 -0
- platform_api_python_client/models/create_job_deployment_response.py +92 -0
- platform_api_python_client/models/deployment_type.py +1 -0
- platform_api_python_client/models/get_c_serve_v3_deployment_response.py +7 -3
- platform_api_python_client/models/get_inference_v3_deployment_response.py +18 -3
- platform_api_python_client/models/get_job_deployment_response.py +160 -0
- platform_api_python_client/models/pod_status.py +2 -0
- platform_api_python_client/models/service_status.py +4 -0
- {platform_api_python_client-4.9.0.dist-info → platform_api_python_client-4.9.7.dist-info}/METADATA +1 -1
- {platform_api_python_client-4.9.0.dist-info → platform_api_python_client-4.9.7.dist-info}/RECORD +20 -16
- {platform_api_python_client-4.9.0.dist-info → platform_api_python_client-4.9.7.dist-info}/WHEEL +0 -0
- {platform_api_python_client-4.9.0.dist-info → platform_api_python_client-4.9.7.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
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
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ConfigFileMount(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ConfigFileMount
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
filename: Annotated[str, Field(min_length=1, strict=True, max_length=253)]
|
|
31
|
+
mount_path: Annotated[str, Field(min_length=1, strict=True)]
|
|
32
|
+
content: Annotated[str, Field(min_length=1, strict=True)]
|
|
33
|
+
__properties: ClassVar[List[str]] = ["filename", "mount_path", "content"]
|
|
34
|
+
|
|
35
|
+
@field_validator('filename')
|
|
36
|
+
def filename_validate_regular_expression(cls, value):
|
|
37
|
+
"""Validates the regular expression"""
|
|
38
|
+
if not re.match(r"^[a-zA-Z0-9._-]+$", value):
|
|
39
|
+
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9._-]+$/")
|
|
40
|
+
return value
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of ConfigFileMount from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of ConfigFileMount from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return cls.model_validate(obj)
|
|
91
|
+
|
|
92
|
+
_obj = cls.model_validate({
|
|
93
|
+
"filename": obj.get("filename"),
|
|
94
|
+
"mount_path": obj.get("mount_path"),
|
|
95
|
+
"content": obj.get("content")
|
|
96
|
+
})
|
|
97
|
+
return _obj
|
|
98
|
+
|
|
99
|
+
|
|
@@ -43,10 +43,12 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
43
43
|
max_replicas: StrictInt
|
|
44
44
|
initial_replicas: Optional[StrictInt] = None
|
|
45
45
|
concurrency: Optional[StrictInt] = None
|
|
46
|
+
cooldown_period: Optional[StrictInt] = None
|
|
46
47
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
47
48
|
enable_logging: Optional[StrictBool] = True
|
|
48
49
|
enable_node_model_cache: Optional[StrictBool] = False
|
|
49
|
-
|
|
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", "recipe", "cserve_version", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "cooldown_period", "env_vars", "enable_logging", "enable_node_model_cache", "session_affinity"]
|
|
50
52
|
|
|
51
53
|
@field_validator('name')
|
|
52
54
|
def name_validate_regular_expression(cls, value):
|
|
@@ -142,6 +144,11 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
142
144
|
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
143
145
|
_dict['concurrency'] = None
|
|
144
146
|
|
|
147
|
+
# set to None if cooldown_period (nullable) is None
|
|
148
|
+
# and model_fields_set contains the field
|
|
149
|
+
if self.cooldown_period is None and "cooldown_period" in self.model_fields_set:
|
|
150
|
+
_dict['cooldown_period'] = None
|
|
151
|
+
|
|
145
152
|
return _dict
|
|
146
153
|
|
|
147
154
|
@classmethod
|
|
@@ -169,9 +176,11 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
169
176
|
"max_replicas": obj.get("max_replicas"),
|
|
170
177
|
"initial_replicas": obj.get("initial_replicas"),
|
|
171
178
|
"concurrency": obj.get("concurrency"),
|
|
179
|
+
"cooldown_period": obj.get("cooldown_period"),
|
|
172
180
|
"env_vars": obj.get("env_vars"),
|
|
173
181
|
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
|
|
174
|
-
"enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False
|
|
182
|
+
"enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False,
|
|
183
|
+
"session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False
|
|
175
184
|
})
|
|
176
185
|
return _obj
|
|
177
186
|
|
|
@@ -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.backend_protocol import BackendProtocol
|
|
24
|
+
from platform_api_python_client.models.config_file_mount import ConfigFileMount
|
|
24
25
|
from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials
|
|
25
26
|
from typing import Optional, Set
|
|
26
27
|
from typing_extensions import Self
|
|
@@ -42,14 +43,18 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
42
43
|
max_replicas: StrictInt
|
|
43
44
|
initial_replicas: Optional[StrictInt] = None
|
|
44
45
|
concurrency: Optional[StrictInt] = None
|
|
46
|
+
cooldown_period: Optional[StrictInt] = None
|
|
45
47
|
healthcheck: Optional[StrictStr] = None
|
|
46
48
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
47
49
|
command: Optional[StrictStr] = None
|
|
48
50
|
endpoint_bearer_token: Optional[StrictStr] = None
|
|
49
51
|
endpoint_certificate_authority: Optional[StrictStr] = None
|
|
52
|
+
hf_token: Optional[StrictStr] = None
|
|
50
53
|
backend_protocol: Optional[BackendProtocol] = None
|
|
51
54
|
enable_logging: Optional[StrictBool] = False
|
|
52
|
-
|
|
55
|
+
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.")
|
|
56
|
+
config_file: Optional[ConfigFileMount] = None
|
|
57
|
+
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "image_url", "image_pull_secret_credentials", "port", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "cooldown_period", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "endpoint_certificate_authority", "hf_token", "backend_protocol", "enable_logging", "session_affinity", "config_file"]
|
|
53
58
|
|
|
54
59
|
@field_validator('name')
|
|
55
60
|
def name_validate_regular_expression(cls, value):
|
|
@@ -100,6 +105,9 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
100
105
|
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
101
106
|
if self.image_pull_secret_credentials:
|
|
102
107
|
_dict['image_pull_secret_credentials'] = self.image_pull_secret_credentials.to_dict()
|
|
108
|
+
# override the default output from pydantic by calling `to_dict()` of config_file
|
|
109
|
+
if self.config_file:
|
|
110
|
+
_dict['config_file'] = self.config_file.to_dict()
|
|
103
111
|
# set to None if max_surge (nullable) is None
|
|
104
112
|
# and model_fields_set contains the field
|
|
105
113
|
if self.max_surge is None and "max_surge" in self.model_fields_set:
|
|
@@ -130,6 +138,11 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
130
138
|
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
131
139
|
_dict['concurrency'] = None
|
|
132
140
|
|
|
141
|
+
# set to None if cooldown_period (nullable) is None
|
|
142
|
+
# and model_fields_set contains the field
|
|
143
|
+
if self.cooldown_period is None and "cooldown_period" in self.model_fields_set:
|
|
144
|
+
_dict['cooldown_period'] = None
|
|
145
|
+
|
|
133
146
|
# set to None if healthcheck (nullable) is None
|
|
134
147
|
# and model_fields_set contains the field
|
|
135
148
|
if self.healthcheck is None and "healthcheck" in self.model_fields_set:
|
|
@@ -155,6 +168,16 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
155
168
|
if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
|
|
156
169
|
_dict['endpoint_certificate_authority'] = None
|
|
157
170
|
|
|
171
|
+
# set to None if hf_token (nullable) is None
|
|
172
|
+
# and model_fields_set contains the field
|
|
173
|
+
if self.hf_token is None and "hf_token" in self.model_fields_set:
|
|
174
|
+
_dict['hf_token'] = None
|
|
175
|
+
|
|
176
|
+
# set to None if config_file (nullable) is None
|
|
177
|
+
# and model_fields_set contains the field
|
|
178
|
+
if self.config_file is None and "config_file" in self.model_fields_set:
|
|
179
|
+
_dict['config_file'] = None
|
|
180
|
+
|
|
158
181
|
return _dict
|
|
159
182
|
|
|
160
183
|
@classmethod
|
|
@@ -180,13 +203,17 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
180
203
|
"max_replicas": obj.get("max_replicas"),
|
|
181
204
|
"initial_replicas": obj.get("initial_replicas"),
|
|
182
205
|
"concurrency": obj.get("concurrency"),
|
|
206
|
+
"cooldown_period": obj.get("cooldown_period"),
|
|
183
207
|
"healthcheck": obj.get("healthcheck"),
|
|
184
208
|
"env_vars": obj.get("env_vars"),
|
|
185
209
|
"command": obj.get("command"),
|
|
186
210
|
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
|
|
187
211
|
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
212
|
+
"hf_token": obj.get("hf_token"),
|
|
188
213
|
"backend_protocol": obj.get("backend_protocol"),
|
|
189
|
-
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else False
|
|
214
|
+
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else False,
|
|
215
|
+
"session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False,
|
|
216
|
+
"config_file": ConfigFileMount.from_dict(obj["config_file"]) if obj.get("config_file") is not None else None
|
|
190
217
|
})
|
|
191
218
|
return _obj
|
|
192
219
|
|
|
@@ -0,0 +1,139 @@
|
|
|
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.image_pull_secret_credentials import ImagePullSecretCredentials
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class CreateJobDeploymentRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CreateJobDeploymentRequest
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
|
|
32
|
+
cluster_id: StrictInt
|
|
33
|
+
hardware_instance_id: StrictInt
|
|
34
|
+
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
35
|
+
image_url: StrictStr
|
|
36
|
+
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
37
|
+
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
38
|
+
command: Optional[StrictStr] = None
|
|
39
|
+
completions: Optional[StrictInt] = 1
|
|
40
|
+
parallelism: Optional[StrictInt] = 1
|
|
41
|
+
enable_logging: Optional[StrictBool] = True
|
|
42
|
+
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "image_url", "image_pull_secret_credentials", "env_vars", "command", "completions", "parallelism", "enable_logging"]
|
|
43
|
+
|
|
44
|
+
@field_validator('name')
|
|
45
|
+
def name_validate_regular_expression(cls, value):
|
|
46
|
+
"""Validates the regular expression"""
|
|
47
|
+
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
48
|
+
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
49
|
+
return value
|
|
50
|
+
|
|
51
|
+
model_config = ConfigDict(
|
|
52
|
+
populate_by_name=True,
|
|
53
|
+
validate_assignment=True,
|
|
54
|
+
protected_namespaces=(),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def to_str(self) -> str:
|
|
59
|
+
"""Returns the string representation of the model using alias"""
|
|
60
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
61
|
+
|
|
62
|
+
def to_json(self) -> str:
|
|
63
|
+
"""Returns the JSON representation of the model using alias"""
|
|
64
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
65
|
+
return json.dumps(self.to_dict())
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
69
|
+
"""Create an instance of CreateJobDeploymentRequest from a JSON string"""
|
|
70
|
+
return cls.from_dict(json.loads(json_str))
|
|
71
|
+
|
|
72
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
73
|
+
"""Return the dictionary representation of the model using alias.
|
|
74
|
+
|
|
75
|
+
This has the following differences from calling pydantic's
|
|
76
|
+
`self.model_dump(by_alias=True)`:
|
|
77
|
+
|
|
78
|
+
* `None` is only added to the output dict for nullable fields that
|
|
79
|
+
were set at model initialization. Other fields with value `None`
|
|
80
|
+
are ignored.
|
|
81
|
+
"""
|
|
82
|
+
excluded_fields: Set[str] = set([
|
|
83
|
+
])
|
|
84
|
+
|
|
85
|
+
_dict = self.model_dump(
|
|
86
|
+
by_alias=True,
|
|
87
|
+
exclude=excluded_fields,
|
|
88
|
+
exclude_none=True,
|
|
89
|
+
)
|
|
90
|
+
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
91
|
+
if self.image_pull_secret_credentials:
|
|
92
|
+
_dict['image_pull_secret_credentials'] = self.image_pull_secret_credentials.to_dict()
|
|
93
|
+
# set to None if user_annotations (nullable) is None
|
|
94
|
+
# and model_fields_set contains the field
|
|
95
|
+
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
96
|
+
_dict['user_annotations'] = None
|
|
97
|
+
|
|
98
|
+
# set to None if image_pull_secret_credentials (nullable) is None
|
|
99
|
+
# and model_fields_set contains the field
|
|
100
|
+
if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
|
|
101
|
+
_dict['image_pull_secret_credentials'] = None
|
|
102
|
+
|
|
103
|
+
# set to None if env_vars (nullable) is None
|
|
104
|
+
# and model_fields_set contains the field
|
|
105
|
+
if self.env_vars is None and "env_vars" in self.model_fields_set:
|
|
106
|
+
_dict['env_vars'] = None
|
|
107
|
+
|
|
108
|
+
# set to None if command (nullable) is None
|
|
109
|
+
# and model_fields_set contains the field
|
|
110
|
+
if self.command is None and "command" in self.model_fields_set:
|
|
111
|
+
_dict['command'] = None
|
|
112
|
+
|
|
113
|
+
return _dict
|
|
114
|
+
|
|
115
|
+
@classmethod
|
|
116
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
117
|
+
"""Create an instance of CreateJobDeploymentRequest from a dict"""
|
|
118
|
+
if obj is None:
|
|
119
|
+
return None
|
|
120
|
+
|
|
121
|
+
if not isinstance(obj, dict):
|
|
122
|
+
return cls.model_validate(obj)
|
|
123
|
+
|
|
124
|
+
_obj = cls.model_validate({
|
|
125
|
+
"name": obj.get("name"),
|
|
126
|
+
"cluster_id": obj.get("cluster_id"),
|
|
127
|
+
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
128
|
+
"user_annotations": obj.get("user_annotations"),
|
|
129
|
+
"image_url": obj.get("image_url"),
|
|
130
|
+
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
131
|
+
"env_vars": obj.get("env_vars"),
|
|
132
|
+
"command": obj.get("command"),
|
|
133
|
+
"completions": obj.get("completions") if obj.get("completions") is not None else 1,
|
|
134
|
+
"parallelism": obj.get("parallelism") if obj.get("parallelism") is not None else 1,
|
|
135
|
+
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True
|
|
136
|
+
})
|
|
137
|
+
return _obj
|
|
138
|
+
|
|
139
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class CreateJobDeploymentResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CreateJobDeploymentResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
id: StrictInt
|
|
31
|
+
created_at: datetime
|
|
32
|
+
endpoint_url: StrictStr
|
|
33
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of CreateJobDeploymentResponse from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of CreateJobDeploymentResponse from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"id": obj.get("id"),
|
|
87
|
+
"created_at": obj.get("created_at"),
|
|
88
|
+
"endpoint_url": obj.get("endpoint_url")
|
|
89
|
+
})
|
|
90
|
+
return _obj
|
|
91
|
+
|
|
92
|
+
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from platform_api_python_client.models.c_serve_v2_recipe import CServeV2Recipe
|
|
24
24
|
from platform_api_python_client.models.deployment_status import DeploymentStatus
|
|
@@ -50,10 +50,12 @@ class GetCServeV3DeploymentResponse(BaseModel):
|
|
|
50
50
|
endpoint_certificate_authority: Optional[StrictStr] = None
|
|
51
51
|
endpoint_bearer_token: Optional[StrictStr] = None
|
|
52
52
|
concurrency: Optional[StrictInt] = None
|
|
53
|
+
cooldown_period: Optional[StrictInt] = 1800
|
|
53
54
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
54
55
|
enable_logging: Optional[StrictBool] = True
|
|
55
56
|
enable_node_model_cache: Optional[StrictBool] = False
|
|
56
|
-
|
|
57
|
+
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.")
|
|
58
|
+
__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", "initial_replicas", "endpoint_certificate_authority", "endpoint_bearer_token", "concurrency", "cooldown_period", "env_vars", "enable_logging", "enable_node_model_cache", "session_affinity"]
|
|
57
59
|
|
|
58
60
|
model_config = ConfigDict(
|
|
59
61
|
populate_by_name=True,
|
|
@@ -164,9 +166,11 @@ class GetCServeV3DeploymentResponse(BaseModel):
|
|
|
164
166
|
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
165
167
|
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
|
|
166
168
|
"concurrency": obj.get("concurrency"),
|
|
169
|
+
"cooldown_period": obj.get("cooldown_period") if obj.get("cooldown_period") is not None else 1800,
|
|
167
170
|
"env_vars": obj.get("env_vars"),
|
|
168
171
|
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
|
|
169
|
-
"enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False
|
|
172
|
+
"enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False,
|
|
173
|
+
"session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False
|
|
170
174
|
})
|
|
171
175
|
return _obj
|
|
172
176
|
|
|
@@ -18,9 +18,10 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from platform_api_python_client.models.backend_protocol import BackendProtocol
|
|
24
|
+
from platform_api_python_client.models.config_file_mount import ConfigFileMount
|
|
24
25
|
from platform_api_python_client.models.deployment_status import DeploymentStatus
|
|
25
26
|
from platform_api_python_client.models.deployment_type import DeploymentType
|
|
26
27
|
from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials
|
|
@@ -48,6 +49,7 @@ class GetInferenceV3DeploymentResponse(BaseModel):
|
|
|
48
49
|
max_replicas: StrictInt
|
|
49
50
|
initial_replicas: Optional[StrictInt] = None
|
|
50
51
|
concurrency: Optional[StrictInt] = None
|
|
52
|
+
cooldown_period: Optional[StrictInt] = 1800
|
|
51
53
|
healthcheck: Optional[StrictStr] = None
|
|
52
54
|
endpoint_certificate_authority: Optional[StrictStr] = None
|
|
53
55
|
endpoint_bearer_token: Optional[StrictStr] = None
|
|
@@ -58,7 +60,9 @@ class GetInferenceV3DeploymentResponse(BaseModel):
|
|
|
58
60
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
59
61
|
backend_protocol: Optional[BackendProtocol] = None
|
|
60
62
|
enable_logging: Optional[StrictBool] = True
|
|
61
|
-
|
|
63
|
+
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.")
|
|
64
|
+
config_file: Optional[ConfigFileMount] = None
|
|
65
|
+
__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", "container_port", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "cooldown_period", "healthcheck", "endpoint_certificate_authority", "endpoint_bearer_token", "env_vars", "command", "command_args", "original_command", "image_pull_secret_credentials", "backend_protocol", "enable_logging", "session_affinity", "config_file"]
|
|
62
66
|
|
|
63
67
|
model_config = ConfigDict(
|
|
64
68
|
populate_by_name=True,
|
|
@@ -102,6 +106,9 @@ class GetInferenceV3DeploymentResponse(BaseModel):
|
|
|
102
106
|
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
103
107
|
if self.image_pull_secret_credentials:
|
|
104
108
|
_dict['image_pull_secret_credentials'] = self.image_pull_secret_credentials.to_dict()
|
|
109
|
+
# override the default output from pydantic by calling `to_dict()` of config_file
|
|
110
|
+
if self.config_file:
|
|
111
|
+
_dict['config_file'] = self.config_file.to_dict()
|
|
105
112
|
# set to None if image_url (nullable) is None
|
|
106
113
|
# and model_fields_set contains the field
|
|
107
114
|
if self.image_url is None and "image_url" in self.model_fields_set:
|
|
@@ -162,6 +169,11 @@ class GetInferenceV3DeploymentResponse(BaseModel):
|
|
|
162
169
|
if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
|
|
163
170
|
_dict['image_pull_secret_credentials'] = None
|
|
164
171
|
|
|
172
|
+
# set to None if config_file (nullable) is None
|
|
173
|
+
# and model_fields_set contains the field
|
|
174
|
+
if self.config_file is None and "config_file" in self.model_fields_set:
|
|
175
|
+
_dict['config_file'] = None
|
|
176
|
+
|
|
165
177
|
return _dict
|
|
166
178
|
|
|
167
179
|
@classmethod
|
|
@@ -191,6 +203,7 @@ class GetInferenceV3DeploymentResponse(BaseModel):
|
|
|
191
203
|
"max_replicas": obj.get("max_replicas"),
|
|
192
204
|
"initial_replicas": obj.get("initial_replicas"),
|
|
193
205
|
"concurrency": obj.get("concurrency"),
|
|
206
|
+
"cooldown_period": obj.get("cooldown_period") if obj.get("cooldown_period") is not None else 1800,
|
|
194
207
|
"healthcheck": obj.get("healthcheck"),
|
|
195
208
|
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
196
209
|
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
|
|
@@ -200,7 +213,9 @@ class GetInferenceV3DeploymentResponse(BaseModel):
|
|
|
200
213
|
"original_command": obj.get("original_command"),
|
|
201
214
|
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
202
215
|
"backend_protocol": obj.get("backend_protocol"),
|
|
203
|
-
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True
|
|
216
|
+
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
|
|
217
|
+
"session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False,
|
|
218
|
+
"config_file": ConfigFileMount.from_dict(obj["config_file"]) if obj.get("config_file") is not None else None
|
|
204
219
|
})
|
|
205
220
|
return _obj
|
|
206
221
|
|