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.
Files changed (79) hide show
  1. platform_api_python_client/__init__.py +43 -10
  2. platform_api_python_client/api/external_api.py +6332 -1348
  3. platform_api_python_client/api_client.py +1 -1
  4. platform_api_python_client/configuration.py +1 -1
  5. platform_api_python_client/models/__init__.py +42 -9
  6. platform_api_python_client/models/ccl_dynamo_pools.py +116 -0
  7. platform_api_python_client/models/{create_c_serve_v2_deployment_response.py → ccl_main_pools.py} +12 -13
  8. platform_api_python_client/models/cloud_provider.py +5 -0
  9. platform_api_python_client/models/cluster_credential.py +2 -2
  10. platform_api_python_client/models/create_compute_deployment_request.py +40 -7
  11. platform_api_python_client/models/create_dynamo_deployment_request.py +97 -6
  12. platform_api_python_client/models/create_inference_v3_deployment_request.py +59 -2
  13. platform_api_python_client/models/create_job_deployment_request.py +43 -10
  14. platform_api_python_client/models/create_object_volume_request.py +19 -19
  15. platform_api_python_client/models/deployment_response.py +23 -23
  16. platform_api_python_client/models/deployment_type.py +14 -0
  17. platform_api_python_client/models/{c_serve_recipe_perf.py → dynamo_communications_input.py} +12 -19
  18. platform_api_python_client/models/dynamo_communications_output.py +91 -0
  19. platform_api_python_client/models/dynamo_image.py +105 -0
  20. platform_api_python_client/models/dynamo_kv_transfer_configuration.py +88 -0
  21. platform_api_python_client/models/dynamo_kv_transfer_policy.py +37 -0
  22. platform_api_python_client/models/dynamo_weight_transfer_configuration.py +88 -0
  23. platform_api_python_client/models/dynamo_weight_transfer_policy.py +36 -0
  24. platform_api_python_client/models/dynamo_worker_pool_config.py +37 -17
  25. platform_api_python_client/models/dynamo_worker_pools.py +23 -16
  26. platform_api_python_client/models/env.py +89 -0
  27. platform_api_python_client/models/get_cluster_response.py +4 -2
  28. platform_api_python_client/models/get_compute_deployment_response.py +45 -4
  29. platform_api_python_client/models/get_deployment_response.py +26 -2
  30. platform_api_python_client/models/get_deployment_usage_response.py +19 -4
  31. platform_api_python_client/models/get_dynamo_deployment_response.py +89 -5
  32. platform_api_python_client/models/get_inference_deployment_response.py +25 -1
  33. platform_api_python_client/models/get_inference_v3_deployment_response.py +67 -2
  34. platform_api_python_client/models/get_job_deployment_response.py +52 -11
  35. platform_api_python_client/models/get_object_volume_response.py +2 -16
  36. platform_api_python_client/models/hardware_instance_response.py +6 -4
  37. platform_api_python_client/models/image.py +112 -0
  38. platform_api_python_client/models/ingress.py +103 -0
  39. platform_api_python_client/models/insight_list_item_response.py +108 -0
  40. platform_api_python_client/models/insight_resource.py +97 -0
  41. platform_api_python_client/models/insight_resource_type.py +37 -0
  42. platform_api_python_client/models/insight_response.py +133 -0
  43. platform_api_python_client/models/insight_severity.py +40 -0
  44. platform_api_python_client/models/insight_status.py +39 -0
  45. platform_api_python_client/models/{c_serve_recipe_response.py → insight_status_change_response.py} +28 -24
  46. platform_api_python_client/models/list_insights_response.py +95 -0
  47. platform_api_python_client/models/metric.py +13 -0
  48. platform_api_python_client/models/pool.py +116 -0
  49. platform_api_python_client/models/unified_get_compute_deployment_response.py +177 -0
  50. platform_api_python_client/models/unified_get_deployment_logs_response.py +95 -0
  51. platform_api_python_client/models/{create_c_serve_v3_deployment_response.py → unified_get_deployment_pods_response.py} +8 -13
  52. platform_api_python_client/models/unified_get_deployment_response.py +164 -0
  53. platform_api_python_client/models/unified_get_deployment_revision_response.py +109 -0
  54. platform_api_python_client/models/unified_get_deployment_rollout_response.py +90 -0
  55. platform_api_python_client/models/unified_get_deployment_usage_response.py +110 -0
  56. platform_api_python_client/models/unified_get_dynamo_deployment_response.py +218 -0
  57. platform_api_python_client/models/unified_get_inference_v3_deployment_response.py +228 -0
  58. platform_api_python_client/models/unified_get_job_deployment_response.py +204 -0
  59. platform_api_python_client/models/{list_c_serve_recipe_response.py → unified_list_deployment_revisions_response.py} +7 -7
  60. platform_api_python_client/models/unified_update_deployment_rollout_request.py +87 -0
  61. platform_api_python_client/models/unified_write_compute_deployment_request.py +154 -0
  62. platform_api_python_client/models/unified_write_deployment_request.py +164 -0
  63. platform_api_python_client/models/{c_serve_v2_recipe.py → unified_write_deployment_response.py} +27 -27
  64. platform_api_python_client/models/unified_write_dynamo_deployment_request.py +197 -0
  65. platform_api_python_client/models/unified_write_inference_v3_deployment_request.py +207 -0
  66. platform_api_python_client/models/unified_write_job_deployment_request.py +183 -0
  67. platform_api_python_client/models/update_insight_status_request.py +106 -0
  68. platform_api_python_client/models/upsert_user_vault_item_request.py +1 -1
  69. platform_api_python_client/models/usage_availability.py +40 -0
  70. platform_api_python_client/models/usage_component.py +39 -0
  71. platform_api_python_client/models/validation_error.py +12 -3
  72. platform_api_python_client/models/volume_mount.py +1 -1
  73. {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/METADATA +1 -1
  74. {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/RECORD +76 -43
  75. {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/WHEEL +1 -1
  76. platform_api_python_client/models/create_c_serve_v3_deployment_request.py +0 -182
  77. platform_api_python_client/models/get_c_serve_v2_deployment_response.py +0 -169
  78. platform_api_python_client/models/get_c_serve_v3_deployment_response.py +0 -170
  79. {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,218 @@
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_dynamo_pools import CclDynamoPools
25
+ from platform_api_python_client.models.deployment_status import DeploymentStatus
26
+ from platform_api_python_client.models.dynamo_communications_output import DynamoCommunicationsOutput
27
+ from platform_api_python_client.models.dynamo_image import DynamoImage
28
+ from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode
29
+ from platform_api_python_client.models.env import Env
30
+ from platform_api_python_client.models.ingress import Ingress
31
+ from platform_api_python_client.models.volume_mount import VolumeMount
32
+ from typing import Optional, Set
33
+ from typing_extensions import Self
34
+
35
+ class UnifiedGetDynamoDeploymentResponse(BaseModel):
36
+ """
37
+ UnifiedGetDynamoDeploymentResponse
38
+ """ # noqa: E501
39
+ id: StrictInt
40
+ status: DeploymentStatus
41
+ creator_email: StrictStr
42
+ created_at: datetime
43
+ updated_at: datetime
44
+ revision_number: StrictInt
45
+ endpoint_url: Optional[StrictStr]
46
+ type: StrictStr
47
+ name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
48
+ cluster_id: StrictInt
49
+ user_annotations: Optional[Dict[str, StrictStr]] = None
50
+ chart_revision: Optional[StrictStr] = None
51
+ volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
52
+ priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
53
+ pools: CclDynamoPools
54
+ env: Optional[Env] = None
55
+ image: Optional[DynamoImage] = None
56
+ ingress: Ingress
57
+ serving_mode: Optional[DynamoServingMode] = None
58
+ communications: Optional[DynamoCommunicationsOutput] = None
59
+ model: StrictStr
60
+ served_model_name: Optional[StrictStr] = None
61
+ extra_args: Optional[StrictStr] = None
62
+ hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
63
+ enable_logging: Optional[StrictBool] = True
64
+ enable_node_model_cache: Optional[StrictBool] = False
65
+ __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", "ingress", "serving_mode", "communications", "model", "served_model_name", "extra_args", "hf_token_ref", "enable_logging", "enable_node_model_cache"]
66
+
67
+ @field_validator('type')
68
+ def type_validate_enum(cls, value):
69
+ """Validates the enum"""
70
+ if value not in set(['ccl_dynamo']):
71
+ raise ValueError("must be one of enum values ('ccl_dynamo')")
72
+ return value
73
+
74
+ @field_validator('name')
75
+ def name_validate_regular_expression(cls, value):
76
+ """Validates the regular expression"""
77
+ if not re.match(r"^[a-z][a-z0-9-]*$", value):
78
+ raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
79
+ return value
80
+
81
+ model_config = ConfigDict(
82
+ populate_by_name=True,
83
+ validate_assignment=True,
84
+ protected_namespaces=(),
85
+ )
86
+
87
+
88
+ def to_str(self) -> str:
89
+ """Returns the string representation of the model using alias"""
90
+ return pprint.pformat(self.model_dump(by_alias=True))
91
+
92
+ def to_json(self) -> str:
93
+ """Returns the JSON representation of the model using alias"""
94
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
95
+ return json.dumps(self.to_dict())
96
+
97
+ @classmethod
98
+ def from_json(cls, json_str: str) -> Optional[Self]:
99
+ """Create an instance of UnifiedGetDynamoDeploymentResponse from a JSON string"""
100
+ return cls.from_dict(json.loads(json_str))
101
+
102
+ def to_dict(self) -> Dict[str, Any]:
103
+ """Return the dictionary representation of the model using alias.
104
+
105
+ This has the following differences from calling pydantic's
106
+ `self.model_dump(by_alias=True)`:
107
+
108
+ * `None` is only added to the output dict for nullable fields that
109
+ were set at model initialization. Other fields with value `None`
110
+ are ignored.
111
+ """
112
+ excluded_fields: Set[str] = set([
113
+ ])
114
+
115
+ _dict = self.model_dump(
116
+ by_alias=True,
117
+ exclude=excluded_fields,
118
+ exclude_none=True,
119
+ )
120
+ # override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
121
+ _items = []
122
+ if self.volume_mounts:
123
+ for _item_volume_mounts in self.volume_mounts:
124
+ if _item_volume_mounts:
125
+ _items.append(_item_volume_mounts.to_dict())
126
+ _dict['volume_mounts'] = _items
127
+ # override the default output from pydantic by calling `to_dict()` of pools
128
+ if self.pools:
129
+ _dict['pools'] = self.pools.to_dict()
130
+ # override the default output from pydantic by calling `to_dict()` of env
131
+ if self.env:
132
+ _dict['env'] = self.env.to_dict()
133
+ # override the default output from pydantic by calling `to_dict()` of image
134
+ if self.image:
135
+ _dict['image'] = self.image.to_dict()
136
+ # override the default output from pydantic by calling `to_dict()` of ingress
137
+ if self.ingress:
138
+ _dict['ingress'] = self.ingress.to_dict()
139
+ # override the default output from pydantic by calling `to_dict()` of communications
140
+ if self.communications:
141
+ _dict['communications'] = self.communications.to_dict()
142
+ # set to None if endpoint_url (nullable) is None
143
+ # and model_fields_set contains the field
144
+ if self.endpoint_url is None and "endpoint_url" in self.model_fields_set:
145
+ _dict['endpoint_url'] = None
146
+
147
+ # set to None if user_annotations (nullable) is None
148
+ # and model_fields_set contains the field
149
+ if self.user_annotations is None and "user_annotations" in self.model_fields_set:
150
+ _dict['user_annotations'] = None
151
+
152
+ # set to None if priority (nullable) is None
153
+ # and model_fields_set contains the field
154
+ if self.priority is None and "priority" in self.model_fields_set:
155
+ _dict['priority'] = None
156
+
157
+ # set to None if communications (nullable) is None
158
+ # and model_fields_set contains the field
159
+ if self.communications is None and "communications" in self.model_fields_set:
160
+ _dict['communications'] = None
161
+
162
+ # set to None if served_model_name (nullable) is None
163
+ # and model_fields_set contains the field
164
+ if self.served_model_name is None and "served_model_name" in self.model_fields_set:
165
+ _dict['served_model_name'] = None
166
+
167
+ # set to None if extra_args (nullable) is None
168
+ # and model_fields_set contains the field
169
+ if self.extra_args is None and "extra_args" in self.model_fields_set:
170
+ _dict['extra_args'] = None
171
+
172
+ # set to None if hf_token_ref (nullable) is None
173
+ # and model_fields_set contains the field
174
+ if self.hf_token_ref is None and "hf_token_ref" in self.model_fields_set:
175
+ _dict['hf_token_ref'] = None
176
+
177
+ return _dict
178
+
179
+ @classmethod
180
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
181
+ """Create an instance of UnifiedGetDynamoDeploymentResponse from a dict"""
182
+ if obj is None:
183
+ return None
184
+
185
+ if not isinstance(obj, dict):
186
+ return cls.model_validate(obj)
187
+
188
+ _obj = cls.model_validate({
189
+ "id": obj.get("id"),
190
+ "status": obj.get("status"),
191
+ "creator_email": obj.get("creator_email"),
192
+ "created_at": obj.get("created_at"),
193
+ "updated_at": obj.get("updated_at"),
194
+ "revision_number": obj.get("revision_number"),
195
+ "endpoint_url": obj.get("endpoint_url"),
196
+ "type": obj.get("type"),
197
+ "name": obj.get("name"),
198
+ "cluster_id": obj.get("cluster_id"),
199
+ "user_annotations": obj.get("user_annotations"),
200
+ "chart_revision": obj.get("chart_revision"),
201
+ "volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
202
+ "priority": obj.get("priority"),
203
+ "pools": CclDynamoPools.from_dict(obj["pools"]) if obj.get("pools") is not None else None,
204
+ "env": Env.from_dict(obj["env"]) if obj.get("env") is not None else None,
205
+ "image": DynamoImage.from_dict(obj["image"]) if obj.get("image") is not None else None,
206
+ "ingress": Ingress.from_dict(obj["ingress"]) if obj.get("ingress") is not None else None,
207
+ "serving_mode": obj.get("serving_mode"),
208
+ "communications": DynamoCommunicationsOutput.from_dict(obj["communications"]) if obj.get("communications") is not None else None,
209
+ "model": obj.get("model"),
210
+ "served_model_name": obj.get("served_model_name"),
211
+ "extra_args": obj.get("extra_args"),
212
+ "hf_token_ref": obj.get("hf_token_ref"),
213
+ "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
214
+ "enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False
215
+ })
216
+ return _obj
217
+
218
+
@@ -0,0 +1,228 @@
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.config_file_mount import ConfigFileMount
26
+ from platform_api_python_client.models.deployment_status import DeploymentStatus
27
+ from platform_api_python_client.models.env import Env
28
+ from platform_api_python_client.models.image import Image
29
+ from platform_api_python_client.models.ingress import Ingress
30
+ from platform_api_python_client.models.metrics_config import MetricsConfig
31
+ from platform_api_python_client.models.volume_mount import VolumeMount
32
+ from typing import Optional, Set
33
+ from typing_extensions import Self
34
+
35
+ class UnifiedGetInferenceV3DeploymentResponse(BaseModel):
36
+ """
37
+ UnifiedGetInferenceV3DeploymentResponse
38
+ """ # noqa: E501
39
+ id: StrictInt
40
+ status: DeploymentStatus
41
+ creator_email: StrictStr
42
+ created_at: datetime
43
+ updated_at: datetime
44
+ revision_number: StrictInt
45
+ endpoint_url: Optional[StrictStr]
46
+ type: StrictStr
47
+ name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
48
+ cluster_id: StrictInt
49
+ user_annotations: Optional[Dict[str, StrictStr]] = None
50
+ chart_revision: Optional[StrictStr] = None
51
+ volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
52
+ priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
53
+ pools: CclMainPools
54
+ env: Optional[Env] = None
55
+ image: Image
56
+ ingress: Ingress
57
+ port: Annotated[int, Field(le=65535, strict=True, ge=1)]
58
+ healthcheck: Optional[StrictStr] = None
59
+ command: Optional[StrictStr] = None
60
+ config_file: Optional[ConfigFileMount] = None
61
+ hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
62
+ 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.")
63
+ metrics: Optional[MetricsConfig] = None
64
+ enable_logging: Optional[StrictBool] = False
65
+ enable_node_model_cache: Optional[StrictBool] = False
66
+ __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", "ingress", "port", "healthcheck", "command", "config_file", "hf_token_ref", "session_affinity", "metrics", "enable_logging", "enable_node_model_cache"]
67
+
68
+ @field_validator('type')
69
+ def type_validate_enum(cls, value):
70
+ """Validates the enum"""
71
+ if value not in set(['ccl_inference']):
72
+ raise ValueError("must be one of enum values ('ccl_inference')")
73
+ return value
74
+
75
+ @field_validator('name')
76
+ def name_validate_regular_expression(cls, value):
77
+ """Validates the regular expression"""
78
+ if not re.match(r"^[a-z][a-z0-9-]*$", value):
79
+ raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
80
+ return value
81
+
82
+ model_config = ConfigDict(
83
+ populate_by_name=True,
84
+ validate_assignment=True,
85
+ protected_namespaces=(),
86
+ )
87
+
88
+
89
+ def to_str(self) -> str:
90
+ """Returns the string representation of the model using alias"""
91
+ return pprint.pformat(self.model_dump(by_alias=True))
92
+
93
+ def to_json(self) -> str:
94
+ """Returns the JSON representation of the model using alias"""
95
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
96
+ return json.dumps(self.to_dict())
97
+
98
+ @classmethod
99
+ def from_json(cls, json_str: str) -> Optional[Self]:
100
+ """Create an instance of UnifiedGetInferenceV3DeploymentResponse from a JSON string"""
101
+ return cls.from_dict(json.loads(json_str))
102
+
103
+ def to_dict(self) -> Dict[str, Any]:
104
+ """Return the dictionary representation of the model using alias.
105
+
106
+ This has the following differences from calling pydantic's
107
+ `self.model_dump(by_alias=True)`:
108
+
109
+ * `None` is only added to the output dict for nullable fields that
110
+ were set at model initialization. Other fields with value `None`
111
+ are ignored.
112
+ """
113
+ excluded_fields: Set[str] = set([
114
+ ])
115
+
116
+ _dict = self.model_dump(
117
+ by_alias=True,
118
+ exclude=excluded_fields,
119
+ exclude_none=True,
120
+ )
121
+ # override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
122
+ _items = []
123
+ if self.volume_mounts:
124
+ for _item_volume_mounts in self.volume_mounts:
125
+ if _item_volume_mounts:
126
+ _items.append(_item_volume_mounts.to_dict())
127
+ _dict['volume_mounts'] = _items
128
+ # override the default output from pydantic by calling `to_dict()` of pools
129
+ if self.pools:
130
+ _dict['pools'] = self.pools.to_dict()
131
+ # override the default output from pydantic by calling `to_dict()` of env
132
+ if self.env:
133
+ _dict['env'] = self.env.to_dict()
134
+ # override the default output from pydantic by calling `to_dict()` of image
135
+ if self.image:
136
+ _dict['image'] = self.image.to_dict()
137
+ # override the default output from pydantic by calling `to_dict()` of ingress
138
+ if self.ingress:
139
+ _dict['ingress'] = self.ingress.to_dict()
140
+ # override the default output from pydantic by calling `to_dict()` of config_file
141
+ if self.config_file:
142
+ _dict['config_file'] = self.config_file.to_dict()
143
+ # override the default output from pydantic by calling `to_dict()` of metrics
144
+ if self.metrics:
145
+ _dict['metrics'] = self.metrics.to_dict()
146
+ # set to None if endpoint_url (nullable) is None
147
+ # and model_fields_set contains the field
148
+ if self.endpoint_url is None and "endpoint_url" in self.model_fields_set:
149
+ _dict['endpoint_url'] = None
150
+
151
+ # set to None if user_annotations (nullable) is None
152
+ # and model_fields_set contains the field
153
+ if self.user_annotations is None and "user_annotations" in self.model_fields_set:
154
+ _dict['user_annotations'] = None
155
+
156
+ # set to None if priority (nullable) is None
157
+ # and model_fields_set contains the field
158
+ if self.priority is None and "priority" in self.model_fields_set:
159
+ _dict['priority'] = None
160
+
161
+ # set to None if healthcheck (nullable) is None
162
+ # and model_fields_set contains the field
163
+ if self.healthcheck is None and "healthcheck" in self.model_fields_set:
164
+ _dict['healthcheck'] = None
165
+
166
+ # set to None if command (nullable) is None
167
+ # and model_fields_set contains the field
168
+ if self.command is None and "command" in self.model_fields_set:
169
+ _dict['command'] = None
170
+
171
+ # set to None if config_file (nullable) is None
172
+ # and model_fields_set contains the field
173
+ if self.config_file is None and "config_file" in self.model_fields_set:
174
+ _dict['config_file'] = None
175
+
176
+ # set to None if hf_token_ref (nullable) is None
177
+ # and model_fields_set contains the field
178
+ if self.hf_token_ref is None and "hf_token_ref" in self.model_fields_set:
179
+ _dict['hf_token_ref'] = None
180
+
181
+ # set to None if metrics (nullable) is None
182
+ # and model_fields_set contains the field
183
+ if self.metrics is None and "metrics" in self.model_fields_set:
184
+ _dict['metrics'] = None
185
+
186
+ return _dict
187
+
188
+ @classmethod
189
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
190
+ """Create an instance of UnifiedGetInferenceV3DeploymentResponse from a dict"""
191
+ if obj is None:
192
+ return None
193
+
194
+ if not isinstance(obj, dict):
195
+ return cls.model_validate(obj)
196
+
197
+ _obj = cls.model_validate({
198
+ "id": obj.get("id"),
199
+ "status": obj.get("status"),
200
+ "creator_email": obj.get("creator_email"),
201
+ "created_at": obj.get("created_at"),
202
+ "updated_at": obj.get("updated_at"),
203
+ "revision_number": obj.get("revision_number"),
204
+ "endpoint_url": obj.get("endpoint_url"),
205
+ "type": obj.get("type"),
206
+ "name": obj.get("name"),
207
+ "cluster_id": obj.get("cluster_id"),
208
+ "user_annotations": obj.get("user_annotations"),
209
+ "chart_revision": obj.get("chart_revision"),
210
+ "volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
211
+ "priority": obj.get("priority"),
212
+ "pools": CclMainPools.from_dict(obj["pools"]) if obj.get("pools") is not None else None,
213
+ "env": Env.from_dict(obj["env"]) if obj.get("env") is not None else None,
214
+ "image": Image.from_dict(obj["image"]) if obj.get("image") is not None else None,
215
+ "ingress": Ingress.from_dict(obj["ingress"]) if obj.get("ingress") is not None else None,
216
+ "port": obj.get("port"),
217
+ "healthcheck": obj.get("healthcheck"),
218
+ "command": obj.get("command"),
219
+ "config_file": ConfigFileMount.from_dict(obj["config_file"]) if obj.get("config_file") is not None else None,
220
+ "hf_token_ref": obj.get("hf_token_ref"),
221
+ "session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False,
222
+ "metrics": MetricsConfig.from_dict(obj["metrics"]) if obj.get("metrics") is not None else None,
223
+ "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else False,
224
+ "enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False
225
+ })
226
+ return _obj
227
+
228
+
@@ -0,0 +1,204 @@
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.config_file_mount import ConfigFileMount
26
+ from platform_api_python_client.models.deployment_status import DeploymentStatus
27
+ from platform_api_python_client.models.env import Env
28
+ from platform_api_python_client.models.image import Image
29
+ from platform_api_python_client.models.volume_mount import VolumeMount
30
+ from typing import Optional, Set
31
+ from typing_extensions import Self
32
+
33
+ class UnifiedGetJobDeploymentResponse(BaseModel):
34
+ """
35
+ UnifiedGetJobDeploymentResponse
36
+ """ # noqa: E501
37
+ id: StrictInt
38
+ status: DeploymentStatus
39
+ creator_email: StrictStr
40
+ created_at: datetime
41
+ updated_at: datetime
42
+ revision_number: StrictInt
43
+ endpoint_url: Optional[StrictStr]
44
+ type: StrictStr
45
+ name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
46
+ cluster_id: StrictInt
47
+ user_annotations: Optional[Dict[str, StrictStr]] = None
48
+ chart_revision: Optional[StrictStr] = None
49
+ volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
50
+ priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
51
+ pools: CclMainPools
52
+ env: Optional[Env] = None
53
+ image: Image
54
+ command: Optional[StrictStr] = None
55
+ config_file: Optional[ConfigFileMount] = None
56
+ completions: Optional[Annotated[int, Field(strict=True, ge=1)]] = 1
57
+ parallelism: Optional[Annotated[int, Field(strict=True, ge=1)]] = 1
58
+ backoff_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = 3
59
+ active_deadline_seconds: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
60
+ enable_logging: Optional[StrictBool] = True
61
+ __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", "command", "config_file", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "enable_logging"]
62
+
63
+ @field_validator('type')
64
+ def type_validate_enum(cls, value):
65
+ """Validates the enum"""
66
+ if value not in set(['ccl_job']):
67
+ raise ValueError("must be one of enum values ('ccl_job')")
68
+ return value
69
+
70
+ @field_validator('name')
71
+ def name_validate_regular_expression(cls, value):
72
+ """Validates the regular expression"""
73
+ if not re.match(r"^[a-z][a-z0-9-]*$", value):
74
+ raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
75
+ return value
76
+
77
+ model_config = ConfigDict(
78
+ populate_by_name=True,
79
+ validate_assignment=True,
80
+ protected_namespaces=(),
81
+ )
82
+
83
+
84
+ def to_str(self) -> str:
85
+ """Returns the string representation of the model using alias"""
86
+ return pprint.pformat(self.model_dump(by_alias=True))
87
+
88
+ def to_json(self) -> str:
89
+ """Returns the JSON representation of the model using alias"""
90
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
91
+ return json.dumps(self.to_dict())
92
+
93
+ @classmethod
94
+ def from_json(cls, json_str: str) -> Optional[Self]:
95
+ """Create an instance of UnifiedGetJobDeploymentResponse from a JSON string"""
96
+ return cls.from_dict(json.loads(json_str))
97
+
98
+ def to_dict(self) -> Dict[str, Any]:
99
+ """Return the dictionary representation of the model using alias.
100
+
101
+ This has the following differences from calling pydantic's
102
+ `self.model_dump(by_alias=True)`:
103
+
104
+ * `None` is only added to the output dict for nullable fields that
105
+ were set at model initialization. Other fields with value `None`
106
+ are ignored.
107
+ """
108
+ excluded_fields: Set[str] = set([
109
+ ])
110
+
111
+ _dict = self.model_dump(
112
+ by_alias=True,
113
+ exclude=excluded_fields,
114
+ exclude_none=True,
115
+ )
116
+ # override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
117
+ _items = []
118
+ if self.volume_mounts:
119
+ for _item_volume_mounts in self.volume_mounts:
120
+ if _item_volume_mounts:
121
+ _items.append(_item_volume_mounts.to_dict())
122
+ _dict['volume_mounts'] = _items
123
+ # override the default output from pydantic by calling `to_dict()` of pools
124
+ if self.pools:
125
+ _dict['pools'] = self.pools.to_dict()
126
+ # override the default output from pydantic by calling `to_dict()` of env
127
+ if self.env:
128
+ _dict['env'] = self.env.to_dict()
129
+ # override the default output from pydantic by calling `to_dict()` of image
130
+ if self.image:
131
+ _dict['image'] = self.image.to_dict()
132
+ # override the default output from pydantic by calling `to_dict()` of config_file
133
+ if self.config_file:
134
+ _dict['config_file'] = self.config_file.to_dict()
135
+ # set to None if endpoint_url (nullable) is None
136
+ # and model_fields_set contains the field
137
+ if self.endpoint_url is None and "endpoint_url" in self.model_fields_set:
138
+ _dict['endpoint_url'] = None
139
+
140
+ # set to None if user_annotations (nullable) is None
141
+ # and model_fields_set contains the field
142
+ if self.user_annotations is None and "user_annotations" in self.model_fields_set:
143
+ _dict['user_annotations'] = None
144
+
145
+ # set to None if priority (nullable) is None
146
+ # and model_fields_set contains the field
147
+ if self.priority is None and "priority" in self.model_fields_set:
148
+ _dict['priority'] = None
149
+
150
+ # set to None if command (nullable) is None
151
+ # and model_fields_set contains the field
152
+ if self.command is None and "command" in self.model_fields_set:
153
+ _dict['command'] = None
154
+
155
+ # set to None if config_file (nullable) is None
156
+ # and model_fields_set contains the field
157
+ if self.config_file is None and "config_file" in self.model_fields_set:
158
+ _dict['config_file'] = None
159
+
160
+ # set to None if active_deadline_seconds (nullable) is None
161
+ # and model_fields_set contains the field
162
+ if self.active_deadline_seconds is None and "active_deadline_seconds" in self.model_fields_set:
163
+ _dict['active_deadline_seconds'] = None
164
+
165
+ return _dict
166
+
167
+ @classmethod
168
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
169
+ """Create an instance of UnifiedGetJobDeploymentResponse from a dict"""
170
+ if obj is None:
171
+ return None
172
+
173
+ if not isinstance(obj, dict):
174
+ return cls.model_validate(obj)
175
+
176
+ _obj = cls.model_validate({
177
+ "id": obj.get("id"),
178
+ "status": obj.get("status"),
179
+ "creator_email": obj.get("creator_email"),
180
+ "created_at": obj.get("created_at"),
181
+ "updated_at": obj.get("updated_at"),
182
+ "revision_number": obj.get("revision_number"),
183
+ "endpoint_url": obj.get("endpoint_url"),
184
+ "type": obj.get("type"),
185
+ "name": obj.get("name"),
186
+ "cluster_id": obj.get("cluster_id"),
187
+ "user_annotations": obj.get("user_annotations"),
188
+ "chart_revision": obj.get("chart_revision"),
189
+ "volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
190
+ "priority": obj.get("priority"),
191
+ "pools": CclMainPools.from_dict(obj["pools"]) if obj.get("pools") is not None else None,
192
+ "env": Env.from_dict(obj["env"]) if obj.get("env") is not None else None,
193
+ "image": Image.from_dict(obj["image"]) if obj.get("image") is not None else None,
194
+ "command": obj.get("command"),
195
+ "config_file": ConfigFileMount.from_dict(obj["config_file"]) if obj.get("config_file") is not None else None,
196
+ "completions": obj.get("completions") if obj.get("completions") is not None else 1,
197
+ "parallelism": obj.get("parallelism") if obj.get("parallelism") is not None else 1,
198
+ "backoff_limit": obj.get("backoff_limit") if obj.get("backoff_limit") is not None else 3,
199
+ "active_deadline_seconds": obj.get("active_deadline_seconds"),
200
+ "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True
201
+ })
202
+ return _obj
203
+
204
+