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
|
@@ -18,19 +18,22 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
26
|
class DynamoWorkerPoolConfig(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
Hardware and scaling for one Dynamo worker role. ``min_replicas``/``max_replicas`` are the canonical size. ``replicas`` is the deprecated fixed-size alias (``min == max``) still accepted on disaggregated pools. ``parse_dynamo_topology`` owns the cross-field rules (bounds ordering, autoscaling target, which roles may autoscale).
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
hardware_instance_id: StrictInt
|
|
31
|
-
replicas: Annotated[int, Field(strict=True, ge=1)]
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
replicas: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
32
|
+
min_replicas: Optional[Annotated[int, Field(strict=True, ge=0)]] = None
|
|
33
|
+
max_replicas: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
34
|
+
concurrency: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
35
|
+
cooldown_period: Optional[Annotated[int, Field(le=3600, strict=True, ge=0)]] = None
|
|
36
|
+
__properties: ClassVar[List[str]] = ["hardware_instance_id", "replicas", "min_replicas", "max_replicas", "concurrency", "cooldown_period"]
|
|
34
37
|
|
|
35
38
|
model_config = ConfigDict(
|
|
36
39
|
populate_by_name=True,
|
|
@@ -62,10 +65,8 @@ class DynamoWorkerPoolConfig(BaseModel):
|
|
|
62
65
|
* `None` is only added to the output dict for nullable fields that
|
|
63
66
|
were set at model initialization. Other fields with value `None`
|
|
64
67
|
are ignored.
|
|
65
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
66
68
|
"""
|
|
67
69
|
excluded_fields: Set[str] = set([
|
|
68
|
-
"additional_properties",
|
|
69
70
|
])
|
|
70
71
|
|
|
71
72
|
_dict = self.model_dump(
|
|
@@ -73,10 +74,30 @@ class DynamoWorkerPoolConfig(BaseModel):
|
|
|
73
74
|
exclude=excluded_fields,
|
|
74
75
|
exclude_none=True,
|
|
75
76
|
)
|
|
76
|
-
#
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
# set to None if replicas (nullable) is None
|
|
78
|
+
# and model_fields_set contains the field
|
|
79
|
+
if self.replicas is None and "replicas" in self.model_fields_set:
|
|
80
|
+
_dict['replicas'] = None
|
|
81
|
+
|
|
82
|
+
# set to None if min_replicas (nullable) is None
|
|
83
|
+
# and model_fields_set contains the field
|
|
84
|
+
if self.min_replicas is None and "min_replicas" in self.model_fields_set:
|
|
85
|
+
_dict['min_replicas'] = None
|
|
86
|
+
|
|
87
|
+
# set to None if max_replicas (nullable) is None
|
|
88
|
+
# and model_fields_set contains the field
|
|
89
|
+
if self.max_replicas is None and "max_replicas" in self.model_fields_set:
|
|
90
|
+
_dict['max_replicas'] = None
|
|
91
|
+
|
|
92
|
+
# set to None if concurrency (nullable) is None
|
|
93
|
+
# and model_fields_set contains the field
|
|
94
|
+
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
95
|
+
_dict['concurrency'] = None
|
|
96
|
+
|
|
97
|
+
# set to None if cooldown_period (nullable) is None
|
|
98
|
+
# and model_fields_set contains the field
|
|
99
|
+
if self.cooldown_period is None and "cooldown_period" in self.model_fields_set:
|
|
100
|
+
_dict['cooldown_period'] = None
|
|
80
101
|
|
|
81
102
|
return _dict
|
|
82
103
|
|
|
@@ -91,13 +112,12 @@ class DynamoWorkerPoolConfig(BaseModel):
|
|
|
91
112
|
|
|
92
113
|
_obj = cls.model_validate({
|
|
93
114
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
94
|
-
"replicas": obj.get("replicas")
|
|
115
|
+
"replicas": obj.get("replicas"),
|
|
116
|
+
"min_replicas": obj.get("min_replicas"),
|
|
117
|
+
"max_replicas": obj.get("max_replicas"),
|
|
118
|
+
"concurrency": obj.get("concurrency"),
|
|
119
|
+
"cooldown_period": obj.get("cooldown_period")
|
|
95
120
|
})
|
|
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
121
|
return _obj
|
|
102
122
|
|
|
103
123
|
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from platform_api_python_client.models.dynamo_worker_pool_config import DynamoWorkerPoolConfig
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
@@ -27,10 +27,10 @@ class DynamoWorkerPools(BaseModel):
|
|
|
27
27
|
"""
|
|
28
28
|
DynamoWorkerPools
|
|
29
29
|
""" # noqa: E501
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["prefill", "decode"]
|
|
30
|
+
worker: Optional[DynamoWorkerPoolConfig] = None
|
|
31
|
+
prefill: Optional[DynamoWorkerPoolConfig] = None
|
|
32
|
+
decode: Optional[DynamoWorkerPoolConfig] = None
|
|
33
|
+
__properties: ClassVar[List[str]] = ["worker", "prefill", "decode"]
|
|
34
34
|
|
|
35
35
|
model_config = ConfigDict(
|
|
36
36
|
populate_by_name=True,
|
|
@@ -62,10 +62,8 @@ class DynamoWorkerPools(BaseModel):
|
|
|
62
62
|
* `None` is only added to the output dict for nullable fields that
|
|
63
63
|
were set at model initialization. Other fields with value `None`
|
|
64
64
|
are ignored.
|
|
65
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
66
65
|
"""
|
|
67
66
|
excluded_fields: Set[str] = set([
|
|
68
|
-
"additional_properties",
|
|
69
67
|
])
|
|
70
68
|
|
|
71
69
|
_dict = self.model_dump(
|
|
@@ -73,16 +71,29 @@ class DynamoWorkerPools(BaseModel):
|
|
|
73
71
|
exclude=excluded_fields,
|
|
74
72
|
exclude_none=True,
|
|
75
73
|
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of worker
|
|
75
|
+
if self.worker:
|
|
76
|
+
_dict['worker'] = self.worker.to_dict()
|
|
76
77
|
# override the default output from pydantic by calling `to_dict()` of prefill
|
|
77
78
|
if self.prefill:
|
|
78
79
|
_dict['prefill'] = self.prefill.to_dict()
|
|
79
80
|
# override the default output from pydantic by calling `to_dict()` of decode
|
|
80
81
|
if self.decode:
|
|
81
82
|
_dict['decode'] = self.decode.to_dict()
|
|
82
|
-
#
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
# set to None if worker (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.worker is None and "worker" in self.model_fields_set:
|
|
86
|
+
_dict['worker'] = None
|
|
87
|
+
|
|
88
|
+
# set to None if prefill (nullable) is None
|
|
89
|
+
# and model_fields_set contains the field
|
|
90
|
+
if self.prefill is None and "prefill" in self.model_fields_set:
|
|
91
|
+
_dict['prefill'] = None
|
|
92
|
+
|
|
93
|
+
# set to None if decode (nullable) is None
|
|
94
|
+
# and model_fields_set contains the field
|
|
95
|
+
if self.decode is None and "decode" in self.model_fields_set:
|
|
96
|
+
_dict['decode'] = None
|
|
86
97
|
|
|
87
98
|
return _dict
|
|
88
99
|
|
|
@@ -96,14 +107,10 @@ class DynamoWorkerPools(BaseModel):
|
|
|
96
107
|
return cls.model_validate(obj)
|
|
97
108
|
|
|
98
109
|
_obj = cls.model_validate({
|
|
110
|
+
"worker": DynamoWorkerPoolConfig.from_dict(obj["worker"]) if obj.get("worker") is not None else None,
|
|
99
111
|
"prefill": DynamoWorkerPoolConfig.from_dict(obj["prefill"]) if obj.get("prefill") is not None else None,
|
|
100
112
|
"decode": DynamoWorkerPoolConfig.from_dict(obj["decode"]) if obj.get("decode") is not None else None
|
|
101
113
|
})
|
|
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
114
|
return _obj
|
|
108
115
|
|
|
109
116
|
|
|
@@ -0,0 +1,89 @@
|
|
|
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, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class Env(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
Env
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
vars: Optional[Dict[str, StrictStr]] = None
|
|
30
|
+
refs: Optional[Dict[str, Any]] = None
|
|
31
|
+
__properties: ClassVar[List[str]] = ["vars", "refs"]
|
|
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 Env 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
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of Env from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"vars": obj.get("vars"),
|
|
85
|
+
"refs": obj.get("refs")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|
|
@@ -31,7 +31,8 @@ class GetClusterResponse(BaseModel):
|
|
|
31
31
|
display_name: StrictStr
|
|
32
32
|
region: Optional[StrictStr] = None
|
|
33
33
|
deployment_creation_disabled: Optional[StrictBool] = False
|
|
34
|
-
|
|
34
|
+
managed_by_ccluster: StrictBool
|
|
35
|
+
__properties: ClassVar[List[str]] = ["id", "cluster_name", "display_name", "region", "deployment_creation_disabled", "managed_by_ccluster"]
|
|
35
36
|
|
|
36
37
|
model_config = ConfigDict(
|
|
37
38
|
populate_by_name=True,
|
|
@@ -93,7 +94,8 @@ class GetClusterResponse(BaseModel):
|
|
|
93
94
|
"cluster_name": obj.get("cluster_name"),
|
|
94
95
|
"display_name": obj.get("display_name"),
|
|
95
96
|
"region": obj.get("region"),
|
|
96
|
-
"deployment_creation_disabled": obj.get("deployment_creation_disabled") if obj.get("deployment_creation_disabled") is not None else False
|
|
97
|
+
"deployment_creation_disabled": obj.get("deployment_creation_disabled") if obj.get("deployment_creation_disabled") is not None else False,
|
|
98
|
+
"managed_by_ccluster": obj.get("managed_by_ccluster")
|
|
97
99
|
})
|
|
98
100
|
return _obj
|
|
99
101
|
|
|
@@ -18,8 +18,9 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
23
24
|
from platform_api_python_client.models.deployment_status import DeploymentStatus
|
|
24
25
|
from platform_api_python_client.models.deployment_type import DeploymentType
|
|
25
26
|
from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials
|
|
@@ -42,15 +43,30 @@ class GetComputeDeploymentResponse(BaseModel):
|
|
|
42
43
|
created_at: datetime
|
|
43
44
|
hardware_instance_id: StrictInt
|
|
44
45
|
revision_number: StrictInt
|
|
46
|
+
chart_revision: Optional[StrictStr] = None
|
|
45
47
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
46
|
-
|
|
48
|
+
priority: Optional[StrictStr] = None
|
|
47
49
|
volume_mounts: Optional[List[VolumeMount]] = None
|
|
50
|
+
exposed_port: StrictInt
|
|
48
51
|
ssh_public_key: Optional[StrictStr] = None
|
|
49
52
|
ssh_password: Optional[StrictStr] = None
|
|
50
53
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
51
54
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
55
|
+
env_vars_refs: Optional[Dict[str, Any]] = None
|
|
56
|
+
image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
57
|
+
image_pull_secret_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = Field(default=None, description="Name of a pre-existing image pull Secret in the deployment namespace. Created, refreshed and deleted externally. Mutually exclusive with inline registry credentials and image_pull_ref. Include on updates to retain it; null clears it.")
|
|
52
58
|
enable_logging: Optional[StrictBool] = True
|
|
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", "
|
|
59
|
+
__properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "chart_revision", "user_annotations", "priority", "volume_mounts", "exposed_port", "ssh_public_key", "ssh_password", "env_vars", "image_pull_secret_credentials", "env_vars_refs", "image_pull_ref", "image_pull_secret_name", "enable_logging"]
|
|
60
|
+
|
|
61
|
+
@field_validator('image_pull_secret_name')
|
|
62
|
+
def image_pull_secret_name_validate_regular_expression(cls, value):
|
|
63
|
+
"""Validates the regular expression"""
|
|
64
|
+
if value is None:
|
|
65
|
+
return value
|
|
66
|
+
|
|
67
|
+
if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
|
|
68
|
+
raise ValueError(r"must validate the regular expression /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/")
|
|
69
|
+
return value
|
|
54
70
|
|
|
55
71
|
model_config = ConfigDict(
|
|
56
72
|
populate_by_name=True,
|
|
@@ -106,11 +122,21 @@ class GetComputeDeploymentResponse(BaseModel):
|
|
|
106
122
|
if self.image_url is None and "image_url" in self.model_fields_set:
|
|
107
123
|
_dict['image_url'] = None
|
|
108
124
|
|
|
125
|
+
# set to None if chart_revision (nullable) is None
|
|
126
|
+
# and model_fields_set contains the field
|
|
127
|
+
if self.chart_revision is None and "chart_revision" in self.model_fields_set:
|
|
128
|
+
_dict['chart_revision'] = None
|
|
129
|
+
|
|
109
130
|
# set to None if user_annotations (nullable) is None
|
|
110
131
|
# and model_fields_set contains the field
|
|
111
132
|
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
112
133
|
_dict['user_annotations'] = None
|
|
113
134
|
|
|
135
|
+
# set to None if priority (nullable) is None
|
|
136
|
+
# and model_fields_set contains the field
|
|
137
|
+
if self.priority is None and "priority" in self.model_fields_set:
|
|
138
|
+
_dict['priority'] = None
|
|
139
|
+
|
|
114
140
|
# set to None if ssh_public_key (nullable) is None
|
|
115
141
|
# and model_fields_set contains the field
|
|
116
142
|
if self.ssh_public_key is None and "ssh_public_key" in self.model_fields_set:
|
|
@@ -131,6 +157,16 @@ class GetComputeDeploymentResponse(BaseModel):
|
|
|
131
157
|
if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
|
|
132
158
|
_dict['image_pull_secret_credentials'] = None
|
|
133
159
|
|
|
160
|
+
# set to None if image_pull_ref (nullable) is None
|
|
161
|
+
# and model_fields_set contains the field
|
|
162
|
+
if self.image_pull_ref is None and "image_pull_ref" in self.model_fields_set:
|
|
163
|
+
_dict['image_pull_ref'] = None
|
|
164
|
+
|
|
165
|
+
# set to None if image_pull_secret_name (nullable) is None
|
|
166
|
+
# and model_fields_set contains the field
|
|
167
|
+
if self.image_pull_secret_name is None and "image_pull_secret_name" in self.model_fields_set:
|
|
168
|
+
_dict['image_pull_secret_name'] = None
|
|
169
|
+
|
|
134
170
|
return _dict
|
|
135
171
|
|
|
136
172
|
@classmethod
|
|
@@ -154,13 +190,18 @@ class GetComputeDeploymentResponse(BaseModel):
|
|
|
154
190
|
"created_at": obj.get("created_at"),
|
|
155
191
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
156
192
|
"revision_number": obj.get("revision_number"),
|
|
193
|
+
"chart_revision": obj.get("chart_revision"),
|
|
157
194
|
"user_annotations": obj.get("user_annotations"),
|
|
158
|
-
"
|
|
195
|
+
"priority": obj.get("priority"),
|
|
159
196
|
"volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
|
|
197
|
+
"exposed_port": obj.get("exposed_port"),
|
|
160
198
|
"ssh_public_key": obj.get("ssh_public_key"),
|
|
161
199
|
"ssh_password": obj.get("ssh_password"),
|
|
162
200
|
"env_vars": obj.get("env_vars"),
|
|
163
201
|
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
202
|
+
"env_vars_refs": obj.get("env_vars_refs"),
|
|
203
|
+
"image_pull_ref": obj.get("image_pull_ref"),
|
|
204
|
+
"image_pull_secret_name": obj.get("image_pull_secret_name"),
|
|
164
205
|
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True
|
|
165
206
|
})
|
|
166
207
|
return _obj
|
|
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
|
22
22
|
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
|
+
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
25
26
|
from typing import Optional, Set
|
|
26
27
|
from typing_extensions import Self
|
|
27
28
|
|
|
@@ -40,8 +41,11 @@ class GetDeploymentResponse(BaseModel):
|
|
|
40
41
|
created_at: datetime
|
|
41
42
|
hardware_instance_id: StrictInt
|
|
42
43
|
revision_number: StrictInt
|
|
44
|
+
chart_revision: Optional[StrictStr] = None
|
|
43
45
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
44
|
-
|
|
46
|
+
priority: Optional[StrictStr] = None
|
|
47
|
+
volume_mounts: Optional[List[VolumeMount]] = None
|
|
48
|
+
__properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "chart_revision", "user_annotations", "priority", "volume_mounts"]
|
|
45
49
|
|
|
46
50
|
model_config = ConfigDict(
|
|
47
51
|
populate_by_name=True,
|
|
@@ -82,16 +86,33 @@ class GetDeploymentResponse(BaseModel):
|
|
|
82
86
|
exclude=excluded_fields,
|
|
83
87
|
exclude_none=True,
|
|
84
88
|
)
|
|
89
|
+
# override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
|
|
90
|
+
_items = []
|
|
91
|
+
if self.volume_mounts:
|
|
92
|
+
for _item_volume_mounts in self.volume_mounts:
|
|
93
|
+
if _item_volume_mounts:
|
|
94
|
+
_items.append(_item_volume_mounts.to_dict())
|
|
95
|
+
_dict['volume_mounts'] = _items
|
|
85
96
|
# set to None if image_url (nullable) is None
|
|
86
97
|
# and model_fields_set contains the field
|
|
87
98
|
if self.image_url is None and "image_url" in self.model_fields_set:
|
|
88
99
|
_dict['image_url'] = None
|
|
89
100
|
|
|
101
|
+
# set to None if chart_revision (nullable) is None
|
|
102
|
+
# and model_fields_set contains the field
|
|
103
|
+
if self.chart_revision is None and "chart_revision" in self.model_fields_set:
|
|
104
|
+
_dict['chart_revision'] = None
|
|
105
|
+
|
|
90
106
|
# set to None if user_annotations (nullable) is None
|
|
91
107
|
# and model_fields_set contains the field
|
|
92
108
|
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
93
109
|
_dict['user_annotations'] = None
|
|
94
110
|
|
|
111
|
+
# set to None if priority (nullable) is None
|
|
112
|
+
# and model_fields_set contains the field
|
|
113
|
+
if self.priority is None and "priority" in self.model_fields_set:
|
|
114
|
+
_dict['priority'] = None
|
|
115
|
+
|
|
95
116
|
return _dict
|
|
96
117
|
|
|
97
118
|
@classmethod
|
|
@@ -115,7 +136,10 @@ class GetDeploymentResponse(BaseModel):
|
|
|
115
136
|
"created_at": obj.get("created_at"),
|
|
116
137
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
117
138
|
"revision_number": obj.get("revision_number"),
|
|
118
|
-
"
|
|
139
|
+
"chart_revision": obj.get("chart_revision"),
|
|
140
|
+
"user_annotations": obj.get("user_annotations"),
|
|
141
|
+
"priority": obj.get("priority"),
|
|
142
|
+
"volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None
|
|
119
143
|
})
|
|
120
144
|
return _obj
|
|
121
145
|
|
|
@@ -17,9 +17,10 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from platform_api_python_client.models.deployment_usage import DeploymentUsage
|
|
23
|
+
from platform_api_python_client.models.usage_availability import UsageAvailability
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
@@ -28,7 +29,9 @@ class GetDeploymentUsageResponse(BaseModel):
|
|
|
28
29
|
GetDeploymentUsageResponse
|
|
29
30
|
""" # noqa: E501
|
|
30
31
|
values: List[DeploymentUsage]
|
|
31
|
-
|
|
32
|
+
availability: Optional[UsageAvailability] = None
|
|
33
|
+
last_sample_at: Optional[StrictInt] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["values", "availability", "last_sample_at"]
|
|
32
35
|
|
|
33
36
|
model_config = ConfigDict(
|
|
34
37
|
populate_by_name=True,
|
|
@@ -76,6 +79,16 @@ class GetDeploymentUsageResponse(BaseModel):
|
|
|
76
79
|
if _item_values:
|
|
77
80
|
_items.append(_item_values.to_dict())
|
|
78
81
|
_dict['values'] = _items
|
|
82
|
+
# set to None if availability (nullable) is None
|
|
83
|
+
# and model_fields_set contains the field
|
|
84
|
+
if self.availability is None and "availability" in self.model_fields_set:
|
|
85
|
+
_dict['availability'] = None
|
|
86
|
+
|
|
87
|
+
# set to None if last_sample_at (nullable) is None
|
|
88
|
+
# and model_fields_set contains the field
|
|
89
|
+
if self.last_sample_at is None and "last_sample_at" in self.model_fields_set:
|
|
90
|
+
_dict['last_sample_at'] = None
|
|
91
|
+
|
|
79
92
|
return _dict
|
|
80
93
|
|
|
81
94
|
@classmethod
|
|
@@ -88,7 +101,9 @@ class GetDeploymentUsageResponse(BaseModel):
|
|
|
88
101
|
return cls.model_validate(obj)
|
|
89
102
|
|
|
90
103
|
_obj = cls.model_validate({
|
|
91
|
-
"values": [DeploymentUsage.from_dict(_item) for _item in obj["values"]] if obj.get("values") is not None else None
|
|
104
|
+
"values": [DeploymentUsage.from_dict(_item) for _item in obj["values"]] if obj.get("values") is not None else None,
|
|
105
|
+
"availability": obj.get("availability"),
|
|
106
|
+
"last_sample_at": obj.get("last_sample_at")
|
|
92
107
|
})
|
|
93
108
|
return _obj
|
|
94
109
|
|