platform-api-python-client 4.15.0__py3-none-any.whl → 4.23.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 +50 -3
- platform_api_python_client/api/external_api.py +5460 -1700
- platform_api_python_client/api_client.py +1 -1
- platform_api_python_client/configuration.py +1 -1
- platform_api_python_client/models/__init__.py +49 -2
- platform_api_python_client/models/argo_rollouts.py +89 -0
- platform_api_python_client/models/cert_manager.py +89 -0
- platform_api_python_client/models/cloud_provider.py +39 -0
- platform_api_python_client/models/cluster_components.py +193 -0
- platform_api_python_client/models/cluster_config.py +91 -0
- platform_api_python_client/models/cluster_credential.py +91 -0
- platform_api_python_client/models/cluster_registration_request.py +110 -0
- platform_api_python_client/models/{create_url_response.py → cluster_registration_response.py} +8 -9
- platform_api_python_client/models/create_block_volume_request.py +125 -0
- platform_api_python_client/models/create_c_serve_v3_deployment_request.py +3 -1
- platform_api_python_client/models/create_compute_deployment_request.py +14 -3
- platform_api_python_client/models/create_compute_deployment_response.py +3 -10
- platform_api_python_client/models/create_dynamo_deployment_request.py +186 -0
- platform_api_python_client/models/create_dynamo_deployment_response.py +92 -0
- platform_api_python_client/models/create_inference_v3_deployment_request.py +3 -1
- platform_api_python_client/models/create_job_deployment_request.py +15 -2
- platform_api_python_client/models/create_object_volume_request.py +136 -0
- platform_api_python_client/models/create_service_account_request.py +97 -0
- platform_api_python_client/models/create_service_account_response.py +120 -0
- platform_api_python_client/models/create_volume_request.py +140 -0
- platform_api_python_client/models/deployment_component_type.py +40 -0
- platform_api_python_client/models/deployment_response.py +25 -10
- platform_api_python_client/models/deployment_type.py +1 -0
- platform_api_python_client/models/external_dns.py +89 -0
- platform_api_python_client/models/final_stack.py +89 -0
- platform_api_python_client/models/fluent_bit.py +89 -0
- platform_api_python_client/models/{create_url_request.py → generate_service_account_secret_response.py} +7 -9
- platform_api_python_client/models/get_block_volume_response.py +115 -0
- platform_api_python_client/models/get_compute_deployment_response.py +12 -1
- platform_api_python_client/models/get_dynamo_deployment_response.py +179 -0
- platform_api_python_client/models/get_job_deployment_response.py +13 -2
- platform_api_python_client/models/get_object_volume_response.py +141 -0
- platform_api_python_client/models/get_volume_response.py +140 -0
- platform_api_python_client/models/gpu_operator.py +89 -0
- platform_api_python_client/models/ingress_nginx.py +89 -0
- platform_api_python_client/models/istio.py +98 -0
- platform_api_python_client/models/istio_cni_overrides.py +99 -0
- platform_api_python_client/models/istio_cni_subchart_overrides.py +96 -0
- platform_api_python_client/models/istio_overrides.py +96 -0
- platform_api_python_client/models/keda.py +89 -0
- platform_api_python_client/models/kube_prometheus_stack.py +89 -0
- platform_api_python_client/models/list_service_accounts_response.py +95 -0
- platform_api_python_client/models/list_volumes_response.py +95 -0
- platform_api_python_client/models/longhorn.py +89 -0
- platform_api_python_client/models/metrics_server.py +89 -0
- platform_api_python_client/models/network_operator.py +89 -0
- platform_api_python_client/models/object_storage_provider.py +36 -0
- platform_api_python_client/models/opentelemetry_collector.py +89 -0
- platform_api_python_client/models/pod_details.py +9 -1
- platform_api_python_client/models/prometheus_adapter.py +89 -0
- platform_api_python_client/models/service_account_response.py +118 -0
- platform_api_python_client/models/spire.py +89 -0
- platform_api_python_client/models/spire_crds.py +89 -0
- platform_api_python_client/models/teleport_kube_agent.py +89 -0
- platform_api_python_client/models/update_service_account_request.py +107 -0
- platform_api_python_client/models/volume_access_mode.py +37 -0
- platform_api_python_client/models/volume_backend.py +37 -0
- platform_api_python_client/models/volume_status.py +37 -0
- platform_api_python_client/models/volume_status_response.py +108 -0
- {platform_api_python_client-4.15.0.dist-info → platform_api_python_client-4.23.1.dist-info}/METADATA +1 -1
- {platform_api_python_client-4.15.0.dist-info → platform_api_python_client-4.23.1.dist-info}/RECORD +68 -21
- {platform_api_python_client-4.15.0.dist-info → platform_api_python_client-4.23.1.dist-info}/WHEEL +1 -1
- {platform_api_python_client-4.15.0.dist-info → platform_api_python_client-4.23.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from platform_api_python_client.models.backend_protocol import BackendProtocol
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class CreateDynamoDeploymentRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Create a NVIDIA Dynamo (DynamoGraphDeployment) inference deployment. Aggregated + KV-router pattern with a vLLM backend. The Frontend pod enables KV-aware routing across worker replicas.
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
max_surge: Optional[StrictInt] = None
|
|
32
|
+
max_unavailable: Optional[StrictInt] = None
|
|
33
|
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
|
|
34
|
+
cluster_id: StrictInt
|
|
35
|
+
hardware_instance_id: StrictInt
|
|
36
|
+
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
37
|
+
chart_revision: Optional[StrictStr] = None
|
|
38
|
+
model: StrictStr
|
|
39
|
+
served_model_name: Optional[StrictStr] = None
|
|
40
|
+
min_replicas: Optional[StrictInt] = 1
|
|
41
|
+
max_replicas: Optional[StrictInt] = 1
|
|
42
|
+
concurrency: Optional[StrictInt] = None
|
|
43
|
+
cooldown_period: Optional[StrictInt] = None
|
|
44
|
+
extra_args: Optional[StrictStr] = None
|
|
45
|
+
hf_token: Optional[StrictStr] = None
|
|
46
|
+
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
47
|
+
endpoint_bearer_token: Optional[StrictStr] = None
|
|
48
|
+
endpoint_certificate_authority: Optional[StrictStr] = None
|
|
49
|
+
enable_logging: Optional[StrictBool] = True
|
|
50
|
+
enable_node_model_cache: Optional[StrictBool] = False
|
|
51
|
+
backend_protocol: Optional[BackendProtocol] = None
|
|
52
|
+
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "model", "served_model_name", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "extra_args", "hf_token", "env_vars", "endpoint_bearer_token", "endpoint_certificate_authority", "enable_logging", "enable_node_model_cache", "backend_protocol"]
|
|
53
|
+
|
|
54
|
+
@field_validator('name')
|
|
55
|
+
def name_validate_regular_expression(cls, value):
|
|
56
|
+
"""Validates the regular expression"""
|
|
57
|
+
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
58
|
+
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
59
|
+
return value
|
|
60
|
+
|
|
61
|
+
model_config = ConfigDict(
|
|
62
|
+
populate_by_name=True,
|
|
63
|
+
validate_assignment=True,
|
|
64
|
+
protected_namespaces=(),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def to_str(self) -> str:
|
|
69
|
+
"""Returns the string representation of the model using alias"""
|
|
70
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
71
|
+
|
|
72
|
+
def to_json(self) -> str:
|
|
73
|
+
"""Returns the JSON representation of the model using alias"""
|
|
74
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
75
|
+
return json.dumps(self.to_dict())
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of CreateDynamoDeploymentRequest from a JSON string"""
|
|
80
|
+
return cls.from_dict(json.loads(json_str))
|
|
81
|
+
|
|
82
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
83
|
+
"""Return the dictionary representation of the model using alias.
|
|
84
|
+
|
|
85
|
+
This has the following differences from calling pydantic's
|
|
86
|
+
`self.model_dump(by_alias=True)`:
|
|
87
|
+
|
|
88
|
+
* `None` is only added to the output dict for nullable fields that
|
|
89
|
+
were set at model initialization. Other fields with value `None`
|
|
90
|
+
are ignored.
|
|
91
|
+
"""
|
|
92
|
+
excluded_fields: Set[str] = set([
|
|
93
|
+
])
|
|
94
|
+
|
|
95
|
+
_dict = self.model_dump(
|
|
96
|
+
by_alias=True,
|
|
97
|
+
exclude=excluded_fields,
|
|
98
|
+
exclude_none=True,
|
|
99
|
+
)
|
|
100
|
+
# set to None if max_surge (nullable) is None
|
|
101
|
+
# and model_fields_set contains the field
|
|
102
|
+
if self.max_surge is None and "max_surge" in self.model_fields_set:
|
|
103
|
+
_dict['max_surge'] = None
|
|
104
|
+
|
|
105
|
+
# set to None if max_unavailable (nullable) is None
|
|
106
|
+
# and model_fields_set contains the field
|
|
107
|
+
if self.max_unavailable is None and "max_unavailable" in self.model_fields_set:
|
|
108
|
+
_dict['max_unavailable'] = None
|
|
109
|
+
|
|
110
|
+
# set to None if user_annotations (nullable) is None
|
|
111
|
+
# and model_fields_set contains the field
|
|
112
|
+
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
113
|
+
_dict['user_annotations'] = None
|
|
114
|
+
|
|
115
|
+
# set to None if served_model_name (nullable) is None
|
|
116
|
+
# and model_fields_set contains the field
|
|
117
|
+
if self.served_model_name is None and "served_model_name" in self.model_fields_set:
|
|
118
|
+
_dict['served_model_name'] = None
|
|
119
|
+
|
|
120
|
+
# set to None if concurrency (nullable) is None
|
|
121
|
+
# and model_fields_set contains the field
|
|
122
|
+
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
123
|
+
_dict['concurrency'] = None
|
|
124
|
+
|
|
125
|
+
# set to None if cooldown_period (nullable) is None
|
|
126
|
+
# and model_fields_set contains the field
|
|
127
|
+
if self.cooldown_period is None and "cooldown_period" in self.model_fields_set:
|
|
128
|
+
_dict['cooldown_period'] = None
|
|
129
|
+
|
|
130
|
+
# set to None if extra_args (nullable) is None
|
|
131
|
+
# and model_fields_set contains the field
|
|
132
|
+
if self.extra_args is None and "extra_args" in self.model_fields_set:
|
|
133
|
+
_dict['extra_args'] = None
|
|
134
|
+
|
|
135
|
+
# set to None if hf_token (nullable) is None
|
|
136
|
+
# and model_fields_set contains the field
|
|
137
|
+
if self.hf_token is None and "hf_token" in self.model_fields_set:
|
|
138
|
+
_dict['hf_token'] = None
|
|
139
|
+
|
|
140
|
+
# set to None if endpoint_bearer_token (nullable) is None
|
|
141
|
+
# and model_fields_set contains the field
|
|
142
|
+
if self.endpoint_bearer_token is None and "endpoint_bearer_token" in self.model_fields_set:
|
|
143
|
+
_dict['endpoint_bearer_token'] = None
|
|
144
|
+
|
|
145
|
+
# set to None if endpoint_certificate_authority (nullable) is None
|
|
146
|
+
# and model_fields_set contains the field
|
|
147
|
+
if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
|
|
148
|
+
_dict['endpoint_certificate_authority'] = None
|
|
149
|
+
|
|
150
|
+
return _dict
|
|
151
|
+
|
|
152
|
+
@classmethod
|
|
153
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
154
|
+
"""Create an instance of CreateDynamoDeploymentRequest from a dict"""
|
|
155
|
+
if obj is None:
|
|
156
|
+
return None
|
|
157
|
+
|
|
158
|
+
if not isinstance(obj, dict):
|
|
159
|
+
return cls.model_validate(obj)
|
|
160
|
+
|
|
161
|
+
_obj = cls.model_validate({
|
|
162
|
+
"max_surge": obj.get("max_surge"),
|
|
163
|
+
"max_unavailable": obj.get("max_unavailable"),
|
|
164
|
+
"name": obj.get("name"),
|
|
165
|
+
"cluster_id": obj.get("cluster_id"),
|
|
166
|
+
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
167
|
+
"user_annotations": obj.get("user_annotations"),
|
|
168
|
+
"chart_revision": obj.get("chart_revision"),
|
|
169
|
+
"model": obj.get("model"),
|
|
170
|
+
"served_model_name": obj.get("served_model_name"),
|
|
171
|
+
"min_replicas": obj.get("min_replicas") if obj.get("min_replicas") is not None else 1,
|
|
172
|
+
"max_replicas": obj.get("max_replicas") if obj.get("max_replicas") is not None else 1,
|
|
173
|
+
"concurrency": obj.get("concurrency"),
|
|
174
|
+
"cooldown_period": obj.get("cooldown_period"),
|
|
175
|
+
"extra_args": obj.get("extra_args"),
|
|
176
|
+
"hf_token": obj.get("hf_token"),
|
|
177
|
+
"env_vars": obj.get("env_vars"),
|
|
178
|
+
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
|
|
179
|
+
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
180
|
+
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
|
|
181
|
+
"enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False,
|
|
182
|
+
"backend_protocol": obj.get("backend_protocol")
|
|
183
|
+
})
|
|
184
|
+
return _obj
|
|
185
|
+
|
|
186
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class CreateDynamoDeploymentResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CreateDynamoDeploymentResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
id: StrictInt
|
|
31
|
+
created_at: datetime
|
|
32
|
+
endpoint_url: StrictStr
|
|
33
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of CreateDynamoDeploymentResponse from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of CreateDynamoDeploymentResponse from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"id": obj.get("id"),
|
|
87
|
+
"created_at": obj.get("created_at"),
|
|
88
|
+
"endpoint_url": obj.get("endpoint_url")
|
|
89
|
+
})
|
|
90
|
+
return _obj
|
|
91
|
+
|
|
92
|
+
|
|
@@ -37,6 +37,7 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
37
37
|
cluster_id: StrictInt
|
|
38
38
|
hardware_instance_id: StrictInt
|
|
39
39
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
40
|
+
chart_revision: Optional[StrictStr] = None
|
|
40
41
|
image_url: StrictStr
|
|
41
42
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
42
43
|
port: Annotated[int, Field(le=65535, strict=True, ge=1)]
|
|
@@ -57,7 +58,7 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
57
58
|
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
59
|
config_file: Optional[ConfigFileMount] = None
|
|
59
60
|
metrics: Optional[MetricsConfig] = None
|
|
60
|
-
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "image_url", "image_pull_secret_credentials", "port", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "cooldown_period", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "endpoint_certificate_authority", "hf_token", "backend_protocol", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"]
|
|
61
|
+
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "image_url", "image_pull_secret_credentials", "port", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "cooldown_period", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "endpoint_certificate_authority", "hf_token", "backend_protocol", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"]
|
|
61
62
|
|
|
62
63
|
@field_validator('name')
|
|
63
64
|
def name_validate_regular_expression(cls, value):
|
|
@@ -207,6 +208,7 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
207
208
|
"cluster_id": obj.get("cluster_id"),
|
|
208
209
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
209
210
|
"user_annotations": obj.get("user_annotations"),
|
|
211
|
+
"chart_revision": obj.get("chart_revision"),
|
|
210
212
|
"image_url": obj.get("image_url"),
|
|
211
213
|
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
212
214
|
"port": obj.get("port"),
|
|
@@ -20,6 +20,7 @@ import json
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
|
+
from platform_api_python_client.models.config_file_mount import ConfigFileMount
|
|
23
24
|
from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials
|
|
24
25
|
from typing import Optional, Set
|
|
25
26
|
from typing_extensions import Self
|
|
@@ -32,6 +33,7 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
32
33
|
cluster_id: StrictInt
|
|
33
34
|
hardware_instance_id: StrictInt
|
|
34
35
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
36
|
+
chart_revision: Optional[StrictStr] = None
|
|
35
37
|
image_url: StrictStr
|
|
36
38
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
37
39
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
@@ -41,7 +43,8 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
41
43
|
backoff_limit: Optional[StrictInt] = 3
|
|
42
44
|
active_deadline_seconds: Optional[StrictInt] = None
|
|
43
45
|
enable_logging: Optional[StrictBool] = True
|
|
44
|
-
|
|
46
|
+
config_file: Optional[ConfigFileMount] = None
|
|
47
|
+
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "image_url", "image_pull_secret_credentials", "env_vars", "command", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "enable_logging", "config_file"]
|
|
45
48
|
|
|
46
49
|
@field_validator('name')
|
|
47
50
|
def name_validate_regular_expression(cls, value):
|
|
@@ -92,6 +95,9 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
92
95
|
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
93
96
|
if self.image_pull_secret_credentials:
|
|
94
97
|
_dict['image_pull_secret_credentials'] = self.image_pull_secret_credentials.to_dict()
|
|
98
|
+
# override the default output from pydantic by calling `to_dict()` of config_file
|
|
99
|
+
if self.config_file:
|
|
100
|
+
_dict['config_file'] = self.config_file.to_dict()
|
|
95
101
|
# set to None if user_annotations (nullable) is None
|
|
96
102
|
# and model_fields_set contains the field
|
|
97
103
|
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
@@ -117,6 +123,11 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
117
123
|
if self.active_deadline_seconds is None and "active_deadline_seconds" in self.model_fields_set:
|
|
118
124
|
_dict['active_deadline_seconds'] = None
|
|
119
125
|
|
|
126
|
+
# set to None if config_file (nullable) is None
|
|
127
|
+
# and model_fields_set contains the field
|
|
128
|
+
if self.config_file is None and "config_file" in self.model_fields_set:
|
|
129
|
+
_dict['config_file'] = None
|
|
130
|
+
|
|
120
131
|
return _dict
|
|
121
132
|
|
|
122
133
|
@classmethod
|
|
@@ -133,6 +144,7 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
133
144
|
"cluster_id": obj.get("cluster_id"),
|
|
134
145
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
135
146
|
"user_annotations": obj.get("user_annotations"),
|
|
147
|
+
"chart_revision": obj.get("chart_revision"),
|
|
136
148
|
"image_url": obj.get("image_url"),
|
|
137
149
|
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
138
150
|
"env_vars": obj.get("env_vars"),
|
|
@@ -141,7 +153,8 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
141
153
|
"parallelism": obj.get("parallelism") if obj.get("parallelism") is not None else 1,
|
|
142
154
|
"backoff_limit": obj.get("backoff_limit") if obj.get("backoff_limit") is not None else 3,
|
|
143
155
|
"active_deadline_seconds": obj.get("active_deadline_seconds"),
|
|
144
|
-
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True
|
|
156
|
+
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
|
|
157
|
+
"config_file": ConfigFileMount.from_dict(obj["config_file"]) if obj.get("config_file") is not None else None
|
|
145
158
|
})
|
|
146
159
|
return _obj
|
|
147
160
|
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from platform_api_python_client.models.object_storage_provider import ObjectStorageProvider
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class CreateObjectVolumeRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CreateObjectVolumeRequest
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
|
|
32
|
+
cluster_id: StrictInt
|
|
33
|
+
backend: StrictStr
|
|
34
|
+
provider: Optional[ObjectStorageProvider] = None
|
|
35
|
+
bucket: Annotated[str, Field(min_length=3, strict=True, max_length=253)]
|
|
36
|
+
region: Annotated[str, Field(min_length=1, strict=True)]
|
|
37
|
+
prefix: Optional[StrictStr] = None
|
|
38
|
+
read_only: Optional[StrictBool] = False
|
|
39
|
+
volume_attributes: Optional[Dict[str, StrictStr]] = None
|
|
40
|
+
mount_options: Optional[List[StrictStr]] = None
|
|
41
|
+
__properties: ClassVar[List[str]] = ["name", "cluster_id", "backend", "provider", "bucket", "region", "prefix", "read_only", "volume_attributes", "mount_options"]
|
|
42
|
+
|
|
43
|
+
@field_validator('name')
|
|
44
|
+
def name_validate_regular_expression(cls, value):
|
|
45
|
+
"""Validates the regular expression"""
|
|
46
|
+
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
47
|
+
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
48
|
+
return value
|
|
49
|
+
|
|
50
|
+
@field_validator('backend')
|
|
51
|
+
def backend_validate_enum(cls, value):
|
|
52
|
+
"""Validates the enum"""
|
|
53
|
+
if value not in set(['object']):
|
|
54
|
+
raise ValueError("must be one of enum values ('object')")
|
|
55
|
+
return value
|
|
56
|
+
|
|
57
|
+
model_config = ConfigDict(
|
|
58
|
+
populate_by_name=True,
|
|
59
|
+
validate_assignment=True,
|
|
60
|
+
protected_namespaces=(),
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def to_str(self) -> str:
|
|
65
|
+
"""Returns the string representation of the model using alias"""
|
|
66
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
67
|
+
|
|
68
|
+
def to_json(self) -> str:
|
|
69
|
+
"""Returns the JSON representation of the model using alias"""
|
|
70
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
71
|
+
return json.dumps(self.to_dict())
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of CreateObjectVolumeRequest from a JSON string"""
|
|
76
|
+
return cls.from_dict(json.loads(json_str))
|
|
77
|
+
|
|
78
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
79
|
+
"""Return the dictionary representation of the model using alias.
|
|
80
|
+
|
|
81
|
+
This has the following differences from calling pydantic's
|
|
82
|
+
`self.model_dump(by_alias=True)`:
|
|
83
|
+
|
|
84
|
+
* `None` is only added to the output dict for nullable fields that
|
|
85
|
+
were set at model initialization. Other fields with value `None`
|
|
86
|
+
are ignored.
|
|
87
|
+
"""
|
|
88
|
+
excluded_fields: Set[str] = set([
|
|
89
|
+
])
|
|
90
|
+
|
|
91
|
+
_dict = self.model_dump(
|
|
92
|
+
by_alias=True,
|
|
93
|
+
exclude=excluded_fields,
|
|
94
|
+
exclude_none=True,
|
|
95
|
+
)
|
|
96
|
+
# set to None if prefix (nullable) is None
|
|
97
|
+
# and model_fields_set contains the field
|
|
98
|
+
if self.prefix is None and "prefix" in self.model_fields_set:
|
|
99
|
+
_dict['prefix'] = None
|
|
100
|
+
|
|
101
|
+
# set to None if volume_attributes (nullable) is None
|
|
102
|
+
# and model_fields_set contains the field
|
|
103
|
+
if self.volume_attributes is None and "volume_attributes" in self.model_fields_set:
|
|
104
|
+
_dict['volume_attributes'] = None
|
|
105
|
+
|
|
106
|
+
# set to None if mount_options (nullable) is None
|
|
107
|
+
# and model_fields_set contains the field
|
|
108
|
+
if self.mount_options is None and "mount_options" in self.model_fields_set:
|
|
109
|
+
_dict['mount_options'] = None
|
|
110
|
+
|
|
111
|
+
return _dict
|
|
112
|
+
|
|
113
|
+
@classmethod
|
|
114
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
115
|
+
"""Create an instance of CreateObjectVolumeRequest from a dict"""
|
|
116
|
+
if obj is None:
|
|
117
|
+
return None
|
|
118
|
+
|
|
119
|
+
if not isinstance(obj, dict):
|
|
120
|
+
return cls.model_validate(obj)
|
|
121
|
+
|
|
122
|
+
_obj = cls.model_validate({
|
|
123
|
+
"name": obj.get("name"),
|
|
124
|
+
"cluster_id": obj.get("cluster_id"),
|
|
125
|
+
"backend": obj.get("backend"),
|
|
126
|
+
"provider": obj.get("provider"),
|
|
127
|
+
"bucket": obj.get("bucket"),
|
|
128
|
+
"region": obj.get("region"),
|
|
129
|
+
"prefix": obj.get("prefix"),
|
|
130
|
+
"read_only": obj.get("read_only") if obj.get("read_only") is not None else False,
|
|
131
|
+
"volume_attributes": obj.get("volume_attributes"),
|
|
132
|
+
"mount_options": obj.get("mount_options")
|
|
133
|
+
})
|
|
134
|
+
return _obj
|
|
135
|
+
|
|
136
|
+
|
|
@@ -0,0 +1,97 @@
|
|
|
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, StrictStr
|
|
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 CreateServiceAccountRequest(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CreateServiceAccountRequest
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=255)]
|
|
31
|
+
description: Optional[StrictStr] = None
|
|
32
|
+
scopes: Optional[List[StrictStr]] = None
|
|
33
|
+
__properties: ClassVar[List[str]] = ["name", "description", "scopes"]
|
|
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 CreateServiceAccountRequest from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# set to None if description (nullable) is None
|
|
75
|
+
# and model_fields_set contains the field
|
|
76
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
77
|
+
_dict['description'] = None
|
|
78
|
+
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of CreateServiceAccountRequest 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
|
+
"name": obj.get("name"),
|
|
92
|
+
"description": obj.get("description"),
|
|
93
|
+
"scopes": obj.get("scopes")
|
|
94
|
+
})
|
|
95
|
+
return _obj
|
|
96
|
+
|
|
97
|
+
|