platform-api-python-client 4.23.1__py3-none-any.whl → 4.28.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- platform_api_python_client/__init__.py +18 -3
- platform_api_python_client/api/external_api.py +4508 -1469
- platform_api_python_client/api_client.py +1 -1
- platform_api_python_client/configuration.py +1 -1
- platform_api_python_client/models/__init__.py +17 -2
- platform_api_python_client/models/create_c_serve_v3_deployment_request.py +1 -8
- platform_api_python_client/models/create_compute_deployment_request.py +12 -2
- platform_api_python_client/models/create_dynamo_deployment_request.py +22 -3
- platform_api_python_client/models/{create_block_volume_request.py → create_filesystem_volume_request.py} +6 -6
- platform_api_python_client/models/create_inference_v3_deployment_request.py +1 -8
- platform_api_python_client/models/create_job_deployment_request.py +12 -2
- platform_api_python_client/models/create_volume_request.py +16 -16
- platform_api_python_client/models/delete_user_vault_item_request.py +108 -0
- platform_api_python_client/models/deployment_component_type.py +2 -0
- platform_api_python_client/models/deployment_log_event_v4.py +91 -0
- platform_api_python_client/models/deployment_response.py +21 -6
- platform_api_python_client/models/dynamo_serving_mode.py +37 -0
- platform_api_python_client/models/dynamo_worker_pool_config.py +103 -0
- platform_api_python_client/models/dynamo_worker_pools.py +109 -0
- platform_api_python_client/models/get_c_serve_v3_deployment_response.py +1 -8
- platform_api_python_client/models/get_cluster_response.py +5 -3
- platform_api_python_client/models/get_compute_deployment_response.py +11 -1
- platform_api_python_client/models/get_deployment_log_v4_response.py +95 -0
- platform_api_python_client/models/get_deployment_pods_response.py +87 -0
- platform_api_python_client/models/get_dynamo_deployment_response.py +15 -1
- platform_api_python_client/models/{get_block_volume_response.py → get_filesystem_volume_response.py} +6 -6
- platform_api_python_client/models/get_inference_v3_deployment_response.py +1 -8
- platform_api_python_client/models/get_job_deployment_response.py +12 -2
- platform_api_python_client/models/get_volume_response.py +16 -16
- platform_api_python_client/models/hardware_preset_response.py +96 -0
- platform_api_python_client/models/list_hardware_preset_response.py +95 -0
- platform_api_python_client/models/list_organization_gpu_quota_response.py +95 -0
- platform_api_python_client/models/organization_gpu_quota_request.py +88 -0
- platform_api_python_client/models/organization_gpu_quota_response.py +91 -0
- platform_api_python_client/models/update_cluster_metadata_request.py +87 -0
- platform_api_python_client/models/upsert_user_vault_item_request.py +103 -0
- platform_api_python_client/models/user_vault_item.py +6 -3
- platform_api_python_client/models/volume_access_mode.py +0 -1
- platform_api_python_client/models/volume_backend.py +1 -1
- platform_api_python_client/models/volume_mount.py +92 -0
- {platform_api_python_client-4.23.1.dist-info → platform_api_python_client-4.28.0.dist-info}/METADATA +1 -1
- {platform_api_python_client-4.23.1.dist-info → platform_api_python_client-4.28.0.dist-info}/RECORD +44 -29
- {platform_api_python_client-4.23.1.dist-info → platform_api_python_client-4.28.0.dist-info}/WHEEL +1 -1
- {platform_api_python_client-4.23.1.dist-info → platform_api_python_client-4.28.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
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, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class DeploymentLogEventV4(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
DeploymentLogEventV4
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
id: StrictStr = Field(description="Stable event identity: '<nanosecond timestamp>-<content hash>'. Deduplication key for the re-deliveries of fetch_newer pages; its nanosecond prefix orders events (sorted insert for late arrivals, never append).")
|
|
30
|
+
timestamp: StrictInt = Field(description="Event timestamp in epoch milliseconds.")
|
|
31
|
+
message: StrictStr = Field(description="Raw log line as emitted by the container.")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["id", "timestamp", "message"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of DeploymentLogEventV4 from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of DeploymentLogEventV4 from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"id": obj.get("id"),
|
|
86
|
+
"timestamp": obj.get("timestamp"),
|
|
87
|
+
"message": obj.get("message")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -20,13 +20,14 @@ import re # noqa: F401
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
21
21
|
from typing import Optional
|
|
22
22
|
from platform_api_python_client.models.get_c_serve_v3_deployment_response import GetCServeV3DeploymentResponse
|
|
23
|
+
from platform_api_python_client.models.get_compute_deployment_response import GetComputeDeploymentResponse
|
|
23
24
|
from platform_api_python_client.models.get_dynamo_deployment_response import GetDynamoDeploymentResponse
|
|
24
25
|
from platform_api_python_client.models.get_inference_v3_deployment_response import GetInferenceV3DeploymentResponse
|
|
25
26
|
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
26
27
|
from typing_extensions import Literal, Self
|
|
27
28
|
from pydantic import Field
|
|
28
29
|
|
|
29
|
-
DEPLOYMENTRESPONSE_ANY_OF_SCHEMAS = ["GetCServeV3DeploymentResponse", "GetDynamoDeploymentResponse", "GetInferenceV3DeploymentResponse"]
|
|
30
|
+
DEPLOYMENTRESPONSE_ANY_OF_SCHEMAS = ["GetCServeV3DeploymentResponse", "GetComputeDeploymentResponse", "GetDynamoDeploymentResponse", "GetInferenceV3DeploymentResponse"]
|
|
30
31
|
|
|
31
32
|
class DeploymentResponse(BaseModel):
|
|
32
33
|
"""
|
|
@@ -39,11 +40,13 @@ class DeploymentResponse(BaseModel):
|
|
|
39
40
|
anyof_schema_2_validator: Optional[GetCServeV3DeploymentResponse] = None
|
|
40
41
|
# data type: GetInferenceV3DeploymentResponse
|
|
41
42
|
anyof_schema_3_validator: Optional[GetInferenceV3DeploymentResponse] = None
|
|
43
|
+
# data type: GetComputeDeploymentResponse
|
|
44
|
+
anyof_schema_4_validator: Optional[GetComputeDeploymentResponse] = None
|
|
42
45
|
if TYPE_CHECKING:
|
|
43
|
-
actual_instance: Optional[Union[GetCServeV3DeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse]] = None
|
|
46
|
+
actual_instance: Optional[Union[GetCServeV3DeploymentResponse, GetComputeDeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse]] = None
|
|
44
47
|
else:
|
|
45
48
|
actual_instance: Any = None
|
|
46
|
-
any_of_schemas: Set[str] = { "GetCServeV3DeploymentResponse", "GetDynamoDeploymentResponse", "GetInferenceV3DeploymentResponse" }
|
|
49
|
+
any_of_schemas: Set[str] = { "GetCServeV3DeploymentResponse", "GetComputeDeploymentResponse", "GetDynamoDeploymentResponse", "GetInferenceV3DeploymentResponse" }
|
|
47
50
|
|
|
48
51
|
model_config = {
|
|
49
52
|
"validate_assignment": True,
|
|
@@ -82,9 +85,15 @@ class DeploymentResponse(BaseModel):
|
|
|
82
85
|
else:
|
|
83
86
|
return v
|
|
84
87
|
|
|
88
|
+
# validate data type: GetComputeDeploymentResponse
|
|
89
|
+
if not isinstance(v, GetComputeDeploymentResponse):
|
|
90
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `GetComputeDeploymentResponse`")
|
|
91
|
+
else:
|
|
92
|
+
return v
|
|
93
|
+
|
|
85
94
|
if error_messages:
|
|
86
95
|
# no match
|
|
87
|
-
raise ValueError("No match found when setting the actual_instance in DeploymentResponse with anyOf schemas: GetCServeV3DeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse. Details: " + ", ".join(error_messages))
|
|
96
|
+
raise ValueError("No match found when setting the actual_instance in DeploymentResponse with anyOf schemas: GetCServeV3DeploymentResponse, GetComputeDeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse. Details: " + ", ".join(error_messages))
|
|
88
97
|
else:
|
|
89
98
|
return v
|
|
90
99
|
|
|
@@ -115,10 +124,16 @@ class DeploymentResponse(BaseModel):
|
|
|
115
124
|
return instance
|
|
116
125
|
except (ValidationError, ValueError) as e:
|
|
117
126
|
error_messages.append(str(e))
|
|
127
|
+
# anyof_schema_4_validator: Optional[GetComputeDeploymentResponse] = None
|
|
128
|
+
try:
|
|
129
|
+
instance.actual_instance = GetComputeDeploymentResponse.from_json(json_str)
|
|
130
|
+
return instance
|
|
131
|
+
except (ValidationError, ValueError) as e:
|
|
132
|
+
error_messages.append(str(e))
|
|
118
133
|
|
|
119
134
|
if error_messages:
|
|
120
135
|
# no match
|
|
121
|
-
raise ValueError("No match found when deserializing the JSON string into DeploymentResponse with anyOf schemas: GetCServeV3DeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse. Details: " + ", ".join(error_messages))
|
|
136
|
+
raise ValueError("No match found when deserializing the JSON string into DeploymentResponse with anyOf schemas: GetCServeV3DeploymentResponse, GetComputeDeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse. Details: " + ", ".join(error_messages))
|
|
122
137
|
else:
|
|
123
138
|
return instance
|
|
124
139
|
|
|
@@ -132,7 +147,7 @@ class DeploymentResponse(BaseModel):
|
|
|
132
147
|
else:
|
|
133
148
|
return json.dumps(self.actual_instance)
|
|
134
149
|
|
|
135
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], GetCServeV3DeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse]]:
|
|
150
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], GetCServeV3DeploymentResponse, GetComputeDeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse]]:
|
|
136
151
|
"""Returns the dict representation of the actual instance"""
|
|
137
152
|
if self.actual_instance is None:
|
|
138
153
|
return None
|
|
@@ -0,0 +1,37 @@
|
|
|
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 json
|
|
17
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class DynamoServingMode(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
DynamoServingMode
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
AGGREGATED = 'aggregated'
|
|
30
|
+
DISAGGREGATED = 'disaggregated'
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def from_json(cls, json_str: str) -> Self:
|
|
34
|
+
"""Create an instance of DynamoServingMode from a JSON string"""
|
|
35
|
+
return cls(json.loads(json_str))
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
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, StrictInt
|
|
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 DynamoWorkerPoolConfig(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
DynamoWorkerPoolConfig
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
hardware_instance_id: StrictInt
|
|
31
|
+
replicas: Annotated[int, Field(strict=True, ge=1)]
|
|
32
|
+
additional_properties: Dict[str, Any] = {}
|
|
33
|
+
__properties: ClassVar[List[str]] = ["hardware_instance_id", "replicas"]
|
|
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 DynamoWorkerPoolConfig 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
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
"additional_properties",
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# puts key-value pairs in additional_properties in the top level
|
|
77
|
+
if self.additional_properties is not None:
|
|
78
|
+
for _key, _value in self.additional_properties.items():
|
|
79
|
+
_dict[_key] = _value
|
|
80
|
+
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of DynamoWorkerPoolConfig 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
|
+
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
94
|
+
"replicas": obj.get("replicas")
|
|
95
|
+
})
|
|
96
|
+
# store additional fields in additional_properties
|
|
97
|
+
for _key in obj.keys():
|
|
98
|
+
if _key not in cls.__properties:
|
|
99
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
100
|
+
|
|
101
|
+
return _obj
|
|
102
|
+
|
|
103
|
+
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from platform_api_python_client.models.dynamo_worker_pool_config import DynamoWorkerPoolConfig
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class DynamoWorkerPools(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
DynamoWorkerPools
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
prefill: DynamoWorkerPoolConfig
|
|
31
|
+
decode: DynamoWorkerPoolConfig
|
|
32
|
+
additional_properties: Dict[str, Any] = {}
|
|
33
|
+
__properties: ClassVar[List[str]] = ["prefill", "decode"]
|
|
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 DynamoWorkerPools 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
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
"additional_properties",
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of prefill
|
|
77
|
+
if self.prefill:
|
|
78
|
+
_dict['prefill'] = self.prefill.to_dict()
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of decode
|
|
80
|
+
if self.decode:
|
|
81
|
+
_dict['decode'] = self.decode.to_dict()
|
|
82
|
+
# puts key-value pairs in additional_properties in the top level
|
|
83
|
+
if self.additional_properties is not None:
|
|
84
|
+
for _key, _value in self.additional_properties.items():
|
|
85
|
+
_dict[_key] = _value
|
|
86
|
+
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of DynamoWorkerPools from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return cls.model_validate(obj)
|
|
97
|
+
|
|
98
|
+
_obj = cls.model_validate({
|
|
99
|
+
"prefill": DynamoWorkerPoolConfig.from_dict(obj["prefill"]) if obj.get("prefill") is not None else None,
|
|
100
|
+
"decode": DynamoWorkerPoolConfig.from_dict(obj["decode"]) if obj.get("decode") is not None else None
|
|
101
|
+
})
|
|
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
|
+
return _obj
|
|
108
|
+
|
|
109
|
+
|
|
@@ -46,7 +46,6 @@ class GetCServeV3DeploymentResponse(BaseModel):
|
|
|
46
46
|
cserve_version: Optional[StrictStr] = None
|
|
47
47
|
min_replicas: StrictInt
|
|
48
48
|
max_replicas: StrictInt
|
|
49
|
-
initial_replicas: Optional[StrictInt] = None
|
|
50
49
|
endpoint_certificate_authority: Optional[StrictStr] = None
|
|
51
50
|
endpoint_bearer_token: Optional[StrictStr] = None
|
|
52
51
|
concurrency: Optional[StrictInt] = None
|
|
@@ -55,7 +54,7 @@ class GetCServeV3DeploymentResponse(BaseModel):
|
|
|
55
54
|
enable_logging: Optional[StrictBool] = True
|
|
56
55
|
enable_node_model_cache: Optional[StrictBool] = False
|
|
57
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.")
|
|
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", "
|
|
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"]
|
|
59
58
|
|
|
60
59
|
model_config = ConfigDict(
|
|
61
60
|
populate_by_name=True,
|
|
@@ -114,11 +113,6 @@ class GetCServeV3DeploymentResponse(BaseModel):
|
|
|
114
113
|
if self.cserve_version is None and "cserve_version" in self.model_fields_set:
|
|
115
114
|
_dict['cserve_version'] = None
|
|
116
115
|
|
|
117
|
-
# set to None if initial_replicas (nullable) is None
|
|
118
|
-
# and model_fields_set contains the field
|
|
119
|
-
if self.initial_replicas is None and "initial_replicas" in self.model_fields_set:
|
|
120
|
-
_dict['initial_replicas'] = None
|
|
121
|
-
|
|
122
116
|
# set to None if endpoint_certificate_authority (nullable) is None
|
|
123
117
|
# and model_fields_set contains the field
|
|
124
118
|
if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
|
|
@@ -162,7 +156,6 @@ class GetCServeV3DeploymentResponse(BaseModel):
|
|
|
162
156
|
"cserve_version": obj.get("cserve_version"),
|
|
163
157
|
"min_replicas": obj.get("min_replicas"),
|
|
164
158
|
"max_replicas": obj.get("max_replicas"),
|
|
165
|
-
"initial_replicas": obj.get("initial_replicas"),
|
|
166
159
|
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
167
160
|
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
|
|
168
161
|
"concurrency": obj.get("concurrency"),
|
|
@@ -17,7 +17,7 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
@@ -30,7 +30,8 @@ class GetClusterResponse(BaseModel):
|
|
|
30
30
|
cluster_name: StrictStr
|
|
31
31
|
display_name: StrictStr
|
|
32
32
|
region: Optional[StrictStr] = None
|
|
33
|
-
|
|
33
|
+
deployment_creation_disabled: Optional[StrictBool] = False
|
|
34
|
+
__properties: ClassVar[List[str]] = ["id", "cluster_name", "display_name", "region", "deployment_creation_disabled"]
|
|
34
35
|
|
|
35
36
|
model_config = ConfigDict(
|
|
36
37
|
populate_by_name=True,
|
|
@@ -91,7 +92,8 @@ class GetClusterResponse(BaseModel):
|
|
|
91
92
|
"id": obj.get("id"),
|
|
92
93
|
"cluster_name": obj.get("cluster_name"),
|
|
93
94
|
"display_name": obj.get("display_name"),
|
|
94
|
-
"region": obj.get("region")
|
|
95
|
+
"region": obj.get("region"),
|
|
96
|
+
"deployment_creation_disabled": obj.get("deployment_creation_disabled") if obj.get("deployment_creation_disabled") is not None else False
|
|
95
97
|
})
|
|
96
98
|
return _obj
|
|
97
99
|
|
|
@@ -23,6 +23,7 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
23
23
|
from platform_api_python_client.models.deployment_status import DeploymentStatus
|
|
24
24
|
from platform_api_python_client.models.deployment_type import DeploymentType
|
|
25
25
|
from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials
|
|
26
|
+
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
26
27
|
from typing import Optional, Set
|
|
27
28
|
from typing_extensions import Self
|
|
28
29
|
|
|
@@ -43,12 +44,13 @@ class GetComputeDeploymentResponse(BaseModel):
|
|
|
43
44
|
revision_number: StrictInt
|
|
44
45
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
45
46
|
exposed_port: StrictInt
|
|
47
|
+
volume_mounts: Optional[List[VolumeMount]] = None
|
|
46
48
|
ssh_public_key: Optional[StrictStr] = None
|
|
47
49
|
ssh_password: Optional[StrictStr] = None
|
|
48
50
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
49
51
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
50
52
|
enable_logging: Optional[StrictBool] = True
|
|
51
|
-
__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", "exposed_port", "ssh_public_key", "ssh_password", "env_vars", "image_pull_secret_credentials", "enable_logging"]
|
|
53
|
+
__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", "exposed_port", "volume_mounts", "ssh_public_key", "ssh_password", "env_vars", "image_pull_secret_credentials", "enable_logging"]
|
|
52
54
|
|
|
53
55
|
model_config = ConfigDict(
|
|
54
56
|
populate_by_name=True,
|
|
@@ -89,6 +91,13 @@ class GetComputeDeploymentResponse(BaseModel):
|
|
|
89
91
|
exclude=excluded_fields,
|
|
90
92
|
exclude_none=True,
|
|
91
93
|
)
|
|
94
|
+
# override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
|
|
95
|
+
_items = []
|
|
96
|
+
if self.volume_mounts:
|
|
97
|
+
for _item_volume_mounts in self.volume_mounts:
|
|
98
|
+
if _item_volume_mounts:
|
|
99
|
+
_items.append(_item_volume_mounts.to_dict())
|
|
100
|
+
_dict['volume_mounts'] = _items
|
|
92
101
|
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
93
102
|
if self.image_pull_secret_credentials:
|
|
94
103
|
_dict['image_pull_secret_credentials'] = self.image_pull_secret_credentials.to_dict()
|
|
@@ -147,6 +156,7 @@ class GetComputeDeploymentResponse(BaseModel):
|
|
|
147
156
|
"revision_number": obj.get("revision_number"),
|
|
148
157
|
"user_annotations": obj.get("user_annotations"),
|
|
149
158
|
"exposed_port": obj.get("exposed_port"),
|
|
159
|
+
"volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
|
|
150
160
|
"ssh_public_key": obj.get("ssh_public_key"),
|
|
151
161
|
"ssh_password": obj.get("ssh_password"),
|
|
152
162
|
"env_vars": obj.get("env_vars"),
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from platform_api_python_client.models.deployment_log_event_v4 import DeploymentLogEventV4
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetDeploymentLogV4Response(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetDeploymentLogV4Response
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
events: List[DeploymentLogEventV4] = Field(description="Log events, oldest first. Page boundaries are minted client-side from the events' timestamp field (see the endpoint description): an empty fetch_newer=false page means history is exhausted; an empty fetch_newer=true page means nothing new yet.")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["events"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of GetDeploymentLogV4Response from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of each item in events (list)
|
|
73
|
+
_items = []
|
|
74
|
+
if self.events:
|
|
75
|
+
for _item_events in self.events:
|
|
76
|
+
if _item_events:
|
|
77
|
+
_items.append(_item_events.to_dict())
|
|
78
|
+
_dict['events'] = _items
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of GetDeploymentLogV4Response from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"events": [DeploymentLogEventV4.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|