platform-api-python-client 4.23.1__py3-none-any.whl → 4.25.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- platform_api_python_client/__init__.py +12 -3
- platform_api_python_client/api/external_api.py +2259 -798
- platform_api_python_client/api_client.py +1 -1
- platform_api_python_client/configuration.py +1 -1
- platform_api_python_client/models/__init__.py +11 -2
- platform_api_python_client/models/create_dynamo_deployment_request.py +22 -3
- platform_api_python_client/models/{create_block_volume_request.py → create_filesystem_volume_request.py} +6 -6
- platform_api_python_client/models/create_volume_request.py +16 -16
- platform_api_python_client/models/delete_user_vault_item_request.py +108 -0
- platform_api_python_client/models/deployment_component_type.py +2 -0
- platform_api_python_client/models/deployment_log_event_v4.py +91 -0
- platform_api_python_client/models/deployment_response.py +21 -6
- platform_api_python_client/models/dynamo_serving_mode.py +37 -0
- platform_api_python_client/models/dynamo_worker_pool_config.py +103 -0
- platform_api_python_client/models/dynamo_worker_pools.py +109 -0
- platform_api_python_client/models/get_cluster_response.py +5 -3
- platform_api_python_client/models/get_deployment_log_v4_response.py +95 -0
- platform_api_python_client/models/get_deployment_pods_response.py +87 -0
- platform_api_python_client/models/get_dynamo_deployment_response.py +15 -1
- platform_api_python_client/models/{get_block_volume_response.py → get_filesystem_volume_response.py} +6 -6
- platform_api_python_client/models/get_volume_response.py +16 -16
- platform_api_python_client/models/update_cluster_metadata_request.py +87 -0
- platform_api_python_client/models/upsert_user_vault_item_request.py +103 -0
- platform_api_python_client/models/user_vault_item.py +6 -3
- platform_api_python_client/models/volume_access_mode.py +0 -1
- platform_api_python_client/models/volume_backend.py +1 -1
- {platform_api_python_client-4.23.1.dist-info → platform_api_python_client-4.25.0.dist-info}/METADATA +1 -1
- {platform_api_python_client-4.23.1.dist-info → platform_api_python_client-4.25.0.dist-info}/RECORD +30 -21
- {platform_api_python_client-4.23.1.dist-info → platform_api_python_client-4.25.0.dist-info}/WHEEL +1 -1
- {platform_api_python_client-4.23.1.dist-info → platform_api_python_client-4.25.0.dist-info}/top_level.txt +0 -0
|
@@ -90,7 +90,7 @@ class ApiClient:
|
|
|
90
90
|
self.default_headers[header_name] = header_value
|
|
91
91
|
self.cookie = cookie
|
|
92
92
|
# Set default User-Agent.
|
|
93
|
-
self.user_agent = 'OpenAPI-Generator/4.
|
|
93
|
+
self.user_agent = 'OpenAPI-Generator/4.25.0/python'
|
|
94
94
|
self.client_side_validation = configuration.client_side_validation
|
|
95
95
|
|
|
96
96
|
def __enter__(self):
|
|
@@ -392,7 +392,7 @@ class Configuration:
|
|
|
392
392
|
"OS: {env}\n"\
|
|
393
393
|
"Python Version: {pyversion}\n"\
|
|
394
394
|
"Version of the API: 0.1.0\n"\
|
|
395
|
-
"SDK Package Version: 4.
|
|
395
|
+
"SDK Package Version: 4.25.0".\
|
|
396
396
|
format(env=sys.platform, pyversion=sys.version)
|
|
397
397
|
|
|
398
398
|
def get_host_settings(self):
|
|
@@ -28,7 +28,6 @@ from platform_api_python_client.models.cluster_credential import ClusterCredenti
|
|
|
28
28
|
from platform_api_python_client.models.cluster_registration_request import ClusterRegistrationRequest
|
|
29
29
|
from platform_api_python_client.models.cluster_registration_response import ClusterRegistrationResponse
|
|
30
30
|
from platform_api_python_client.models.config_file_mount import ConfigFileMount
|
|
31
|
-
from platform_api_python_client.models.create_block_volume_request import CreateBlockVolumeRequest
|
|
32
31
|
from platform_api_python_client.models.create_c_serve_v2_deployment_response import CreateCServeV2DeploymentResponse
|
|
33
32
|
from platform_api_python_client.models.create_c_serve_v3_deployment_request import CreateCServeV3DeploymentRequest
|
|
34
33
|
from platform_api_python_client.models.create_c_serve_v3_deployment_response import CreateCServeV3DeploymentResponse
|
|
@@ -36,6 +35,7 @@ from platform_api_python_client.models.create_compute_deployment_request import
|
|
|
36
35
|
from platform_api_python_client.models.create_compute_deployment_response import CreateComputeDeploymentResponse
|
|
37
36
|
from platform_api_python_client.models.create_dynamo_deployment_request import CreateDynamoDeploymentRequest
|
|
38
37
|
from platform_api_python_client.models.create_dynamo_deployment_response import CreateDynamoDeploymentResponse
|
|
38
|
+
from platform_api_python_client.models.create_filesystem_volume_request import CreateFilesystemVolumeRequest
|
|
39
39
|
from platform_api_python_client.models.create_hardware_instance_request import CreateHardwareInstanceRequest
|
|
40
40
|
from platform_api_python_client.models.create_inference_deployment_response import CreateInferenceDeploymentResponse
|
|
41
41
|
from platform_api_python_client.models.create_inference_v3_deployment_request import CreateInferenceV3DeploymentRequest
|
|
@@ -49,7 +49,9 @@ from platform_api_python_client.models.create_service_account_response import Cr
|
|
|
49
49
|
from platform_api_python_client.models.create_volume_request import CreateVolumeRequest
|
|
50
50
|
from platform_api_python_client.models.credits_response import CreditsResponse
|
|
51
51
|
from platform_api_python_client.models.daily_bill_response import DailyBillResponse
|
|
52
|
+
from platform_api_python_client.models.delete_user_vault_item_request import DeleteUserVaultItemRequest
|
|
52
53
|
from platform_api_python_client.models.deployment_component_type import DeploymentComponentType
|
|
54
|
+
from platform_api_python_client.models.deployment_log_event_v4 import DeploymentLogEventV4
|
|
53
55
|
from platform_api_python_client.models.deployment_response import DeploymentResponse
|
|
54
56
|
from platform_api_python_client.models.deployment_status import DeploymentStatus
|
|
55
57
|
from platform_api_python_client.models.deployment_status_request import DeploymentStatusRequest
|
|
@@ -58,20 +60,25 @@ from platform_api_python_client.models.deployment_status_v3_response import Depl
|
|
|
58
60
|
from platform_api_python_client.models.deployment_type import DeploymentType
|
|
59
61
|
from platform_api_python_client.models.deployment_usage import DeploymentUsage
|
|
60
62
|
from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue
|
|
63
|
+
from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode
|
|
64
|
+
from platform_api_python_client.models.dynamo_worker_pool_config import DynamoWorkerPoolConfig
|
|
65
|
+
from platform_api_python_client.models.dynamo_worker_pools import DynamoWorkerPools
|
|
61
66
|
from platform_api_python_client.models.external_dns import ExternalDns
|
|
62
67
|
from platform_api_python_client.models.final_stack import FinalStack
|
|
63
68
|
from platform_api_python_client.models.fluent_bit import FluentBit
|
|
64
69
|
from platform_api_python_client.models.generate_service_account_secret_response import GenerateServiceAccountSecretResponse
|
|
65
|
-
from platform_api_python_client.models.get_block_volume_response import GetBlockVolumeResponse
|
|
66
70
|
from platform_api_python_client.models.get_c_serve_v2_deployment_response import GetCServeV2DeploymentResponse
|
|
67
71
|
from platform_api_python_client.models.get_c_serve_v3_deployment_response import GetCServeV3DeploymentResponse
|
|
68
72
|
from platform_api_python_client.models.get_cluster_response import GetClusterResponse
|
|
69
73
|
from platform_api_python_client.models.get_compute_deployment_response import GetComputeDeploymentResponse
|
|
70
74
|
from platform_api_python_client.models.get_deployment_log_response import GetDeploymentLogResponse
|
|
75
|
+
from platform_api_python_client.models.get_deployment_log_v4_response import GetDeploymentLogV4Response
|
|
76
|
+
from platform_api_python_client.models.get_deployment_pods_response import GetDeploymentPodsResponse
|
|
71
77
|
from platform_api_python_client.models.get_deployment_response import GetDeploymentResponse
|
|
72
78
|
from platform_api_python_client.models.get_deployment_revision_response import GetDeploymentRevisionResponse
|
|
73
79
|
from platform_api_python_client.models.get_deployment_usage_response import GetDeploymentUsageResponse
|
|
74
80
|
from platform_api_python_client.models.get_dynamo_deployment_response import GetDynamoDeploymentResponse
|
|
81
|
+
from platform_api_python_client.models.get_filesystem_volume_response import GetFilesystemVolumeResponse
|
|
75
82
|
from platform_api_python_client.models.get_inference_deployment_response import GetInferenceDeploymentResponse
|
|
76
83
|
from platform_api_python_client.models.get_inference_v3_deployment_response import GetInferenceV3DeploymentResponse
|
|
77
84
|
from platform_api_python_client.models.get_job_deployment_response import GetJobDeploymentResponse
|
|
@@ -120,9 +127,11 @@ from platform_api_python_client.models.service_status import ServiceStatus
|
|
|
120
127
|
from platform_api_python_client.models.spire import Spire
|
|
121
128
|
from platform_api_python_client.models.spire_crds import SpireCrds
|
|
122
129
|
from platform_api_python_client.models.teleport_kube_agent import TeleportKubeAgent
|
|
130
|
+
from platform_api_python_client.models.update_cluster_metadata_request import UpdateClusterMetadataRequest
|
|
123
131
|
from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse
|
|
124
132
|
from platform_api_python_client.models.update_deployment_status_v3_request import UpdateDeploymentStatusV3Request
|
|
125
133
|
from platform_api_python_client.models.update_service_account_request import UpdateServiceAccountRequest
|
|
134
|
+
from platform_api_python_client.models.upsert_user_vault_item_request import UpsertUserVaultItemRequest
|
|
126
135
|
from platform_api_python_client.models.user_vault_item import UserVaultItem
|
|
127
136
|
from platform_api_python_client.models.user_vault_type import UserVaultType
|
|
128
137
|
from platform_api_python_client.models.validation_error import ValidationError
|
|
@@ -21,20 +21,24 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, Strict
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from platform_api_python_client.models.backend_protocol import BackendProtocol
|
|
24
|
+
from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode
|
|
25
|
+
from platform_api_python_client.models.dynamo_worker_pools import DynamoWorkerPools
|
|
24
26
|
from typing import Optional, Set
|
|
25
27
|
from typing_extensions import Self
|
|
26
28
|
|
|
27
29
|
class CreateDynamoDeploymentRequest(BaseModel):
|
|
28
30
|
"""
|
|
29
|
-
Create a
|
|
31
|
+
Create a Dynamo deployment. Aggregated mode requires ``hardware_instance_id``; disaggregated mode requires fixed-size ``worker_pools``.
|
|
30
32
|
""" # noqa: E501
|
|
31
33
|
max_surge: Optional[StrictInt] = None
|
|
32
34
|
max_unavailable: Optional[StrictInt] = None
|
|
33
35
|
name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
|
|
34
36
|
cluster_id: StrictInt
|
|
35
|
-
hardware_instance_id: StrictInt
|
|
37
|
+
hardware_instance_id: Optional[StrictInt] = None
|
|
36
38
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
37
39
|
chart_revision: Optional[StrictStr] = None
|
|
40
|
+
serving_mode: Optional[DynamoServingMode] = None
|
|
41
|
+
worker_pools: Optional[DynamoWorkerPools] = None
|
|
38
42
|
model: StrictStr
|
|
39
43
|
served_model_name: Optional[StrictStr] = None
|
|
40
44
|
min_replicas: Optional[StrictInt] = 1
|
|
@@ -49,7 +53,7 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
49
53
|
enable_logging: Optional[StrictBool] = True
|
|
50
54
|
enable_node_model_cache: Optional[StrictBool] = False
|
|
51
55
|
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"]
|
|
56
|
+
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "serving_mode", "worker_pools", "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
57
|
|
|
54
58
|
@field_validator('name')
|
|
55
59
|
def name_validate_regular_expression(cls, value):
|
|
@@ -97,6 +101,9 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
97
101
|
exclude=excluded_fields,
|
|
98
102
|
exclude_none=True,
|
|
99
103
|
)
|
|
104
|
+
# override the default output from pydantic by calling `to_dict()` of worker_pools
|
|
105
|
+
if self.worker_pools:
|
|
106
|
+
_dict['worker_pools'] = self.worker_pools.to_dict()
|
|
100
107
|
# set to None if max_surge (nullable) is None
|
|
101
108
|
# and model_fields_set contains the field
|
|
102
109
|
if self.max_surge is None and "max_surge" in self.model_fields_set:
|
|
@@ -107,11 +114,21 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
107
114
|
if self.max_unavailable is None and "max_unavailable" in self.model_fields_set:
|
|
108
115
|
_dict['max_unavailable'] = None
|
|
109
116
|
|
|
117
|
+
# set to None if hardware_instance_id (nullable) is None
|
|
118
|
+
# and model_fields_set contains the field
|
|
119
|
+
if self.hardware_instance_id is None and "hardware_instance_id" in self.model_fields_set:
|
|
120
|
+
_dict['hardware_instance_id'] = None
|
|
121
|
+
|
|
110
122
|
# set to None if user_annotations (nullable) is None
|
|
111
123
|
# and model_fields_set contains the field
|
|
112
124
|
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
113
125
|
_dict['user_annotations'] = None
|
|
114
126
|
|
|
127
|
+
# set to None if worker_pools (nullable) is None
|
|
128
|
+
# and model_fields_set contains the field
|
|
129
|
+
if self.worker_pools is None and "worker_pools" in self.model_fields_set:
|
|
130
|
+
_dict['worker_pools'] = None
|
|
131
|
+
|
|
115
132
|
# set to None if served_model_name (nullable) is None
|
|
116
133
|
# and model_fields_set contains the field
|
|
117
134
|
if self.served_model_name is None and "served_model_name" in self.model_fields_set:
|
|
@@ -166,6 +183,8 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
166
183
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
167
184
|
"user_annotations": obj.get("user_annotations"),
|
|
168
185
|
"chart_revision": obj.get("chart_revision"),
|
|
186
|
+
"serving_mode": obj.get("serving_mode"),
|
|
187
|
+
"worker_pools": DynamoWorkerPools.from_dict(obj["worker_pools"]) if obj.get("worker_pools") is not None else None,
|
|
169
188
|
"model": obj.get("model"),
|
|
170
189
|
"served_model_name": obj.get("served_model_name"),
|
|
171
190
|
"min_replicas": obj.get("min_replicas") if obj.get("min_replicas") is not None else 1,
|
|
@@ -23,9 +23,9 @@ from typing_extensions import Annotated
|
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class CreateFilesystemVolumeRequest(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
CreateFilesystemVolumeRequest
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
|
|
31
31
|
cluster_id: StrictInt
|
|
@@ -44,8 +44,8 @@ class CreateBlockVolumeRequest(BaseModel):
|
|
|
44
44
|
@field_validator('backend')
|
|
45
45
|
def backend_validate_enum(cls, value):
|
|
46
46
|
"""Validates the enum"""
|
|
47
|
-
if value not in set(['
|
|
48
|
-
raise ValueError("must be one of enum values ('
|
|
47
|
+
if value not in set(['filesystem']):
|
|
48
|
+
raise ValueError("must be one of enum values ('filesystem')")
|
|
49
49
|
return value
|
|
50
50
|
|
|
51
51
|
@field_validator('storage_class')
|
|
@@ -76,7 +76,7 @@ class CreateBlockVolumeRequest(BaseModel):
|
|
|
76
76
|
|
|
77
77
|
@classmethod
|
|
78
78
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
79
|
-
"""Create an instance of
|
|
79
|
+
"""Create an instance of CreateFilesystemVolumeRequest from a JSON string"""
|
|
80
80
|
return cls.from_dict(json.loads(json_str))
|
|
81
81
|
|
|
82
82
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -106,7 +106,7 @@ class CreateBlockVolumeRequest(BaseModel):
|
|
|
106
106
|
|
|
107
107
|
@classmethod
|
|
108
108
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
109
|
-
"""Create an instance of
|
|
109
|
+
"""Create an instance of CreateFilesystemVolumeRequest from a dict"""
|
|
110
110
|
if obj is None:
|
|
111
111
|
return None
|
|
112
112
|
|
|
@@ -17,24 +17,24 @@ import json
|
|
|
17
17
|
import pprint
|
|
18
18
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
19
|
from typing import Any, List, Optional
|
|
20
|
-
from platform_api_python_client.models.
|
|
20
|
+
from platform_api_python_client.models.create_filesystem_volume_request import CreateFilesystemVolumeRequest
|
|
21
21
|
from platform_api_python_client.models.create_object_volume_request import CreateObjectVolumeRequest
|
|
22
22
|
from pydantic import StrictStr, Field
|
|
23
23
|
from typing import Union, List, Set, Optional, Dict
|
|
24
24
|
from typing_extensions import Literal, Self
|
|
25
25
|
|
|
26
|
-
CREATEVOLUMEREQUEST_ONE_OF_SCHEMAS = ["
|
|
26
|
+
CREATEVOLUMEREQUEST_ONE_OF_SCHEMAS = ["CreateFilesystemVolumeRequest", "CreateObjectVolumeRequest"]
|
|
27
27
|
|
|
28
28
|
class CreateVolumeRequest(BaseModel):
|
|
29
29
|
"""
|
|
30
30
|
CreateVolumeRequest
|
|
31
31
|
"""
|
|
32
|
-
# data type:
|
|
33
|
-
oneof_schema_1_validator: Optional[
|
|
32
|
+
# data type: CreateFilesystemVolumeRequest
|
|
33
|
+
oneof_schema_1_validator: Optional[CreateFilesystemVolumeRequest] = None
|
|
34
34
|
# data type: CreateObjectVolumeRequest
|
|
35
35
|
oneof_schema_2_validator: Optional[CreateObjectVolumeRequest] = None
|
|
36
|
-
actual_instance: Optional[Union[
|
|
37
|
-
one_of_schemas: Set[str] = { "
|
|
36
|
+
actual_instance: Optional[Union[CreateFilesystemVolumeRequest, CreateObjectVolumeRequest]] = None
|
|
37
|
+
one_of_schemas: Set[str] = { "CreateFilesystemVolumeRequest", "CreateObjectVolumeRequest" }
|
|
38
38
|
|
|
39
39
|
model_config = ConfigDict(
|
|
40
40
|
validate_assignment=True,
|
|
@@ -60,9 +60,9 @@ class CreateVolumeRequest(BaseModel):
|
|
|
60
60
|
instance = CreateVolumeRequest.model_construct()
|
|
61
61
|
error_messages = []
|
|
62
62
|
match = 0
|
|
63
|
-
# validate data type:
|
|
64
|
-
if not isinstance(v,
|
|
65
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `
|
|
63
|
+
# validate data type: CreateFilesystemVolumeRequest
|
|
64
|
+
if not isinstance(v, CreateFilesystemVolumeRequest):
|
|
65
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CreateFilesystemVolumeRequest`")
|
|
66
66
|
else:
|
|
67
67
|
match += 1
|
|
68
68
|
# validate data type: CreateObjectVolumeRequest
|
|
@@ -72,10 +72,10 @@ class CreateVolumeRequest(BaseModel):
|
|
|
72
72
|
match += 1
|
|
73
73
|
if match > 1:
|
|
74
74
|
# more than 1 match
|
|
75
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in CreateVolumeRequest with oneOf schemas:
|
|
75
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in CreateVolumeRequest with oneOf schemas: CreateFilesystemVolumeRequest, CreateObjectVolumeRequest. Details: " + ", ".join(error_messages))
|
|
76
76
|
elif match == 0:
|
|
77
77
|
# no match
|
|
78
|
-
raise ValueError("No match found when setting `actual_instance` in CreateVolumeRequest with oneOf schemas:
|
|
78
|
+
raise ValueError("No match found when setting `actual_instance` in CreateVolumeRequest with oneOf schemas: CreateFilesystemVolumeRequest, CreateObjectVolumeRequest. Details: " + ", ".join(error_messages))
|
|
79
79
|
else:
|
|
80
80
|
return v
|
|
81
81
|
|
|
@@ -90,9 +90,9 @@ class CreateVolumeRequest(BaseModel):
|
|
|
90
90
|
error_messages = []
|
|
91
91
|
match = 0
|
|
92
92
|
|
|
93
|
-
# deserialize data into
|
|
93
|
+
# deserialize data into CreateFilesystemVolumeRequest
|
|
94
94
|
try:
|
|
95
|
-
instance.actual_instance =
|
|
95
|
+
instance.actual_instance = CreateFilesystemVolumeRequest.from_json(json_str)
|
|
96
96
|
match += 1
|
|
97
97
|
except (ValidationError, ValueError) as e:
|
|
98
98
|
error_messages.append(str(e))
|
|
@@ -105,10 +105,10 @@ class CreateVolumeRequest(BaseModel):
|
|
|
105
105
|
|
|
106
106
|
if match > 1:
|
|
107
107
|
# more than 1 match
|
|
108
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into CreateVolumeRequest with oneOf schemas:
|
|
108
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into CreateVolumeRequest with oneOf schemas: CreateFilesystemVolumeRequest, CreateObjectVolumeRequest. Details: " + ", ".join(error_messages))
|
|
109
109
|
elif match == 0:
|
|
110
110
|
# no match
|
|
111
|
-
raise ValueError("No match found when deserializing the JSON string into CreateVolumeRequest with oneOf schemas:
|
|
111
|
+
raise ValueError("No match found when deserializing the JSON string into CreateVolumeRequest with oneOf schemas: CreateFilesystemVolumeRequest, CreateObjectVolumeRequest. Details: " + ", ".join(error_messages))
|
|
112
112
|
else:
|
|
113
113
|
return instance
|
|
114
114
|
|
|
@@ -122,7 +122,7 @@ class CreateVolumeRequest(BaseModel):
|
|
|
122
122
|
else:
|
|
123
123
|
return json.dumps(self.actual_instance)
|
|
124
124
|
|
|
125
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any],
|
|
125
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], CreateFilesystemVolumeRequest, CreateObjectVolumeRequest]]:
|
|
126
126
|
"""Returns the dict representation of the actual instance"""
|
|
127
127
|
if self.actual_instance is None:
|
|
128
128
|
return None
|
|
@@ -0,0 +1,108 @@
|
|
|
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 platform_api_python_client.models.user_vault_type import UserVaultType
|
|
24
|
+
from platform_api_python_client.models.vault_scope import VaultScope
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class DeleteUserVaultItemRequest(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Body for the legacy delete, deliberately permissive. Kept separate from UserVaultItem so that model can require `id`. Here `id` stays optional because resolving by (type, key, visibility) is the only way to delete a row for which the client was never handed an id, and `value` is accepted and ignored because old clients send back a whole vault item.
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
33
|
+
type: UserVaultType
|
|
34
|
+
key: StrictStr
|
|
35
|
+
value: Optional[StrictStr] = None
|
|
36
|
+
visibility: Optional[VaultScope] = None
|
|
37
|
+
__properties: ClassVar[List[str]] = ["id", "type", "key", "value", "visibility"]
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
populate_by_name=True,
|
|
41
|
+
validate_assignment=True,
|
|
42
|
+
protected_namespaces=(),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
53
|
+
return json.dumps(self.to_dict())
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
+
"""Create an instance of DeleteUserVaultItemRequest from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
62
|
+
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
65
|
+
|
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
|
67
|
+
were set at model initialization. Other fields with value `None`
|
|
68
|
+
are ignored.
|
|
69
|
+
"""
|
|
70
|
+
excluded_fields: Set[str] = set([
|
|
71
|
+
])
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
# set to None if id (nullable) is None
|
|
79
|
+
# and model_fields_set contains the field
|
|
80
|
+
if self.id is None and "id" in self.model_fields_set:
|
|
81
|
+
_dict['id'] = None
|
|
82
|
+
|
|
83
|
+
# set to None if value (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.value is None and "value" in self.model_fields_set:
|
|
86
|
+
_dict['value'] = None
|
|
87
|
+
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of DeleteUserVaultItemRequest from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"id": obj.get("id"),
|
|
101
|
+
"type": obj.get("type"),
|
|
102
|
+
"key": obj.get("key"),
|
|
103
|
+
"value": obj.get("value"),
|
|
104
|
+
"visibility": obj.get("visibility")
|
|
105
|
+
})
|
|
106
|
+
return _obj
|
|
107
|
+
|
|
108
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class DeploymentLogEventV4(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
DeploymentLogEventV4
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
id: StrictStr = Field(description="Stable event identity: '<nanosecond timestamp>-<content hash>'. Deduplication key for the re-deliveries of fetch_newer pages; its nanosecond prefix orders events (sorted insert for late arrivals, never append).")
|
|
30
|
+
timestamp: StrictInt = Field(description="Event timestamp in epoch milliseconds.")
|
|
31
|
+
message: StrictStr = Field(description="Raw log line as emitted by the container.")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["id", "timestamp", "message"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of DeploymentLogEventV4 from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of DeploymentLogEventV4 from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"id": obj.get("id"),
|
|
86
|
+
"timestamp": obj.get("timestamp"),
|
|
87
|
+
"message": obj.get("message")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -20,13 +20,14 @@ import re # noqa: F401
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
21
21
|
from typing import Optional
|
|
22
22
|
from platform_api_python_client.models.get_c_serve_v3_deployment_response import GetCServeV3DeploymentResponse
|
|
23
|
+
from platform_api_python_client.models.get_compute_deployment_response import GetComputeDeploymentResponse
|
|
23
24
|
from platform_api_python_client.models.get_dynamo_deployment_response import GetDynamoDeploymentResponse
|
|
24
25
|
from platform_api_python_client.models.get_inference_v3_deployment_response import GetInferenceV3DeploymentResponse
|
|
25
26
|
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
26
27
|
from typing_extensions import Literal, Self
|
|
27
28
|
from pydantic import Field
|
|
28
29
|
|
|
29
|
-
DEPLOYMENTRESPONSE_ANY_OF_SCHEMAS = ["GetCServeV3DeploymentResponse", "GetDynamoDeploymentResponse", "GetInferenceV3DeploymentResponse"]
|
|
30
|
+
DEPLOYMENTRESPONSE_ANY_OF_SCHEMAS = ["GetCServeV3DeploymentResponse", "GetComputeDeploymentResponse", "GetDynamoDeploymentResponse", "GetInferenceV3DeploymentResponse"]
|
|
30
31
|
|
|
31
32
|
class DeploymentResponse(BaseModel):
|
|
32
33
|
"""
|
|
@@ -39,11 +40,13 @@ class DeploymentResponse(BaseModel):
|
|
|
39
40
|
anyof_schema_2_validator: Optional[GetCServeV3DeploymentResponse] = None
|
|
40
41
|
# data type: GetInferenceV3DeploymentResponse
|
|
41
42
|
anyof_schema_3_validator: Optional[GetInferenceV3DeploymentResponse] = None
|
|
43
|
+
# data type: GetComputeDeploymentResponse
|
|
44
|
+
anyof_schema_4_validator: Optional[GetComputeDeploymentResponse] = None
|
|
42
45
|
if TYPE_CHECKING:
|
|
43
|
-
actual_instance: Optional[Union[GetCServeV3DeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse]] = None
|
|
46
|
+
actual_instance: Optional[Union[GetCServeV3DeploymentResponse, GetComputeDeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse]] = None
|
|
44
47
|
else:
|
|
45
48
|
actual_instance: Any = None
|
|
46
|
-
any_of_schemas: Set[str] = { "GetCServeV3DeploymentResponse", "GetDynamoDeploymentResponse", "GetInferenceV3DeploymentResponse" }
|
|
49
|
+
any_of_schemas: Set[str] = { "GetCServeV3DeploymentResponse", "GetComputeDeploymentResponse", "GetDynamoDeploymentResponse", "GetInferenceV3DeploymentResponse" }
|
|
47
50
|
|
|
48
51
|
model_config = {
|
|
49
52
|
"validate_assignment": True,
|
|
@@ -82,9 +85,15 @@ class DeploymentResponse(BaseModel):
|
|
|
82
85
|
else:
|
|
83
86
|
return v
|
|
84
87
|
|
|
88
|
+
# validate data type: GetComputeDeploymentResponse
|
|
89
|
+
if not isinstance(v, GetComputeDeploymentResponse):
|
|
90
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `GetComputeDeploymentResponse`")
|
|
91
|
+
else:
|
|
92
|
+
return v
|
|
93
|
+
|
|
85
94
|
if error_messages:
|
|
86
95
|
# no match
|
|
87
|
-
raise ValueError("No match found when setting the actual_instance in DeploymentResponse with anyOf schemas: GetCServeV3DeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse. Details: " + ", ".join(error_messages))
|
|
96
|
+
raise ValueError("No match found when setting the actual_instance in DeploymentResponse with anyOf schemas: GetCServeV3DeploymentResponse, GetComputeDeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse. Details: " + ", ".join(error_messages))
|
|
88
97
|
else:
|
|
89
98
|
return v
|
|
90
99
|
|
|
@@ -115,10 +124,16 @@ class DeploymentResponse(BaseModel):
|
|
|
115
124
|
return instance
|
|
116
125
|
except (ValidationError, ValueError) as e:
|
|
117
126
|
error_messages.append(str(e))
|
|
127
|
+
# anyof_schema_4_validator: Optional[GetComputeDeploymentResponse] = None
|
|
128
|
+
try:
|
|
129
|
+
instance.actual_instance = GetComputeDeploymentResponse.from_json(json_str)
|
|
130
|
+
return instance
|
|
131
|
+
except (ValidationError, ValueError) as e:
|
|
132
|
+
error_messages.append(str(e))
|
|
118
133
|
|
|
119
134
|
if error_messages:
|
|
120
135
|
# no match
|
|
121
|
-
raise ValueError("No match found when deserializing the JSON string into DeploymentResponse with anyOf schemas: GetCServeV3DeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse. Details: " + ", ".join(error_messages))
|
|
136
|
+
raise ValueError("No match found when deserializing the JSON string into DeploymentResponse with anyOf schemas: GetCServeV3DeploymentResponse, GetComputeDeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse. Details: " + ", ".join(error_messages))
|
|
122
137
|
else:
|
|
123
138
|
return instance
|
|
124
139
|
|
|
@@ -132,7 +147,7 @@ class DeploymentResponse(BaseModel):
|
|
|
132
147
|
else:
|
|
133
148
|
return json.dumps(self.actual_instance)
|
|
134
149
|
|
|
135
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], GetCServeV3DeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse]]:
|
|
150
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], GetCServeV3DeploymentResponse, GetComputeDeploymentResponse, GetDynamoDeploymentResponse, GetInferenceV3DeploymentResponse]]:
|
|
136
151
|
"""Returns the dict representation of the actual instance"""
|
|
137
152
|
if self.actual_instance is None:
|
|
138
153
|
return None
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import json
|
|
17
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class DynamoServingMode(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
DynamoServingMode
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
AGGREGATED = 'aggregated'
|
|
30
|
+
DISAGGREGATED = 'disaggregated'
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def from_json(cls, json_str: str) -> Self:
|
|
34
|
+
"""Create an instance of DynamoServingMode from a JSON string"""
|
|
35
|
+
return cls(json.loads(json_str))
|
|
36
|
+
|
|
37
|
+
|