platform-api-python-client 4.13.0__py3-none-any.whl → 4.20.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 +45 -5
- platform_api_python_client/api/external_api.py +4676 -1655
- platform_api_python_client/api_client.py +1 -1
- platform_api_python_client/configuration.py +1 -1
- platform_api_python_client/models/__init__.py +44 -4
- 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 +108 -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_hardware_instance_request.py +103 -0
- platform_api_python_client/models/create_inference_v3_deployment_request.py +4 -2
- 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/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 +113 -0
- platform_api_python_client/models/get_compute_deployment_response.py +12 -1
- 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_config.py +1 -1
- 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/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_status.py +37 -0
- {platform_api_python_client-4.13.0.dist-info → platform_api_python_client-4.20.0.dist-info}/METADATA +1 -1
- {platform_api_python_client-4.13.0.dist-info → platform_api_python_client-4.20.0.dist-info}/RECORD +61 -21
- {platform_api_python_client-4.13.0.dist-info → platform_api_python_client-4.20.0.dist-info}/WHEEL +1 -1
- platform_api_python_client/models/create_c_serve_v2_deployment_request.py +0 -160
- platform_api_python_client/models/create_inference_deployment_request.py +0 -163
- {platform_api_python_client-4.13.0.dist-info → platform_api_python_client-4.20.0.dist-info}/top_level.txt +0 -0
|
@@ -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, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class ClusterCredential(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ClusterCredential
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
server: StrictStr
|
|
30
|
+
bearer_token: StrictStr
|
|
31
|
+
ca_cert: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["server", "bearer_token", "ca_cert"]
|
|
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 ClusterCredential 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 ClusterCredential 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
|
+
"server": obj.get("server"),
|
|
86
|
+
"bearer_token": obj.get("bearer_token"),
|
|
87
|
+
"ca_cert": obj.get("ca_cert")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from platform_api_python_client.models.cloud_provider import CloudProvider
|
|
23
|
+
from platform_api_python_client.models.cluster_credential import ClusterCredential
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class ClusterRegistrationRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
ClusterRegistrationRequest
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
display_name: StrictStr
|
|
32
|
+
storage_class: StrictStr
|
|
33
|
+
region: Optional[StrictStr] = None
|
|
34
|
+
cloud_provider: Optional[CloudProvider] = None
|
|
35
|
+
credential: ClusterCredential
|
|
36
|
+
__properties: ClassVar[List[str]] = ["display_name", "storage_class", "region", "cloud_provider", "credential"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
populate_by_name=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
48
|
+
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
52
|
+
return json.dumps(self.to_dict())
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of ClusterRegistrationRequest from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of credential
|
|
78
|
+
if self.credential:
|
|
79
|
+
_dict['credential'] = self.credential.to_dict()
|
|
80
|
+
# set to None if region (nullable) is None
|
|
81
|
+
# and model_fields_set contains the field
|
|
82
|
+
if self.region is None and "region" in self.model_fields_set:
|
|
83
|
+
_dict['region'] = None
|
|
84
|
+
|
|
85
|
+
# set to None if cloud_provider (nullable) is None
|
|
86
|
+
# and model_fields_set contains the field
|
|
87
|
+
if self.cloud_provider is None and "cloud_provider" in self.model_fields_set:
|
|
88
|
+
_dict['cloud_provider'] = None
|
|
89
|
+
|
|
90
|
+
return _dict
|
|
91
|
+
|
|
92
|
+
@classmethod
|
|
93
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
94
|
+
"""Create an instance of ClusterRegistrationRequest from a dict"""
|
|
95
|
+
if obj is None:
|
|
96
|
+
return None
|
|
97
|
+
|
|
98
|
+
if not isinstance(obj, dict):
|
|
99
|
+
return cls.model_validate(obj)
|
|
100
|
+
|
|
101
|
+
_obj = cls.model_validate({
|
|
102
|
+
"display_name": obj.get("display_name"),
|
|
103
|
+
"storage_class": obj.get("storage_class"),
|
|
104
|
+
"region": obj.get("region"),
|
|
105
|
+
"cloud_provider": obj.get("cloud_provider"),
|
|
106
|
+
"credential": ClusterCredential.from_dict(obj["credential"]) if obj.get("credential") is not None else None
|
|
107
|
+
})
|
|
108
|
+
return _obj
|
|
109
|
+
|
|
110
|
+
|
platform_api_python_client/models/{create_url_response.py → cluster_registration_response.py}
RENAMED
|
@@ -17,18 +17,17 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict,
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from typing_extensions import Annotated
|
|
23
22
|
from typing import Optional, Set
|
|
24
23
|
from typing_extensions import Self
|
|
25
24
|
|
|
26
|
-
class
|
|
25
|
+
class ClusterRegistrationResponse(BaseModel):
|
|
27
26
|
"""
|
|
28
|
-
|
|
27
|
+
ClusterRegistrationResponse
|
|
29
28
|
""" # noqa: E501
|
|
30
|
-
|
|
31
|
-
__properties: ClassVar[List[str]] = ["
|
|
29
|
+
id: StrictInt
|
|
30
|
+
__properties: ClassVar[List[str]] = ["id"]
|
|
32
31
|
|
|
33
32
|
model_config = ConfigDict(
|
|
34
33
|
populate_by_name=True,
|
|
@@ -48,7 +47,7 @@ class CreateUrlResponse(BaseModel):
|
|
|
48
47
|
|
|
49
48
|
@classmethod
|
|
50
49
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
-
"""Create an instance of
|
|
50
|
+
"""Create an instance of ClusterRegistrationResponse from a JSON string"""
|
|
52
51
|
return cls.from_dict(json.loads(json_str))
|
|
53
52
|
|
|
54
53
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -73,7 +72,7 @@ class CreateUrlResponse(BaseModel):
|
|
|
73
72
|
|
|
74
73
|
@classmethod
|
|
75
74
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
-
"""Create an instance of
|
|
75
|
+
"""Create an instance of ClusterRegistrationResponse from a dict"""
|
|
77
76
|
if obj is None:
|
|
78
77
|
return None
|
|
79
78
|
|
|
@@ -81,7 +80,7 @@ class CreateUrlResponse(BaseModel):
|
|
|
81
80
|
return cls.model_validate(obj)
|
|
82
81
|
|
|
83
82
|
_obj = cls.model_validate({
|
|
84
|
-
"
|
|
83
|
+
"id": obj.get("id")
|
|
85
84
|
})
|
|
86
85
|
return _obj
|
|
87
86
|
|
|
@@ -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, StrictInt, StrictStr, field_validator
|
|
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 CreateBlockVolumeRequest(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CreateBlockVolumeRequest
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
|
|
31
|
+
cluster_id: StrictInt
|
|
32
|
+
backend: StrictStr
|
|
33
|
+
size_gb: Optional[Annotated[int, Field(le=65536, strict=True, ge=1)]] = 100
|
|
34
|
+
__properties: ClassVar[List[str]] = ["name", "cluster_id", "backend", "size_gb"]
|
|
35
|
+
|
|
36
|
+
@field_validator('name')
|
|
37
|
+
def name_validate_regular_expression(cls, value):
|
|
38
|
+
"""Validates the regular expression"""
|
|
39
|
+
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
40
|
+
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
41
|
+
return value
|
|
42
|
+
|
|
43
|
+
@field_validator('backend')
|
|
44
|
+
def backend_validate_enum(cls, value):
|
|
45
|
+
"""Validates the enum"""
|
|
46
|
+
if value not in set(['block']):
|
|
47
|
+
raise ValueError("must be one of enum values ('block')")
|
|
48
|
+
return value
|
|
49
|
+
|
|
50
|
+
model_config = ConfigDict(
|
|
51
|
+
populate_by_name=True,
|
|
52
|
+
validate_assignment=True,
|
|
53
|
+
protected_namespaces=(),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def to_str(self) -> str:
|
|
58
|
+
"""Returns the string representation of the model using alias"""
|
|
59
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
60
|
+
|
|
61
|
+
def to_json(self) -> str:
|
|
62
|
+
"""Returns the JSON representation of the model using alias"""
|
|
63
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
64
|
+
return json.dumps(self.to_dict())
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
68
|
+
"""Create an instance of CreateBlockVolumeRequest from a JSON string"""
|
|
69
|
+
return cls.from_dict(json.loads(json_str))
|
|
70
|
+
|
|
71
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
72
|
+
"""Return the dictionary representation of the model using alias.
|
|
73
|
+
|
|
74
|
+
This has the following differences from calling pydantic's
|
|
75
|
+
`self.model_dump(by_alias=True)`:
|
|
76
|
+
|
|
77
|
+
* `None` is only added to the output dict for nullable fields that
|
|
78
|
+
were set at model initialization. Other fields with value `None`
|
|
79
|
+
are ignored.
|
|
80
|
+
"""
|
|
81
|
+
excluded_fields: Set[str] = set([
|
|
82
|
+
])
|
|
83
|
+
|
|
84
|
+
_dict = self.model_dump(
|
|
85
|
+
by_alias=True,
|
|
86
|
+
exclude=excluded_fields,
|
|
87
|
+
exclude_none=True,
|
|
88
|
+
)
|
|
89
|
+
return _dict
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
93
|
+
"""Create an instance of CreateBlockVolumeRequest from a dict"""
|
|
94
|
+
if obj is None:
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
if not isinstance(obj, dict):
|
|
98
|
+
return cls.model_validate(obj)
|
|
99
|
+
|
|
100
|
+
_obj = cls.model_validate({
|
|
101
|
+
"name": obj.get("name"),
|
|
102
|
+
"cluster_id": obj.get("cluster_id"),
|
|
103
|
+
"backend": obj.get("backend"),
|
|
104
|
+
"size_gb": obj.get("size_gb") if obj.get("size_gb") is not None else 100
|
|
105
|
+
})
|
|
106
|
+
return _obj
|
|
107
|
+
|
|
108
|
+
|
|
@@ -34,6 +34,7 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
34
34
|
cluster_id: StrictInt
|
|
35
35
|
hardware_instance_id: StrictInt
|
|
36
36
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
37
|
+
chart_revision: Optional[StrictStr] = None
|
|
37
38
|
recipe: CServeV2Recipe
|
|
38
39
|
cserve_version: Optional[StrictStr] = None
|
|
39
40
|
hf_token: Optional[StrictStr] = None
|
|
@@ -48,7 +49,7 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
48
49
|
enable_logging: Optional[StrictBool] = True
|
|
49
50
|
enable_node_model_cache: Optional[StrictBool] = False
|
|
50
51
|
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.")
|
|
51
|
-
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "recipe", "cserve_version", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "cooldown_period", "env_vars", "enable_logging", "enable_node_model_cache", "session_affinity"]
|
|
52
|
+
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "recipe", "cserve_version", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "cooldown_period", "env_vars", "enable_logging", "enable_node_model_cache", "session_affinity"]
|
|
52
53
|
|
|
53
54
|
@field_validator('name')
|
|
54
55
|
def name_validate_regular_expression(cls, value):
|
|
@@ -167,6 +168,7 @@ class CreateCServeV3DeploymentRequest(BaseModel):
|
|
|
167
168
|
"cluster_id": obj.get("cluster_id"),
|
|
168
169
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
169
170
|
"user_annotations": obj.get("user_annotations"),
|
|
171
|
+
"chart_revision": obj.get("chart_revision"),
|
|
170
172
|
"recipe": CServeV2Recipe.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
|
|
171
173
|
"cserve_version": obj.get("cserve_version"),
|
|
172
174
|
"hf_token": obj.get("hf_token"),
|
|
@@ -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.image_pull_secret_credentials import ImagePullSecretCredentials
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
@@ -31,11 +32,12 @@ class CreateComputeDeploymentRequest(BaseModel):
|
|
|
31
32
|
cluster_id: StrictInt
|
|
32
33
|
hardware_instance_id: StrictInt
|
|
33
34
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
35
|
+
chart_revision: Optional[StrictStr] = None
|
|
34
36
|
image_url: StrictStr
|
|
35
|
-
|
|
37
|
+
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
36
38
|
ssh_public_key: StrictStr
|
|
37
39
|
enable_logging: Optional[StrictBool] = False
|
|
38
|
-
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "image_url", "
|
|
40
|
+
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "image_url", "image_pull_secret_credentials", "ssh_public_key", "enable_logging"]
|
|
39
41
|
|
|
40
42
|
@field_validator('name')
|
|
41
43
|
def name_validate_regular_expression(cls, value):
|
|
@@ -83,11 +85,19 @@ class CreateComputeDeploymentRequest(BaseModel):
|
|
|
83
85
|
exclude=excluded_fields,
|
|
84
86
|
exclude_none=True,
|
|
85
87
|
)
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
89
|
+
if self.image_pull_secret_credentials:
|
|
90
|
+
_dict['image_pull_secret_credentials'] = self.image_pull_secret_credentials.to_dict()
|
|
86
91
|
# set to None if user_annotations (nullable) is None
|
|
87
92
|
# and model_fields_set contains the field
|
|
88
93
|
if self.user_annotations is None and "user_annotations" in self.model_fields_set:
|
|
89
94
|
_dict['user_annotations'] = None
|
|
90
95
|
|
|
96
|
+
# set to None if image_pull_secret_credentials (nullable) is None
|
|
97
|
+
# and model_fields_set contains the field
|
|
98
|
+
if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
|
|
99
|
+
_dict['image_pull_secret_credentials'] = None
|
|
100
|
+
|
|
91
101
|
return _dict
|
|
92
102
|
|
|
93
103
|
@classmethod
|
|
@@ -104,8 +114,9 @@ class CreateComputeDeploymentRequest(BaseModel):
|
|
|
104
114
|
"cluster_id": obj.get("cluster_id"),
|
|
105
115
|
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
106
116
|
"user_annotations": obj.get("user_annotations"),
|
|
117
|
+
"chart_revision": obj.get("chart_revision"),
|
|
107
118
|
"image_url": obj.get("image_url"),
|
|
108
|
-
"
|
|
119
|
+
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
109
120
|
"ssh_public_key": obj.get("ssh_public_key"),
|
|
110
121
|
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else False
|
|
111
122
|
})
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
@@ -31,8 +31,7 @@ class CreateComputeDeploymentResponse(BaseModel):
|
|
|
31
31
|
created_at: datetime
|
|
32
32
|
endpoint_url: StrictStr
|
|
33
33
|
port: StrictInt
|
|
34
|
-
|
|
35
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url", "port", "jupyter_token"]
|
|
34
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url", "port"]
|
|
36
35
|
|
|
37
36
|
model_config = ConfigDict(
|
|
38
37
|
populate_by_name=True,
|
|
@@ -73,11 +72,6 @@ class CreateComputeDeploymentResponse(BaseModel):
|
|
|
73
72
|
exclude=excluded_fields,
|
|
74
73
|
exclude_none=True,
|
|
75
74
|
)
|
|
76
|
-
# set to None if jupyter_token (nullable) is None
|
|
77
|
-
# and model_fields_set contains the field
|
|
78
|
-
if self.jupyter_token is None and "jupyter_token" in self.model_fields_set:
|
|
79
|
-
_dict['jupyter_token'] = None
|
|
80
|
-
|
|
81
75
|
return _dict
|
|
82
76
|
|
|
83
77
|
@classmethod
|
|
@@ -93,8 +87,7 @@ class CreateComputeDeploymentResponse(BaseModel):
|
|
|
93
87
|
"id": obj.get("id"),
|
|
94
88
|
"created_at": obj.get("created_at"),
|
|
95
89
|
"endpoint_url": obj.get("endpoint_url"),
|
|
96
|
-
"port": obj.get("port")
|
|
97
|
-
"jupyter_token": obj.get("jupyter_token")
|
|
90
|
+
"port": obj.get("port")
|
|
98
91
|
})
|
|
99
92
|
return _obj
|
|
100
93
|
|
|
@@ -0,0 +1,103 @@
|
|
|
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, 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 CreateHardwareInstanceRequest(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
CreateHardwareInstanceRequest
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
cluster_id: StrictInt
|
|
30
|
+
name: StrictStr
|
|
31
|
+
gpu_type: StrictStr
|
|
32
|
+
num_gpu: StrictInt
|
|
33
|
+
cpu: StrictInt
|
|
34
|
+
memory: StrictInt
|
|
35
|
+
accelerator_resource_key: StrictStr
|
|
36
|
+
node_affinity_labels: Dict[str, StrictStr]
|
|
37
|
+
accelerator_memory: StrictInt
|
|
38
|
+
__properties: ClassVar[List[str]] = ["cluster_id", "name", "gpu_type", "num_gpu", "cpu", "memory", "accelerator_resource_key", "node_affinity_labels", "accelerator_memory"]
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
54
|
+
return json.dumps(self.to_dict())
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
58
|
+
"""Create an instance of CreateHardwareInstanceRequest from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
|
63
|
+
|
|
64
|
+
This has the following differences from calling pydantic's
|
|
65
|
+
`self.model_dump(by_alias=True)`:
|
|
66
|
+
|
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
|
68
|
+
were set at model initialization. Other fields with value `None`
|
|
69
|
+
are ignored.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set([
|
|
72
|
+
])
|
|
73
|
+
|
|
74
|
+
_dict = self.model_dump(
|
|
75
|
+
by_alias=True,
|
|
76
|
+
exclude=excluded_fields,
|
|
77
|
+
exclude_none=True,
|
|
78
|
+
)
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of CreateHardwareInstanceRequest 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
|
+
"cluster_id": obj.get("cluster_id"),
|
|
92
|
+
"name": obj.get("name"),
|
|
93
|
+
"gpu_type": obj.get("gpu_type"),
|
|
94
|
+
"num_gpu": obj.get("num_gpu"),
|
|
95
|
+
"cpu": obj.get("cpu"),
|
|
96
|
+
"memory": obj.get("memory"),
|
|
97
|
+
"accelerator_resource_key": obj.get("accelerator_resource_key"),
|
|
98
|
+
"node_affinity_labels": obj.get("node_affinity_labels"),
|
|
99
|
+
"accelerator_memory": obj.get("accelerator_memory")
|
|
100
|
+
})
|
|
101
|
+
return _obj
|
|
102
|
+
|
|
103
|
+
|
|
@@ -37,9 +37,10 @@ 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
|
-
port:
|
|
43
|
+
port: Annotated[int, Field(le=65535, strict=True, ge=1)]
|
|
43
44
|
min_replicas: StrictInt
|
|
44
45
|
max_replicas: StrictInt
|
|
45
46
|
initial_replicas: Optional[StrictInt] = None
|
|
@@ -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"),
|