platform-api-python-client 4.28.0__py3-none-any.whl → 4.37.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- platform_api_python_client/__init__.py +43 -10
- platform_api_python_client/api/external_api.py +6332 -1348
- platform_api_python_client/api_client.py +1 -1
- platform_api_python_client/configuration.py +1 -1
- platform_api_python_client/models/__init__.py +42 -9
- platform_api_python_client/models/ccl_dynamo_pools.py +116 -0
- platform_api_python_client/models/{create_c_serve_v2_deployment_response.py → ccl_main_pools.py} +12 -13
- platform_api_python_client/models/cloud_provider.py +5 -0
- platform_api_python_client/models/cluster_credential.py +2 -2
- platform_api_python_client/models/create_compute_deployment_request.py +40 -7
- platform_api_python_client/models/create_dynamo_deployment_request.py +97 -6
- platform_api_python_client/models/create_inference_v3_deployment_request.py +59 -2
- platform_api_python_client/models/create_job_deployment_request.py +43 -10
- platform_api_python_client/models/create_object_volume_request.py +19 -19
- platform_api_python_client/models/deployment_response.py +23 -23
- platform_api_python_client/models/deployment_type.py +14 -0
- platform_api_python_client/models/{c_serve_recipe_perf.py → dynamo_communications_input.py} +12 -19
- platform_api_python_client/models/dynamo_communications_output.py +91 -0
- platform_api_python_client/models/dynamo_image.py +105 -0
- platform_api_python_client/models/dynamo_kv_transfer_configuration.py +88 -0
- platform_api_python_client/models/dynamo_kv_transfer_policy.py +37 -0
- platform_api_python_client/models/dynamo_weight_transfer_configuration.py +88 -0
- platform_api_python_client/models/dynamo_weight_transfer_policy.py +36 -0
- platform_api_python_client/models/dynamo_worker_pool_config.py +37 -17
- platform_api_python_client/models/dynamo_worker_pools.py +23 -16
- platform_api_python_client/models/env.py +89 -0
- platform_api_python_client/models/get_cluster_response.py +4 -2
- platform_api_python_client/models/get_compute_deployment_response.py +45 -4
- platform_api_python_client/models/get_deployment_response.py +26 -2
- platform_api_python_client/models/get_deployment_usage_response.py +19 -4
- platform_api_python_client/models/get_dynamo_deployment_response.py +89 -5
- platform_api_python_client/models/get_inference_deployment_response.py +25 -1
- platform_api_python_client/models/get_inference_v3_deployment_response.py +67 -2
- platform_api_python_client/models/get_job_deployment_response.py +52 -11
- platform_api_python_client/models/get_object_volume_response.py +2 -16
- platform_api_python_client/models/hardware_instance_response.py +6 -4
- platform_api_python_client/models/image.py +112 -0
- platform_api_python_client/models/ingress.py +103 -0
- platform_api_python_client/models/insight_list_item_response.py +108 -0
- platform_api_python_client/models/insight_resource.py +97 -0
- platform_api_python_client/models/insight_resource_type.py +37 -0
- platform_api_python_client/models/insight_response.py +133 -0
- platform_api_python_client/models/insight_severity.py +40 -0
- platform_api_python_client/models/insight_status.py +39 -0
- platform_api_python_client/models/{c_serve_recipe_response.py → insight_status_change_response.py} +28 -24
- platform_api_python_client/models/list_insights_response.py +95 -0
- platform_api_python_client/models/metric.py +13 -0
- platform_api_python_client/models/pool.py +116 -0
- platform_api_python_client/models/unified_get_compute_deployment_response.py +177 -0
- platform_api_python_client/models/unified_get_deployment_logs_response.py +95 -0
- platform_api_python_client/models/{create_c_serve_v3_deployment_response.py → unified_get_deployment_pods_response.py} +8 -13
- platform_api_python_client/models/unified_get_deployment_response.py +164 -0
- platform_api_python_client/models/unified_get_deployment_revision_response.py +109 -0
- platform_api_python_client/models/unified_get_deployment_rollout_response.py +90 -0
- platform_api_python_client/models/unified_get_deployment_usage_response.py +110 -0
- platform_api_python_client/models/unified_get_dynamo_deployment_response.py +218 -0
- platform_api_python_client/models/unified_get_inference_v3_deployment_response.py +228 -0
- platform_api_python_client/models/unified_get_job_deployment_response.py +204 -0
- platform_api_python_client/models/{list_c_serve_recipe_response.py → unified_list_deployment_revisions_response.py} +7 -7
- platform_api_python_client/models/unified_update_deployment_rollout_request.py +87 -0
- platform_api_python_client/models/unified_write_compute_deployment_request.py +154 -0
- platform_api_python_client/models/unified_write_deployment_request.py +164 -0
- platform_api_python_client/models/{c_serve_v2_recipe.py → unified_write_deployment_response.py} +27 -27
- platform_api_python_client/models/unified_write_dynamo_deployment_request.py +197 -0
- platform_api_python_client/models/unified_write_inference_v3_deployment_request.py +207 -0
- platform_api_python_client/models/unified_write_job_deployment_request.py +183 -0
- platform_api_python_client/models/update_insight_status_request.py +106 -0
- platform_api_python_client/models/upsert_user_vault_item_request.py +1 -1
- platform_api_python_client/models/usage_availability.py +40 -0
- platform_api_python_client/models/usage_component.py +39 -0
- platform_api_python_client/models/validation_error.py +12 -3
- platform_api_python_client/models/volume_mount.py +1 -1
- {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/METADATA +1 -1
- {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/RECORD +76 -43
- {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/WHEEL +1 -1
- platform_api_python_client/models/create_c_serve_v3_deployment_request.py +0 -182
- platform_api_python_client/models/get_c_serve_v2_deployment_response.py +0 -169
- platform_api_python_client/models/get_c_serve_v3_deployment_response.py +0 -170
- {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/top_level.txt +0 -0
platform_api_python_client/models/{c_serve_recipe_response.py → insight_status_change_response.py}
RENAMED
|
@@ -17,21 +17,23 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
+
from datetime import datetime
|
|
20
21
|
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from platform_api_python_client.models.
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from platform_api_python_client.models.insight_status import InsightStatus
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
26
|
-
class
|
|
27
|
+
class InsightStatusChangeResponse(BaseModel):
|
|
27
28
|
"""
|
|
28
|
-
|
|
29
|
+
InsightStatusChangeResponse
|
|
29
30
|
""" # noqa: E501
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
from_status: InsightStatus
|
|
32
|
+
to_status: InsightStatus
|
|
33
|
+
actor_name: Optional[StrictStr] = None
|
|
34
|
+
created_at: datetime
|
|
35
|
+
comment: Optional[StrictStr] = None
|
|
36
|
+
__properties: ClassVar[List[str]] = ["from_status", "to_status", "actor_name", "created_at", "comment"]
|
|
35
37
|
|
|
36
38
|
model_config = ConfigDict(
|
|
37
39
|
populate_by_name=True,
|
|
@@ -51,7 +53,7 @@ class CServeRecipeResponse(BaseModel):
|
|
|
51
53
|
|
|
52
54
|
@classmethod
|
|
53
55
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
-
"""Create an instance of
|
|
56
|
+
"""Create an instance of InsightStatusChangeResponse from a JSON string"""
|
|
55
57
|
return cls.from_dict(json.loads(json_str))
|
|
56
58
|
|
|
57
59
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -72,20 +74,21 @@ class CServeRecipeResponse(BaseModel):
|
|
|
72
74
|
exclude=excluded_fields,
|
|
73
75
|
exclude_none=True,
|
|
74
76
|
)
|
|
75
|
-
#
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
#
|
|
82
|
-
if self.
|
|
83
|
-
_dict['
|
|
77
|
+
# set to None if actor_name (nullable) is None
|
|
78
|
+
# and model_fields_set contains the field
|
|
79
|
+
if self.actor_name is None and "actor_name" in self.model_fields_set:
|
|
80
|
+
_dict['actor_name'] = None
|
|
81
|
+
|
|
82
|
+
# set to None if comment (nullable) is None
|
|
83
|
+
# and model_fields_set contains the field
|
|
84
|
+
if self.comment is None and "comment" in self.model_fields_set:
|
|
85
|
+
_dict['comment'] = None
|
|
86
|
+
|
|
84
87
|
return _dict
|
|
85
88
|
|
|
86
89
|
@classmethod
|
|
87
90
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
-
"""Create an instance of
|
|
91
|
+
"""Create an instance of InsightStatusChangeResponse from a dict"""
|
|
89
92
|
if obj is None:
|
|
90
93
|
return None
|
|
91
94
|
|
|
@@ -93,10 +96,11 @@ class CServeRecipeResponse(BaseModel):
|
|
|
93
96
|
return cls.model_validate(obj)
|
|
94
97
|
|
|
95
98
|
_obj = cls.model_validate({
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
99
|
+
"from_status": obj.get("from_status"),
|
|
100
|
+
"to_status": obj.get("to_status"),
|
|
101
|
+
"actor_name": obj.get("actor_name"),
|
|
102
|
+
"created_at": obj.get("created_at"),
|
|
103
|
+
"comment": obj.get("comment")
|
|
100
104
|
})
|
|
101
105
|
return _obj
|
|
102
106
|
|
|
@@ -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.insight_list_item_response import InsightListItemResponse
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ListInsightsResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ListInsightsResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
results: List[InsightListItemResponse] = Field(description="Newest first. A page shorter than the requested limit is the last one; pass the last id as before_id for the next page.")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["results"]
|
|
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 ListInsightsResponse 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 results (list)
|
|
73
|
+
_items = []
|
|
74
|
+
if self.results:
|
|
75
|
+
for _item_results in self.results:
|
|
76
|
+
if _item_results:
|
|
77
|
+
_items.append(_item_results.to_dict())
|
|
78
|
+
_dict['results'] = _items
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of ListInsightsResponse 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
|
+
"results": [InsightListItemResponse.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|
|
@@ -39,6 +39,19 @@ class Metric(str, Enum):
|
|
|
39
39
|
TOKENS_PER_SECOND = 'tokens_per_second'
|
|
40
40
|
TIME_TO_FIRST_TOKEN = 'time_to_first_token'
|
|
41
41
|
PREFIX_CACHE_HIT_RATE = 'prefix_cache_hit_rate'
|
|
42
|
+
DYNAMO_TTFT = 'dynamo_ttft'
|
|
43
|
+
DYNAMO_TPOT = 'dynamo_tpot'
|
|
44
|
+
DYNAMO_REQUEST_LATENCY = 'dynamo_request_latency'
|
|
45
|
+
DYNAMO_OUTPUT_THROUGHPUT = 'dynamo_output_throughput'
|
|
46
|
+
DYNAMO_REQUESTS = 'dynamo_requests'
|
|
47
|
+
DYNAMO_QUEUE_DEPTH = 'dynamo_queue_depth'
|
|
48
|
+
DYNAMO_RUNNING_REQUESTS = 'dynamo_running_requests'
|
|
49
|
+
DYNAMO_KV_CACHE = 'dynamo_kv_cache'
|
|
50
|
+
DYNAMO_KV_THROUGHPUT = 'dynamo_kv_throughput'
|
|
51
|
+
DYNAMO_KV_TRANSFER_LATENCY = 'dynamo_kv_transfer_latency'
|
|
52
|
+
DYNAMO_KV_TRANSFERS = 'dynamo_kv_transfers'
|
|
53
|
+
DYNAMO_KV_FAILURES = 'dynamo_kv_failures'
|
|
54
|
+
DYNAMO_TARGETS = 'dynamo_targets'
|
|
42
55
|
|
|
43
56
|
@classmethod
|
|
44
57
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -0,0 +1,116 @@
|
|
|
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, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class Pool(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
Pool
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
hardware_instance_id: StrictInt
|
|
31
|
+
min_replicas: Optional[StrictInt] = None
|
|
32
|
+
max_replicas: Optional[StrictInt] = None
|
|
33
|
+
concurrency: Optional[StrictInt] = None
|
|
34
|
+
cooldown_period: Optional[Annotated[int, Field(le=3600, strict=True, ge=0)]] = None
|
|
35
|
+
__properties: ClassVar[List[str]] = ["hardware_instance_id", "min_replicas", "max_replicas", "concurrency", "cooldown_period"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of Pool from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# set to None if min_replicas (nullable) is None
|
|
77
|
+
# and model_fields_set contains the field
|
|
78
|
+
if self.min_replicas is None and "min_replicas" in self.model_fields_set:
|
|
79
|
+
_dict['min_replicas'] = None
|
|
80
|
+
|
|
81
|
+
# set to None if max_replicas (nullable) is None
|
|
82
|
+
# and model_fields_set contains the field
|
|
83
|
+
if self.max_replicas is None and "max_replicas" in self.model_fields_set:
|
|
84
|
+
_dict['max_replicas'] = None
|
|
85
|
+
|
|
86
|
+
# set to None if concurrency (nullable) is None
|
|
87
|
+
# and model_fields_set contains the field
|
|
88
|
+
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
89
|
+
_dict['concurrency'] = None
|
|
90
|
+
|
|
91
|
+
# set to None if cooldown_period (nullable) is None
|
|
92
|
+
# and model_fields_set contains the field
|
|
93
|
+
if self.cooldown_period is None and "cooldown_period" in self.model_fields_set:
|
|
94
|
+
_dict['cooldown_period'] = None
|
|
95
|
+
|
|
96
|
+
return _dict
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
100
|
+
"""Create an instance of Pool from a dict"""
|
|
101
|
+
if obj is None:
|
|
102
|
+
return None
|
|
103
|
+
|
|
104
|
+
if not isinstance(obj, dict):
|
|
105
|
+
return cls.model_validate(obj)
|
|
106
|
+
|
|
107
|
+
_obj = cls.model_validate({
|
|
108
|
+
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
109
|
+
"min_replicas": obj.get("min_replicas"),
|
|
110
|
+
"max_replicas": obj.get("max_replicas"),
|
|
111
|
+
"concurrency": obj.get("concurrency"),
|
|
112
|
+
"cooldown_period": obj.get("cooldown_period")
|
|
113
|
+
})
|
|
114
|
+
return _obj
|
|
115
|
+
|
|
116
|
+
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from platform_api_python_client.models.ccl_main_pools import CclMainPools
|
|
25
|
+
from platform_api_python_client.models.deployment_status import DeploymentStatus
|
|
26
|
+
from platform_api_python_client.models.env import Env
|
|
27
|
+
from platform_api_python_client.models.image import Image
|
|
28
|
+
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
29
|
+
from typing import Optional, Set
|
|
30
|
+
from typing_extensions import Self
|
|
31
|
+
|
|
32
|
+
class UnifiedGetComputeDeploymentResponse(BaseModel):
|
|
33
|
+
"""
|
|
34
|
+
UnifiedGetComputeDeploymentResponse
|
|
35
|
+
""" # noqa: E501
|
|
36
|
+
id: StrictInt
|
|
37
|
+
status: DeploymentStatus
|
|
38
|
+
creator_email: StrictStr
|
|
39
|
+
created_at: datetime
|
|
40
|
+
updated_at: datetime
|
|
41
|
+
revision_number: StrictInt
|
|
42
|
+
endpoint_url: Optional[StrictStr]
|
|
43
|
+
type: StrictStr
|
|
44
|
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
|
|
45
|
+
cluster_id: StrictInt
|
|
46
|
+
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
47
|
+
chart_revision: Optional[StrictStr] = None
|
|
48
|
+
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
49
|
+
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
50
|
+
pools: CclMainPools
|
|
51
|
+
env: Optional[Env] = None
|
|
52
|
+
image: Image
|
|
53
|
+
ssh_public_key: Annotated[str, Field(min_length=1, strict=True)]
|
|
54
|
+
enable_logging: Optional[StrictBool] = False
|
|
55
|
+
exposed_port: StrictInt
|
|
56
|
+
__properties: ClassVar[List[str]] = ["id", "status", "creator_email", "created_at", "updated_at", "revision_number", "endpoint_url", "type", "name", "cluster_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "pools", "env", "image", "ssh_public_key", "enable_logging", "exposed_port"]
|
|
57
|
+
|
|
58
|
+
@field_validator('type')
|
|
59
|
+
def type_validate_enum(cls, value):
|
|
60
|
+
"""Validates the enum"""
|
|
61
|
+
if value not in set(['ccl_compute']):
|
|
62
|
+
raise ValueError("must be one of enum values ('ccl_compute')")
|
|
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 UnifiedGetComputeDeploymentResponse 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
|
+
# set to None if endpoint_url (nullable) is None
|
|
128
|
+
# and model_fields_set contains the field
|
|
129
|
+
if self.endpoint_url is None and "endpoint_url" in self.model_fields_set:
|
|
130
|
+
_dict['endpoint_url'] = None
|
|
131
|
+
|
|
132
|
+
# set to None if user_annotations (nullable) is None
|
|
133
|
+
# and model_fields_set contains the field
|
|
134
|
+
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
135
|
+
_dict['user_annotations'] = None
|
|
136
|
+
|
|
137
|
+
# set to None if priority (nullable) is None
|
|
138
|
+
# and model_fields_set contains the field
|
|
139
|
+
if self.priority is None and "priority" in self.model_fields_set:
|
|
140
|
+
_dict['priority'] = None
|
|
141
|
+
|
|
142
|
+
return _dict
|
|
143
|
+
|
|
144
|
+
@classmethod
|
|
145
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
146
|
+
"""Create an instance of UnifiedGetComputeDeploymentResponse from a dict"""
|
|
147
|
+
if obj is None:
|
|
148
|
+
return None
|
|
149
|
+
|
|
150
|
+
if not isinstance(obj, dict):
|
|
151
|
+
return cls.model_validate(obj)
|
|
152
|
+
|
|
153
|
+
_obj = cls.model_validate({
|
|
154
|
+
"id": obj.get("id"),
|
|
155
|
+
"status": obj.get("status"),
|
|
156
|
+
"creator_email": obj.get("creator_email"),
|
|
157
|
+
"created_at": obj.get("created_at"),
|
|
158
|
+
"updated_at": obj.get("updated_at"),
|
|
159
|
+
"revision_number": obj.get("revision_number"),
|
|
160
|
+
"endpoint_url": obj.get("endpoint_url"),
|
|
161
|
+
"type": obj.get("type"),
|
|
162
|
+
"name": obj.get("name"),
|
|
163
|
+
"cluster_id": obj.get("cluster_id"),
|
|
164
|
+
"user_annotations": obj.get("user_annotations"),
|
|
165
|
+
"chart_revision": obj.get("chart_revision"),
|
|
166
|
+
"volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
|
|
167
|
+
"priority": obj.get("priority"),
|
|
168
|
+
"pools": CclMainPools.from_dict(obj["pools"]) if obj.get("pools") is not None else None,
|
|
169
|
+
"env": Env.from_dict(obj["env"]) if obj.get("env") is not None else None,
|
|
170
|
+
"image": Image.from_dict(obj["image"]) if obj.get("image") is not None else None,
|
|
171
|
+
"ssh_public_key": obj.get("ssh_public_key"),
|
|
172
|
+
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else False,
|
|
173
|
+
"exposed_port": obj.get("exposed_port")
|
|
174
|
+
})
|
|
175
|
+
return _obj
|
|
176
|
+
|
|
177
|
+
|
|
@@ -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 UnifiedGetDeploymentLogsResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
UnifiedGetDeploymentLogsResponse
|
|
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 UnifiedGetDeploymentLogsResponse 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 UnifiedGetDeploymentLogsResponse 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
|
+
|
|
@@ -17,20 +17,17 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
21
|
from typing import Any, ClassVar, Dict, List
|
|
23
22
|
from typing import Optional, Set
|
|
24
23
|
from typing_extensions import Self
|
|
25
24
|
|
|
26
|
-
class
|
|
25
|
+
class UnifiedGetDeploymentPodsResponse(BaseModel):
|
|
27
26
|
"""
|
|
28
|
-
|
|
27
|
+
UnifiedGetDeploymentPodsResponse
|
|
29
28
|
""" # noqa: E501
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
endpoint_url: StrictStr
|
|
33
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url"]
|
|
29
|
+
pods: List[StrictStr]
|
|
30
|
+
__properties: ClassVar[List[str]] = ["pods"]
|
|
34
31
|
|
|
35
32
|
model_config = ConfigDict(
|
|
36
33
|
populate_by_name=True,
|
|
@@ -50,7 +47,7 @@ class CreateCServeV3DeploymentResponse(BaseModel):
|
|
|
50
47
|
|
|
51
48
|
@classmethod
|
|
52
49
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
-
"""Create an instance of
|
|
50
|
+
"""Create an instance of UnifiedGetDeploymentPodsResponse from a JSON string"""
|
|
54
51
|
return cls.from_dict(json.loads(json_str))
|
|
55
52
|
|
|
56
53
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -75,7 +72,7 @@ class CreateCServeV3DeploymentResponse(BaseModel):
|
|
|
75
72
|
|
|
76
73
|
@classmethod
|
|
77
74
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
-
"""Create an instance of
|
|
75
|
+
"""Create an instance of UnifiedGetDeploymentPodsResponse from a dict"""
|
|
79
76
|
if obj is None:
|
|
80
77
|
return None
|
|
81
78
|
|
|
@@ -83,9 +80,7 @@ class CreateCServeV3DeploymentResponse(BaseModel):
|
|
|
83
80
|
return cls.model_validate(obj)
|
|
84
81
|
|
|
85
82
|
_obj = cls.model_validate({
|
|
86
|
-
"
|
|
87
|
-
"created_at": obj.get("created_at"),
|
|
88
|
-
"endpoint_url": obj.get("endpoint_url")
|
|
83
|
+
"pods": obj.get("pods")
|
|
89
84
|
})
|
|
90
85
|
return _obj
|
|
91
86
|
|