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
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
from inspect import getfullargspec
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
21
|
+
from typing import Optional
|
|
22
|
+
from platform_api_python_client.models.unified_write_compute_deployment_request import UnifiedWriteComputeDeploymentRequest
|
|
23
|
+
from platform_api_python_client.models.unified_write_dynamo_deployment_request import UnifiedWriteDynamoDeploymentRequest
|
|
24
|
+
from platform_api_python_client.models.unified_write_inference_v3_deployment_request import UnifiedWriteInferenceV3DeploymentRequest
|
|
25
|
+
from platform_api_python_client.models.unified_write_job_deployment_request import UnifiedWriteJobDeploymentRequest
|
|
26
|
+
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
27
|
+
from typing_extensions import Literal, Self
|
|
28
|
+
from pydantic import Field
|
|
29
|
+
|
|
30
|
+
UNIFIEDWRITEDEPLOYMENTREQUEST_ANY_OF_SCHEMAS = ["UnifiedWriteComputeDeploymentRequest", "UnifiedWriteDynamoDeploymentRequest", "UnifiedWriteInferenceV3DeploymentRequest", "UnifiedWriteJobDeploymentRequest"]
|
|
31
|
+
|
|
32
|
+
class UnifiedWriteDeploymentRequest(BaseModel):
|
|
33
|
+
"""
|
|
34
|
+
UnifiedWriteDeploymentRequest
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
# data type: UnifiedWriteComputeDeploymentRequest
|
|
38
|
+
anyof_schema_1_validator: Optional[UnifiedWriteComputeDeploymentRequest] = None
|
|
39
|
+
# data type: UnifiedWriteInferenceV3DeploymentRequest
|
|
40
|
+
anyof_schema_2_validator: Optional[UnifiedWriteInferenceV3DeploymentRequest] = None
|
|
41
|
+
# data type: UnifiedWriteJobDeploymentRequest
|
|
42
|
+
anyof_schema_3_validator: Optional[UnifiedWriteJobDeploymentRequest] = None
|
|
43
|
+
# data type: UnifiedWriteDynamoDeploymentRequest
|
|
44
|
+
anyof_schema_4_validator: Optional[UnifiedWriteDynamoDeploymentRequest] = None
|
|
45
|
+
if TYPE_CHECKING:
|
|
46
|
+
actual_instance: Optional[Union[UnifiedWriteComputeDeploymentRequest, UnifiedWriteDynamoDeploymentRequest, UnifiedWriteInferenceV3DeploymentRequest, UnifiedWriteJobDeploymentRequest]] = None
|
|
47
|
+
else:
|
|
48
|
+
actual_instance: Any = None
|
|
49
|
+
any_of_schemas: Set[str] = { "UnifiedWriteComputeDeploymentRequest", "UnifiedWriteDynamoDeploymentRequest", "UnifiedWriteInferenceV3DeploymentRequest", "UnifiedWriteJobDeploymentRequest" }
|
|
50
|
+
|
|
51
|
+
model_config = {
|
|
52
|
+
"validate_assignment": True,
|
|
53
|
+
"protected_namespaces": (),
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
57
|
+
if args:
|
|
58
|
+
if len(args) > 1:
|
|
59
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
60
|
+
if kwargs:
|
|
61
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
62
|
+
super().__init__(actual_instance=args[0])
|
|
63
|
+
else:
|
|
64
|
+
super().__init__(**kwargs)
|
|
65
|
+
|
|
66
|
+
@field_validator('actual_instance')
|
|
67
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
68
|
+
instance = UnifiedWriteDeploymentRequest.model_construct()
|
|
69
|
+
error_messages = []
|
|
70
|
+
# validate data type: UnifiedWriteComputeDeploymentRequest
|
|
71
|
+
if not isinstance(v, UnifiedWriteComputeDeploymentRequest):
|
|
72
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `UnifiedWriteComputeDeploymentRequest`")
|
|
73
|
+
else:
|
|
74
|
+
return v
|
|
75
|
+
|
|
76
|
+
# validate data type: UnifiedWriteInferenceV3DeploymentRequest
|
|
77
|
+
if not isinstance(v, UnifiedWriteInferenceV3DeploymentRequest):
|
|
78
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `UnifiedWriteInferenceV3DeploymentRequest`")
|
|
79
|
+
else:
|
|
80
|
+
return v
|
|
81
|
+
|
|
82
|
+
# validate data type: UnifiedWriteJobDeploymentRequest
|
|
83
|
+
if not isinstance(v, UnifiedWriteJobDeploymentRequest):
|
|
84
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `UnifiedWriteJobDeploymentRequest`")
|
|
85
|
+
else:
|
|
86
|
+
return v
|
|
87
|
+
|
|
88
|
+
# validate data type: UnifiedWriteDynamoDeploymentRequest
|
|
89
|
+
if not isinstance(v, UnifiedWriteDynamoDeploymentRequest):
|
|
90
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `UnifiedWriteDynamoDeploymentRequest`")
|
|
91
|
+
else:
|
|
92
|
+
return v
|
|
93
|
+
|
|
94
|
+
if error_messages:
|
|
95
|
+
# no match
|
|
96
|
+
raise ValueError("No match found when setting the actual_instance in UnifiedWriteDeploymentRequest with anyOf schemas: UnifiedWriteComputeDeploymentRequest, UnifiedWriteDynamoDeploymentRequest, UnifiedWriteInferenceV3DeploymentRequest, UnifiedWriteJobDeploymentRequest. Details: " + ", ".join(error_messages))
|
|
97
|
+
else:
|
|
98
|
+
return v
|
|
99
|
+
|
|
100
|
+
@classmethod
|
|
101
|
+
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
|
102
|
+
return cls.from_json(json.dumps(obj))
|
|
103
|
+
|
|
104
|
+
@classmethod
|
|
105
|
+
def from_json(cls, json_str: str) -> Self:
|
|
106
|
+
"""Returns the object represented by the json string"""
|
|
107
|
+
instance = cls.model_construct()
|
|
108
|
+
error_messages = []
|
|
109
|
+
# anyof_schema_1_validator: Optional[UnifiedWriteComputeDeploymentRequest] = None
|
|
110
|
+
try:
|
|
111
|
+
instance.actual_instance = UnifiedWriteComputeDeploymentRequest.from_json(json_str)
|
|
112
|
+
return instance
|
|
113
|
+
except (ValidationError, ValueError) as e:
|
|
114
|
+
error_messages.append(str(e))
|
|
115
|
+
# anyof_schema_2_validator: Optional[UnifiedWriteInferenceV3DeploymentRequest] = None
|
|
116
|
+
try:
|
|
117
|
+
instance.actual_instance = UnifiedWriteInferenceV3DeploymentRequest.from_json(json_str)
|
|
118
|
+
return instance
|
|
119
|
+
except (ValidationError, ValueError) as e:
|
|
120
|
+
error_messages.append(str(e))
|
|
121
|
+
# anyof_schema_3_validator: Optional[UnifiedWriteJobDeploymentRequest] = None
|
|
122
|
+
try:
|
|
123
|
+
instance.actual_instance = UnifiedWriteJobDeploymentRequest.from_json(json_str)
|
|
124
|
+
return instance
|
|
125
|
+
except (ValidationError, ValueError) as e:
|
|
126
|
+
error_messages.append(str(e))
|
|
127
|
+
# anyof_schema_4_validator: Optional[UnifiedWriteDynamoDeploymentRequest] = None
|
|
128
|
+
try:
|
|
129
|
+
instance.actual_instance = UnifiedWriteDynamoDeploymentRequest.from_json(json_str)
|
|
130
|
+
return instance
|
|
131
|
+
except (ValidationError, ValueError) as e:
|
|
132
|
+
error_messages.append(str(e))
|
|
133
|
+
|
|
134
|
+
if error_messages:
|
|
135
|
+
# no match
|
|
136
|
+
raise ValueError("No match found when deserializing the JSON string into UnifiedWriteDeploymentRequest with anyOf schemas: UnifiedWriteComputeDeploymentRequest, UnifiedWriteDynamoDeploymentRequest, UnifiedWriteInferenceV3DeploymentRequest, UnifiedWriteJobDeploymentRequest. Details: " + ", ".join(error_messages))
|
|
137
|
+
else:
|
|
138
|
+
return instance
|
|
139
|
+
|
|
140
|
+
def to_json(self) -> str:
|
|
141
|
+
"""Returns the JSON representation of the actual instance"""
|
|
142
|
+
if self.actual_instance is None:
|
|
143
|
+
return "null"
|
|
144
|
+
|
|
145
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
146
|
+
return self.actual_instance.to_json()
|
|
147
|
+
else:
|
|
148
|
+
return json.dumps(self.actual_instance)
|
|
149
|
+
|
|
150
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], UnifiedWriteComputeDeploymentRequest, UnifiedWriteDynamoDeploymentRequest, UnifiedWriteInferenceV3DeploymentRequest, UnifiedWriteJobDeploymentRequest]]:
|
|
151
|
+
"""Returns the dict representation of the actual instance"""
|
|
152
|
+
if self.actual_instance is None:
|
|
153
|
+
return None
|
|
154
|
+
|
|
155
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
156
|
+
return self.actual_instance.to_dict()
|
|
157
|
+
else:
|
|
158
|
+
return self.actual_instance
|
|
159
|
+
|
|
160
|
+
def to_str(self) -> str:
|
|
161
|
+
"""Returns the string representation of the actual instance"""
|
|
162
|
+
return pprint.pformat(self.model_dump())
|
|
163
|
+
|
|
164
|
+
|
platform_api_python_client/models/{c_serve_v2_recipe.py → unified_write_deployment_response.py}
RENAMED
|
@@ -17,20 +17,24 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
21
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from platform_api_python_client.models.deployment_type import DeploymentType
|
|
22
24
|
from typing import Optional, Set
|
|
23
25
|
from typing_extensions import Self
|
|
24
26
|
|
|
25
|
-
class
|
|
27
|
+
class UnifiedWriteDeploymentResponse(BaseModel):
|
|
26
28
|
"""
|
|
27
|
-
|
|
29
|
+
UnifiedWriteDeploymentResponse
|
|
28
30
|
""" # noqa: E501
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
id: StrictInt
|
|
32
|
+
type: DeploymentType
|
|
33
|
+
created_at: datetime
|
|
34
|
+
updated_at: datetime
|
|
35
|
+
endpoint_url: Optional[StrictStr]
|
|
36
|
+
port: Optional[StrictInt]
|
|
37
|
+
__properties: ClassVar[List[str]] = ["id", "type", "created_at", "updated_at", "endpoint_url", "port"]
|
|
34
38
|
|
|
35
39
|
model_config = ConfigDict(
|
|
36
40
|
populate_by_name=True,
|
|
@@ -50,7 +54,7 @@ class CServeV2Recipe(BaseModel):
|
|
|
50
54
|
|
|
51
55
|
@classmethod
|
|
52
56
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
-
"""Create an instance of
|
|
57
|
+
"""Create an instance of UnifiedWriteDeploymentResponse from a JSON string"""
|
|
54
58
|
return cls.from_dict(json.loads(json_str))
|
|
55
59
|
|
|
56
60
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -62,10 +66,8 @@ class CServeV2Recipe(BaseModel):
|
|
|
62
66
|
* `None` is only added to the output dict for nullable fields that
|
|
63
67
|
were set at model initialization. Other fields with value `None`
|
|
64
68
|
are ignored.
|
|
65
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
66
69
|
"""
|
|
67
70
|
excluded_fields: Set[str] = set([
|
|
68
|
-
"additional_properties",
|
|
69
71
|
])
|
|
70
72
|
|
|
71
73
|
_dict = self.model_dump(
|
|
@@ -73,21 +75,21 @@ class CServeV2Recipe(BaseModel):
|
|
|
73
75
|
exclude=excluded_fields,
|
|
74
76
|
exclude_none=True,
|
|
75
77
|
)
|
|
76
|
-
#
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
# set to None if endpoint_url (nullable) is None
|
|
79
|
+
# and model_fields_set contains the field
|
|
80
|
+
if self.endpoint_url is None and "endpoint_url" in self.model_fields_set:
|
|
81
|
+
_dict['endpoint_url'] = None
|
|
80
82
|
|
|
81
|
-
# set to None if
|
|
83
|
+
# set to None if port (nullable) is None
|
|
82
84
|
# and model_fields_set contains the field
|
|
83
|
-
if self.
|
|
84
|
-
_dict['
|
|
85
|
+
if self.port is None and "port" in self.model_fields_set:
|
|
86
|
+
_dict['port'] = None
|
|
85
87
|
|
|
86
88
|
return _dict
|
|
87
89
|
|
|
88
90
|
@classmethod
|
|
89
91
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
90
|
-
"""Create an instance of
|
|
92
|
+
"""Create an instance of UnifiedWriteDeploymentResponse from a dict"""
|
|
91
93
|
if obj is None:
|
|
92
94
|
return None
|
|
93
95
|
|
|
@@ -95,15 +97,13 @@ class CServeV2Recipe(BaseModel):
|
|
|
95
97
|
return cls.model_validate(obj)
|
|
96
98
|
|
|
97
99
|
_obj = cls.model_validate({
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
100
|
+
"id": obj.get("id"),
|
|
101
|
+
"type": obj.get("type"),
|
|
102
|
+
"created_at": obj.get("created_at"),
|
|
103
|
+
"updated_at": obj.get("updated_at"),
|
|
104
|
+
"endpoint_url": obj.get("endpoint_url"),
|
|
105
|
+
"port": obj.get("port")
|
|
101
106
|
})
|
|
102
|
-
# store additional fields in additional_properties
|
|
103
|
-
for _key in obj.keys():
|
|
104
|
-
if _key not in cls.__properties:
|
|
105
|
-
_obj.additional_properties[_key] = obj.get(_key)
|
|
106
|
-
|
|
107
107
|
return _obj
|
|
108
108
|
|
|
109
109
|
|
|
@@ -0,0 +1,197 @@
|
|
|
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.ccl_dynamo_pools import CclDynamoPools
|
|
24
|
+
from platform_api_python_client.models.dynamo_communications_input import DynamoCommunicationsInput
|
|
25
|
+
from platform_api_python_client.models.dynamo_image import DynamoImage
|
|
26
|
+
from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode
|
|
27
|
+
from platform_api_python_client.models.env import Env
|
|
28
|
+
from platform_api_python_client.models.ingress import Ingress
|
|
29
|
+
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
30
|
+
from typing import Optional, Set
|
|
31
|
+
from typing_extensions import Self
|
|
32
|
+
|
|
33
|
+
class UnifiedWriteDynamoDeploymentRequest(BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
UnifiedWriteDynamoDeploymentRequest
|
|
36
|
+
""" # noqa: E501
|
|
37
|
+
type: StrictStr
|
|
38
|
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
|
|
39
|
+
cluster_id: StrictInt
|
|
40
|
+
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
41
|
+
chart_revision: Optional[StrictStr] = None
|
|
42
|
+
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
43
|
+
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
44
|
+
pools: CclDynamoPools
|
|
45
|
+
env: Optional[Env] = None
|
|
46
|
+
image: Optional[DynamoImage] = None
|
|
47
|
+
ingress: Ingress
|
|
48
|
+
serving_mode: Optional[DynamoServingMode] = None
|
|
49
|
+
communications: Optional[DynamoCommunicationsInput] = None
|
|
50
|
+
model: StrictStr
|
|
51
|
+
served_model_name: Optional[StrictStr] = None
|
|
52
|
+
extra_args: Optional[StrictStr] = None
|
|
53
|
+
hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
54
|
+
enable_logging: Optional[StrictBool] = True
|
|
55
|
+
enable_node_model_cache: Optional[StrictBool] = False
|
|
56
|
+
__properties: ClassVar[List[str]] = ["type", "name", "cluster_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "pools", "env", "image", "ingress", "serving_mode", "communications", "model", "served_model_name", "extra_args", "hf_token_ref", "enable_logging", "enable_node_model_cache"]
|
|
57
|
+
|
|
58
|
+
@field_validator('type')
|
|
59
|
+
def type_validate_enum(cls, value):
|
|
60
|
+
"""Validates the enum"""
|
|
61
|
+
if value not in set(['ccl_dynamo']):
|
|
62
|
+
raise ValueError("must be one of enum values ('ccl_dynamo')")
|
|
63
|
+
return value
|
|
64
|
+
|
|
65
|
+
@field_validator('name')
|
|
66
|
+
def name_validate_regular_expression(cls, value):
|
|
67
|
+
"""Validates the regular expression"""
|
|
68
|
+
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
69
|
+
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
70
|
+
return value
|
|
71
|
+
|
|
72
|
+
model_config = ConfigDict(
|
|
73
|
+
populate_by_name=True,
|
|
74
|
+
validate_assignment=True,
|
|
75
|
+
protected_namespaces=(),
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def to_str(self) -> str:
|
|
80
|
+
"""Returns the string representation of the model using alias"""
|
|
81
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
82
|
+
|
|
83
|
+
def to_json(self) -> str:
|
|
84
|
+
"""Returns the JSON representation of the model using alias"""
|
|
85
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
86
|
+
return json.dumps(self.to_dict())
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
90
|
+
"""Create an instance of UnifiedWriteDynamoDeploymentRequest from a JSON string"""
|
|
91
|
+
return cls.from_dict(json.loads(json_str))
|
|
92
|
+
|
|
93
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
94
|
+
"""Return the dictionary representation of the model using alias.
|
|
95
|
+
|
|
96
|
+
This has the following differences from calling pydantic's
|
|
97
|
+
`self.model_dump(by_alias=True)`:
|
|
98
|
+
|
|
99
|
+
* `None` is only added to the output dict for nullable fields that
|
|
100
|
+
were set at model initialization. Other fields with value `None`
|
|
101
|
+
are ignored.
|
|
102
|
+
"""
|
|
103
|
+
excluded_fields: Set[str] = set([
|
|
104
|
+
])
|
|
105
|
+
|
|
106
|
+
_dict = self.model_dump(
|
|
107
|
+
by_alias=True,
|
|
108
|
+
exclude=excluded_fields,
|
|
109
|
+
exclude_none=True,
|
|
110
|
+
)
|
|
111
|
+
# override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
|
|
112
|
+
_items = []
|
|
113
|
+
if self.volume_mounts:
|
|
114
|
+
for _item_volume_mounts in self.volume_mounts:
|
|
115
|
+
if _item_volume_mounts:
|
|
116
|
+
_items.append(_item_volume_mounts.to_dict())
|
|
117
|
+
_dict['volume_mounts'] = _items
|
|
118
|
+
# override the default output from pydantic by calling `to_dict()` of pools
|
|
119
|
+
if self.pools:
|
|
120
|
+
_dict['pools'] = self.pools.to_dict()
|
|
121
|
+
# override the default output from pydantic by calling `to_dict()` of env
|
|
122
|
+
if self.env:
|
|
123
|
+
_dict['env'] = self.env.to_dict()
|
|
124
|
+
# override the default output from pydantic by calling `to_dict()` of image
|
|
125
|
+
if self.image:
|
|
126
|
+
_dict['image'] = self.image.to_dict()
|
|
127
|
+
# override the default output from pydantic by calling `to_dict()` of ingress
|
|
128
|
+
if self.ingress:
|
|
129
|
+
_dict['ingress'] = self.ingress.to_dict()
|
|
130
|
+
# override the default output from pydantic by calling `to_dict()` of communications
|
|
131
|
+
if self.communications:
|
|
132
|
+
_dict['communications'] = self.communications.to_dict()
|
|
133
|
+
# set to None if user_annotations (nullable) is None
|
|
134
|
+
# and model_fields_set contains the field
|
|
135
|
+
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
136
|
+
_dict['user_annotations'] = None
|
|
137
|
+
|
|
138
|
+
# set to None if priority (nullable) is None
|
|
139
|
+
# and model_fields_set contains the field
|
|
140
|
+
if self.priority is None and "priority" in self.model_fields_set:
|
|
141
|
+
_dict['priority'] = None
|
|
142
|
+
|
|
143
|
+
# set to None if communications (nullable) is None
|
|
144
|
+
# and model_fields_set contains the field
|
|
145
|
+
if self.communications is None and "communications" in self.model_fields_set:
|
|
146
|
+
_dict['communications'] = None
|
|
147
|
+
|
|
148
|
+
# set to None if served_model_name (nullable) is None
|
|
149
|
+
# and model_fields_set contains the field
|
|
150
|
+
if self.served_model_name is None and "served_model_name" in self.model_fields_set:
|
|
151
|
+
_dict['served_model_name'] = None
|
|
152
|
+
|
|
153
|
+
# set to None if extra_args (nullable) is None
|
|
154
|
+
# and model_fields_set contains the field
|
|
155
|
+
if self.extra_args is None and "extra_args" in self.model_fields_set:
|
|
156
|
+
_dict['extra_args'] = None
|
|
157
|
+
|
|
158
|
+
# set to None if hf_token_ref (nullable) is None
|
|
159
|
+
# and model_fields_set contains the field
|
|
160
|
+
if self.hf_token_ref is None and "hf_token_ref" in self.model_fields_set:
|
|
161
|
+
_dict['hf_token_ref'] = None
|
|
162
|
+
|
|
163
|
+
return _dict
|
|
164
|
+
|
|
165
|
+
@classmethod
|
|
166
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
167
|
+
"""Create an instance of UnifiedWriteDynamoDeploymentRequest from a dict"""
|
|
168
|
+
if obj is None:
|
|
169
|
+
return None
|
|
170
|
+
|
|
171
|
+
if not isinstance(obj, dict):
|
|
172
|
+
return cls.model_validate(obj)
|
|
173
|
+
|
|
174
|
+
_obj = cls.model_validate({
|
|
175
|
+
"type": obj.get("type"),
|
|
176
|
+
"name": obj.get("name"),
|
|
177
|
+
"cluster_id": obj.get("cluster_id"),
|
|
178
|
+
"user_annotations": obj.get("user_annotations"),
|
|
179
|
+
"chart_revision": obj.get("chart_revision"),
|
|
180
|
+
"volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
|
|
181
|
+
"priority": obj.get("priority"),
|
|
182
|
+
"pools": CclDynamoPools.from_dict(obj["pools"]) if obj.get("pools") is not None else None,
|
|
183
|
+
"env": Env.from_dict(obj["env"]) if obj.get("env") is not None else None,
|
|
184
|
+
"image": DynamoImage.from_dict(obj["image"]) if obj.get("image") is not None else None,
|
|
185
|
+
"ingress": Ingress.from_dict(obj["ingress"]) if obj.get("ingress") is not None else None,
|
|
186
|
+
"serving_mode": obj.get("serving_mode"),
|
|
187
|
+
"communications": DynamoCommunicationsInput.from_dict(obj["communications"]) if obj.get("communications") is not None else None,
|
|
188
|
+
"model": obj.get("model"),
|
|
189
|
+
"served_model_name": obj.get("served_model_name"),
|
|
190
|
+
"extra_args": obj.get("extra_args"),
|
|
191
|
+
"hf_token_ref": obj.get("hf_token_ref"),
|
|
192
|
+
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
|
|
193
|
+
"enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False
|
|
194
|
+
})
|
|
195
|
+
return _obj
|
|
196
|
+
|
|
197
|
+
|