platform-api-python-client 4.37.1__py3-none-any.whl → 4.41.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 +410 -177
- platform_api_python_client/api/external_api.py +41 -47
- platform_api_python_client/api_client.py +81 -36
- platform_api_python_client/configuration.py +262 -66
- platform_api_python_client/exceptions.py +24 -5
- platform_api_python_client/models/__init__.py +52 -26
- platform_api_python_client/models/admission.py +106 -0
- platform_api_python_client/models/autoscaling.py +120 -0
- platform_api_python_client/models/ccl_dynamo_pools.py +4 -3
- platform_api_python_client/models/ccl_main_pools.py +4 -3
- platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_chart_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_controller.py +106 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_cert_manager_chart_values.py +117 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_cert_manager_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_gpu_operator_chart_values.py +152 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_gpu_operator_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_chart_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_controller.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_istio_values.py +143 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_kai_scheduler_chart_values.py +154 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_kai_scheduler_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_keda_chart_values.py +131 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_keda_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_kube_prometheus_stack_chart_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_kube_prometheus_stack_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_metrics_server_chart_values.py +106 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_metrics_server_values.py +110 -0
- platform_api_python_client/models/{spire_crds.py → cdi.py} +36 -12
- platform_api_python_client/models/cluster_base_components.py +187 -0
- platform_api_python_client/models/cluster_capacity_response.py +5 -5
- platform_api_python_client/models/cluster_credential.py +4 -3
- platform_api_python_client/models/cluster_registration_request.py +4 -3
- platform_api_python_client/models/cluster_registration_response.py +4 -3
- platform_api_python_client/models/{istio_cni_overrides.py → cni.py} +29 -15
- platform_api_python_client/models/config_file_mount.py +6 -5
- platform_api_python_client/models/create_compute_deployment_request.py +10 -10
- platform_api_python_client/models/create_compute_deployment_response.py +4 -3
- platform_api_python_client/models/create_dynamo_deployment_request.py +29 -23
- platform_api_python_client/models/create_dynamo_deployment_response.py +4 -3
- platform_api_python_client/models/create_filesystem_volume_request.py +8 -7
- platform_api_python_client/models/create_hardware_instance_request.py +4 -3
- platform_api_python_client/models/create_inference_deployment_response.py +4 -3
- platform_api_python_client/models/create_inference_v3_deployment_request.py +14 -12
- platform_api_python_client/models/create_job_deployment_request.py +10 -10
- platform_api_python_client/models/create_job_deployment_response.py +4 -3
- platform_api_python_client/models/create_object_volume_request.py +10 -9
- platform_api_python_client/models/create_organization_request.py +4 -3
- platform_api_python_client/models/create_organization_response.py +4 -3
- platform_api_python_client/models/create_service_account_request.py +4 -3
- platform_api_python_client/models/create_service_account_response.py +4 -3
- platform_api_python_client/models/credits_response.py +4 -3
- platform_api_python_client/models/daily_bill_response.py +4 -3
- platform_api_python_client/models/{fluent_bit.py → dashboard.py} +29 -12
- platform_api_python_client/models/{prometheus_adapter.py → default_priorities.py} +29 -12
- platform_api_python_client/models/default_queue.py +106 -0
- platform_api_python_client/models/delete_user_vault_item_request.py +4 -3
- platform_api_python_client/models/deployment_log_event_v4.py +4 -3
- platform_api_python_client/models/deployment_status_request.py +4 -3
- platform_api_python_client/models/deployment_status_response.py +4 -3
- platform_api_python_client/models/deployment_status_v3_response.py +5 -5
- platform_api_python_client/models/deployment_usage.py +5 -5
- platform_api_python_client/models/deployment_usage_value.py +4 -3
- platform_api_python_client/models/dynamo_communications_input.py +4 -3
- platform_api_python_client/models/dynamo_frontend_config.py +105 -0
- platform_api_python_client/models/dynamo_frontend_config_response.py +105 -0
- platform_api_python_client/models/dynamo_image.py +6 -5
- platform_api_python_client/models/dynamo_kv_transfer_configuration.py +4 -3
- platform_api_python_client/models/dynamo_weight_transfer_configuration.py +4 -3
- platform_api_python_client/models/dynamo_worker_pool_config.py +5 -4
- platform_api_python_client/models/dynamo_worker_pools.py +4 -3
- platform_api_python_client/models/env.py +4 -3
- platform_api_python_client/models/generate_service_account_secret_response.py +4 -3
- platform_api_python_client/models/get_cluster_response.py +4 -3
- platform_api_python_client/models/get_compute_deployment_response.py +8 -8
- platform_api_python_client/models/get_deployment_log_response.py +4 -3
- platform_api_python_client/models/get_deployment_log_v4_response.py +5 -5
- platform_api_python_client/models/get_deployment_pods_response.py +4 -3
- platform_api_python_client/models/get_deployment_response.py +7 -7
- platform_api_python_client/models/get_deployment_revision_response.py +4 -3
- platform_api_python_client/models/get_deployment_usage_response.py +5 -5
- platform_api_python_client/models/get_dynamo_deployment_response.py +23 -17
- platform_api_python_client/models/get_filesystem_volume_response.py +4 -3
- platform_api_python_client/models/get_inference_deployment_response.py +7 -7
- platform_api_python_client/models/get_inference_v3_deployment_response.py +11 -9
- platform_api_python_client/models/get_job_deployment_response.py +8 -8
- platform_api_python_client/models/get_object_volume_response.py +4 -3
- platform_api_python_client/models/gpu_type_capacity.py +4 -3
- platform_api_python_client/models/hardware_instance_response.py +4 -3
- platform_api_python_client/models/hardware_preset_response.py +4 -3
- platform_api_python_client/models/http_validation_error.py +5 -5
- platform_api_python_client/models/image.py +6 -5
- platform_api_python_client/models/image_pull_secret_credentials.py +4 -3
- platform_api_python_client/models/ingress.py +4 -3
- platform_api_python_client/models/insight_list_item_response.py +4 -3
- platform_api_python_client/models/insight_resource.py +4 -3
- platform_api_python_client/models/insight_response.py +5 -5
- platform_api_python_client/models/insight_status_change_response.py +4 -3
- platform_api_python_client/models/invite_user_request.py +4 -3
- platform_api_python_client/models/istio_base.py +106 -0
- platform_api_python_client/models/istio_cni.py +124 -0
- platform_api_python_client/models/{argo_rollouts.py → istio_gateway.py} +29 -12
- platform_api_python_client/models/{istio_cni_subchart_overrides.py → istiod.py} +31 -17
- platform_api_python_client/models/list_cluster_capacity_response.py +5 -5
- platform_api_python_client/models/list_daily_bill_response.py +5 -5
- platform_api_python_client/models/list_deployment_revisions_response.py +5 -5
- platform_api_python_client/models/list_get_cluster_response.py +5 -5
- platform_api_python_client/models/list_get_deployment_response.py +5 -5
- platform_api_python_client/models/list_hardware_instance_response.py +5 -5
- platform_api_python_client/models/list_hardware_preset_response.py +5 -5
- platform_api_python_client/models/list_insights_response.py +5 -5
- platform_api_python_client/models/list_organization_gpu_quota_response.py +5 -5
- platform_api_python_client/models/list_prebuilt_image_response.py +5 -5
- platform_api_python_client/models/list_service_accounts_response.py +5 -5
- platform_api_python_client/models/list_user_vault_items_response.py +5 -5
- platform_api_python_client/models/list_volumes_response.py +5 -5
- platform_api_python_client/models/{validation_error_loc_inner.py → location_inner.py} +6 -6
- platform_api_python_client/models/metrics.py +117 -0
- platform_api_python_client/models/metrics_config.py +6 -5
- platform_api_python_client/models/{istio_overrides.py → mig.py} +28 -18
- platform_api_python_client/models/operator.py +117 -0
- platform_api_python_client/models/organization_gpu_quota_request.py +4 -3
- platform_api_python_client/models/organization_gpu_quota_response.py +4 -3
- platform_api_python_client/models/pilot.py +106 -0
- platform_api_python_client/models/pod_details.py +4 -3
- platform_api_python_client/models/pool.py +4 -3
- platform_api_python_client/models/prebuilt_image_response.py +4 -3
- platform_api_python_client/models/prometheus.py +110 -0
- platform_api_python_client/models/prometheus_rules.py +120 -0
- platform_api_python_client/models/prometheus_spec.py +113 -0
- platform_api_python_client/models/prometheus_values.py +117 -0
- platform_api_python_client/models/quota.py +106 -0
- platform_api_python_client/models/replicas.py +106 -0
- platform_api_python_client/models/resource_list.py +113 -0
- platform_api_python_client/models/resource_requirements.py +120 -0
- platform_api_python_client/models/revision_pod_details.py +5 -5
- platform_api_python_client/models/rollout_strategy_params.py +4 -3
- platform_api_python_client/models/scheduler.py +117 -0
- platform_api_python_client/models/service_account_response.py +4 -3
- platform_api_python_client/models/{istio.py → toggle.py} +27 -19
- platform_api_python_client/models/toleration.py +134 -0
- platform_api_python_client/models/unified_get_compute_deployment_response.py +8 -8
- platform_api_python_client/models/unified_get_deployment_logs_response.py +5 -5
- platform_api_python_client/models/unified_get_deployment_pods_response.py +4 -3
- platform_api_python_client/models/unified_get_deployment_revision_response.py +4 -3
- platform_api_python_client/models/unified_get_deployment_rollout_response.py +4 -3
- platform_api_python_client/models/unified_get_deployment_usage_response.py +5 -5
- platform_api_python_client/models/unified_get_dynamo_deployment_response.py +13 -13
- platform_api_python_client/models/unified_get_inference_v3_deployment_response.py +9 -9
- platform_api_python_client/models/unified_get_job_deployment_response.py +8 -8
- platform_api_python_client/models/unified_list_deployment_revisions_response.py +5 -5
- platform_api_python_client/models/unified_update_deployment_rollout_request.py +4 -3
- platform_api_python_client/models/unified_write_compute_deployment_request.py +8 -8
- platform_api_python_client/models/unified_write_deployment_response.py +4 -3
- platform_api_python_client/models/unified_write_dynamo_deployment_request.py +11 -11
- platform_api_python_client/models/unified_write_inference_v3_deployment_request.py +9 -9
- platform_api_python_client/models/unified_write_job_deployment_request.py +8 -8
- platform_api_python_client/models/update_cluster_metadata_request.py +4 -3
- platform_api_python_client/models/{cluster_config.py → update_cluster_request.py} +11 -10
- platform_api_python_client/models/update_deployment_response.py +4 -3
- platform_api_python_client/models/update_deployment_status_v3_request.py +4 -3
- platform_api_python_client/models/update_insight_status_request.py +7 -6
- platform_api_python_client/models/update_service_account_request.py +4 -3
- platform_api_python_client/models/upsert_user_vault_item_request.py +4 -3
- platform_api_python_client/models/user_vault_item.py +4 -3
- platform_api_python_client/models/validation_error.py +8 -8
- platform_api_python_client/models/volume_mount.py +4 -3
- platform_api_python_client/models/volume_status_response.py +4 -3
- platform_api_python_client/models/{dynamo_communications_output.py → workload.py} +34 -15
- platform_api_python_client/rest.py +87 -10
- platform_api_python_client-4.41.0.dist-info/METADATA +418 -0
- platform_api_python_client-4.41.0.dist-info/RECORD +206 -0
- platform_api_python_client/models/cert_manager.py +0 -89
- platform_api_python_client/models/cluster_components.py +0 -193
- platform_api_python_client/models/external_dns.py +0 -89
- platform_api_python_client/models/final_stack.py +0 -89
- platform_api_python_client/models/gpu_operator.py +0 -89
- platform_api_python_client/models/ingress_nginx.py +0 -89
- platform_api_python_client/models/keda.py +0 -89
- platform_api_python_client/models/kube_prometheus_stack.py +0 -89
- platform_api_python_client/models/longhorn.py +0 -89
- platform_api_python_client/models/metrics_server.py +0 -89
- platform_api_python_client/models/network_operator.py +0 -89
- platform_api_python_client/models/opentelemetry_collector.py +0 -89
- platform_api_python_client/models/spire.py +0 -89
- platform_api_python_client/models/teleport_kube_agent.py +0 -89
- platform_api_python_client-4.37.1.dist-info/METADATA +0 -23
- platform_api_python_client-4.37.1.dist-info/RECORD +0 -180
- {platform_api_python_client-4.37.1.dist-info → platform_api_python_client-4.41.0.dist-info}/WHEEL +0 -0
- {platform_api_python_client-4.37.1.dist-info → platform_api_python_client-4.41.0.dist-info}/top_level.txt +0 -0
platform_api_python_client/models/ccluster_catalogs_cluster_base_kube_prometheus_stack_values.py
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from platform_api_python_client.models.ccluster_catalogs_cluster_base_kube_prometheus_stack_chart_values import CclusterCatalogsClusterBaseKubePrometheusStackChartValues
|
|
23
|
+
from platform_api_python_client.models.prometheus_rules import PrometheusRules
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class CclusterCatalogsClusterBaseKubePrometheusStackValues(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Values of the catalogs/cluster_base/kube_prometheus_stack chart, generated from its Go package.
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
kube_prometheus_stack: Optional[CclusterCatalogsClusterBaseKubePrometheusStackChartValues] = Field(default=None, alias="kube-prometheus-stack")
|
|
33
|
+
prometheus_rules: Optional[PrometheusRules] = Field(default=None, alias="prometheusRules")
|
|
34
|
+
additional_properties: Dict[str, Any] = {}
|
|
35
|
+
__properties: ClassVar[List[str]] = ["kube-prometheus-stack", "prometheusRules"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
validate_by_name=True,
|
|
39
|
+
validate_by_alias=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
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of CclusterCatalogsClusterBaseKubePrometheusStackValues from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
"additional_properties",
|
|
71
|
+
])
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of kube_prometheus_stack
|
|
79
|
+
if self.kube_prometheus_stack:
|
|
80
|
+
_dict['kube-prometheus-stack'] = self.kube_prometheus_stack.to_dict()
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of prometheus_rules
|
|
82
|
+
if self.prometheus_rules:
|
|
83
|
+
_dict['prometheusRules'] = self.prometheus_rules.to_dict()
|
|
84
|
+
# puts key-value pairs in additional_properties in the top level
|
|
85
|
+
if self.additional_properties is not None:
|
|
86
|
+
for _key, _value in self.additional_properties.items():
|
|
87
|
+
_dict[_key] = _value
|
|
88
|
+
|
|
89
|
+
# set to None if kube_prometheus_stack (nullable) is None
|
|
90
|
+
# and model_fields_set contains the field
|
|
91
|
+
if self.kube_prometheus_stack is None and "kube_prometheus_stack" in self.model_fields_set:
|
|
92
|
+
_dict['kube-prometheus-stack'] = None
|
|
93
|
+
|
|
94
|
+
# set to None if prometheus_rules (nullable) is None
|
|
95
|
+
# and model_fields_set contains the field
|
|
96
|
+
if self.prometheus_rules is None and "prometheus_rules" in self.model_fields_set:
|
|
97
|
+
_dict['prometheusRules'] = None
|
|
98
|
+
|
|
99
|
+
return _dict
|
|
100
|
+
|
|
101
|
+
@classmethod
|
|
102
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
103
|
+
"""Create an instance of CclusterCatalogsClusterBaseKubePrometheusStackValues from a dict"""
|
|
104
|
+
if obj is None:
|
|
105
|
+
return None
|
|
106
|
+
|
|
107
|
+
if not isinstance(obj, dict):
|
|
108
|
+
return cls.model_validate(obj)
|
|
109
|
+
|
|
110
|
+
_obj = cls.model_validate({
|
|
111
|
+
"kube-prometheus-stack": CclusterCatalogsClusterBaseKubePrometheusStackChartValues.from_dict(obj["kube-prometheus-stack"]) if obj.get("kube-prometheus-stack") is not None else None,
|
|
112
|
+
"prometheusRules": PrometheusRules.from_dict(obj["prometheusRules"]) if obj.get("prometheusRules") is not None else None
|
|
113
|
+
})
|
|
114
|
+
# store additional fields in additional_properties
|
|
115
|
+
for _key in obj.keys():
|
|
116
|
+
if _key not in cls.__properties:
|
|
117
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
118
|
+
|
|
119
|
+
return _obj
|
|
120
|
+
|
|
121
|
+
|
platform_api_python_client/models/ccluster_catalogs_cluster_base_metrics_server_chart_values.py
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
from pydantic_core import to_jsonable_python
|
|
25
|
+
|
|
26
|
+
class CclusterCatalogsClusterBaseMetricsServerChartValues(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ChartValues are the upstream metrics-server values worth setting per cluster.
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
args: Optional[List[StrictStr]] = None
|
|
31
|
+
additional_properties: Dict[str, Any] = {}
|
|
32
|
+
__properties: ClassVar[List[str]] = ["args"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
validate_by_name=True,
|
|
36
|
+
validate_by_alias=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of CclusterCatalogsClusterBaseMetricsServerChartValues 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
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
"additional_properties",
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# puts key-value pairs in additional_properties in the top level
|
|
76
|
+
if self.additional_properties is not None:
|
|
77
|
+
for _key, _value in self.additional_properties.items():
|
|
78
|
+
_dict[_key] = _value
|
|
79
|
+
|
|
80
|
+
# set to None if args (nullable) is None
|
|
81
|
+
# and model_fields_set contains the field
|
|
82
|
+
if self.args is None and "args" in self.model_fields_set:
|
|
83
|
+
_dict['args'] = None
|
|
84
|
+
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of CclusterCatalogsClusterBaseMetricsServerChartValues from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"args": obj.get("args")
|
|
98
|
+
})
|
|
99
|
+
# store additional fields in additional_properties
|
|
100
|
+
for _key in obj.keys():
|
|
101
|
+
if _key not in cls.__properties:
|
|
102
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
103
|
+
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|
|
@@ -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, Field
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from platform_api_python_client.models.ccluster_catalogs_cluster_base_metrics_server_chart_values import CclusterCatalogsClusterBaseMetricsServerChartValues
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class CclusterCatalogsClusterBaseMetricsServerValues(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Values of the catalogs/cluster_base/metrics_server chart, generated from its Go package.
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
metrics_server: Optional[CclusterCatalogsClusterBaseMetricsServerChartValues] = Field(default=None, alias="metrics-server")
|
|
32
|
+
additional_properties: Dict[str, Any] = {}
|
|
33
|
+
__properties: ClassVar[List[str]] = ["metrics-server"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of CclusterCatalogsClusterBaseMetricsServerValues from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
"additional_properties",
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of metrics_server
|
|
77
|
+
if self.metrics_server:
|
|
78
|
+
_dict['metrics-server'] = self.metrics_server.to_dict()
|
|
79
|
+
# puts key-value pairs in additional_properties in the top level
|
|
80
|
+
if self.additional_properties is not None:
|
|
81
|
+
for _key, _value in self.additional_properties.items():
|
|
82
|
+
_dict[_key] = _value
|
|
83
|
+
|
|
84
|
+
# set to None if metrics_server (nullable) is None
|
|
85
|
+
# and model_fields_set contains the field
|
|
86
|
+
if self.metrics_server is None and "metrics_server" in self.model_fields_set:
|
|
87
|
+
_dict['metrics-server'] = None
|
|
88
|
+
|
|
89
|
+
return _dict
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
93
|
+
"""Create an instance of CclusterCatalogsClusterBaseMetricsServerValues 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
|
+
"metrics-server": CclusterCatalogsClusterBaseMetricsServerChartValues.from_dict(obj["metrics-server"]) if obj.get("metrics-server") is not None else None
|
|
102
|
+
})
|
|
103
|
+
# store additional fields in additional_properties
|
|
104
|
+
for _key in obj.keys():
|
|
105
|
+
if _key not in cls.__properties:
|
|
106
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
107
|
+
|
|
108
|
+
return _obj
|
|
109
|
+
|
|
110
|
+
|
|
@@ -21,17 +21,20 @@ from pydantic import BaseModel, ConfigDict, StrictBool
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
24
|
+
from pydantic_core import to_jsonable_python
|
|
24
25
|
|
|
25
|
-
class
|
|
26
|
+
class CDI(BaseModel):
|
|
26
27
|
"""
|
|
27
|
-
|
|
28
|
+
CDI configures the Container Device Interface.
|
|
28
29
|
""" # noqa: E501
|
|
29
|
-
enabled: Optional[StrictBool] =
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
enabled: Optional[StrictBool] = None
|
|
31
|
+
default: Optional[StrictBool] = None
|
|
32
|
+
additional_properties: Dict[str, Any] = {}
|
|
33
|
+
__properties: ClassVar[List[str]] = ["enabled", "default"]
|
|
32
34
|
|
|
33
35
|
model_config = ConfigDict(
|
|
34
|
-
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
35
38
|
validate_assignment=True,
|
|
36
39
|
protected_namespaces=(),
|
|
37
40
|
)
|
|
@@ -43,12 +46,11 @@ class SpireCrds(BaseModel):
|
|
|
43
46
|
|
|
44
47
|
def to_json(self) -> str:
|
|
45
48
|
"""Returns the JSON representation of the model using alias"""
|
|
46
|
-
|
|
47
|
-
return json.dumps(self.to_dict())
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
48
50
|
|
|
49
51
|
@classmethod
|
|
50
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
-
"""Create an instance of
|
|
53
|
+
"""Create an instance of CDI from a JSON string"""
|
|
52
54
|
return cls.from_dict(json.loads(json_str))
|
|
53
55
|
|
|
54
56
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -60,8 +62,10 @@ class SpireCrds(BaseModel):
|
|
|
60
62
|
* `None` is only added to the output dict for nullable fields that
|
|
61
63
|
were set at model initialization. Other fields with value `None`
|
|
62
64
|
are ignored.
|
|
65
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
63
66
|
"""
|
|
64
67
|
excluded_fields: Set[str] = set([
|
|
68
|
+
"additional_properties",
|
|
65
69
|
])
|
|
66
70
|
|
|
67
71
|
_dict = self.model_dump(
|
|
@@ -69,11 +73,26 @@ class SpireCrds(BaseModel):
|
|
|
69
73
|
exclude=excluded_fields,
|
|
70
74
|
exclude_none=True,
|
|
71
75
|
)
|
|
76
|
+
# puts key-value pairs in additional_properties in the top level
|
|
77
|
+
if self.additional_properties is not None:
|
|
78
|
+
for _key, _value in self.additional_properties.items():
|
|
79
|
+
_dict[_key] = _value
|
|
80
|
+
|
|
81
|
+
# set to None if enabled (nullable) is None
|
|
82
|
+
# and model_fields_set contains the field
|
|
83
|
+
if self.enabled is None and "enabled" in self.model_fields_set:
|
|
84
|
+
_dict['enabled'] = None
|
|
85
|
+
|
|
86
|
+
# set to None if default (nullable) is None
|
|
87
|
+
# and model_fields_set contains the field
|
|
88
|
+
if self.default is None and "default" in self.model_fields_set:
|
|
89
|
+
_dict['default'] = None
|
|
90
|
+
|
|
72
91
|
return _dict
|
|
73
92
|
|
|
74
93
|
@classmethod
|
|
75
94
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
-
"""Create an instance of
|
|
95
|
+
"""Create an instance of CDI from a dict"""
|
|
77
96
|
if obj is None:
|
|
78
97
|
return None
|
|
79
98
|
|
|
@@ -81,9 +100,14 @@ class SpireCrds(BaseModel):
|
|
|
81
100
|
return cls.model_validate(obj)
|
|
82
101
|
|
|
83
102
|
_obj = cls.model_validate({
|
|
84
|
-
"enabled": obj.get("enabled")
|
|
85
|
-
"
|
|
103
|
+
"enabled": obj.get("enabled"),
|
|
104
|
+
"default": obj.get("default")
|
|
86
105
|
})
|
|
106
|
+
# store additional fields in additional_properties
|
|
107
|
+
for _key in obj.keys():
|
|
108
|
+
if _key not in cls.__properties:
|
|
109
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
110
|
+
|
|
87
111
|
return _obj
|
|
88
112
|
|
|
89
113
|
|
|
@@ -0,0 +1,187 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from platform_api_python_client.models.ccluster_catalogs_cluster_base_argo_rollouts_values import CclusterCatalogsClusterBaseArgoRolloutsValues
|
|
23
|
+
from platform_api_python_client.models.ccluster_catalogs_cluster_base_cert_manager_values import CclusterCatalogsClusterBaseCertManagerValues
|
|
24
|
+
from platform_api_python_client.models.ccluster_catalogs_cluster_base_gpu_operator_values import CclusterCatalogsClusterBaseGpuOperatorValues
|
|
25
|
+
from platform_api_python_client.models.ccluster_catalogs_cluster_base_ingress_nginx_values import CclusterCatalogsClusterBaseIngressNginxValues
|
|
26
|
+
from platform_api_python_client.models.ccluster_catalogs_cluster_base_istio_values import CclusterCatalogsClusterBaseIstioValues
|
|
27
|
+
from platform_api_python_client.models.ccluster_catalogs_cluster_base_kai_scheduler_values import CclusterCatalogsClusterBaseKaiSchedulerValues
|
|
28
|
+
from platform_api_python_client.models.ccluster_catalogs_cluster_base_keda_values import CclusterCatalogsClusterBaseKedaValues
|
|
29
|
+
from platform_api_python_client.models.ccluster_catalogs_cluster_base_kube_prometheus_stack_values import CclusterCatalogsClusterBaseKubePrometheusStackValues
|
|
30
|
+
from platform_api_python_client.models.ccluster_catalogs_cluster_base_metrics_server_values import CclusterCatalogsClusterBaseMetricsServerValues
|
|
31
|
+
from typing import Optional, Set
|
|
32
|
+
from typing_extensions import Self
|
|
33
|
+
from pydantic_core import to_jsonable_python
|
|
34
|
+
|
|
35
|
+
class ClusterBaseComponents(BaseModel):
|
|
36
|
+
"""
|
|
37
|
+
The cluster_base components to install on a ccluster cluster, each as its chart's values. A component is installed only when its field is set (``{}`` for the catalog defaults), with exactly the values given. One left out is not installed, and is uninstalled if an earlier update installed it. final_stack is required. The values use the chart's own keys and may include keys the typed model doesn't list; they reach the chart unchanged. Inference deployments on GKE need ingress_nginx's `ingress-nginx.controller.podLabels` (`sidecar.istio.io/inject: \"true\"`), istio's CNI paths and gpu_operator's GKE driver paths. An unknown component name is rejected rather than read as one left out, which would uninstall it. With the generated Python client, build the request with `UpdateClusterRequest.from_dict(...)`: its model constructors drop the keys a typed model doesn't list (CentML/platform#4946).
|
|
38
|
+
""" # noqa: E501
|
|
39
|
+
kube_prometheus_stack: Optional[CclusterCatalogsClusterBaseKubePrometheusStackValues] = None
|
|
40
|
+
istio: Optional[CclusterCatalogsClusterBaseIstioValues] = None
|
|
41
|
+
cert_manager: Optional[CclusterCatalogsClusterBaseCertManagerValues] = None
|
|
42
|
+
ingress_nginx: Optional[CclusterCatalogsClusterBaseIngressNginxValues] = None
|
|
43
|
+
keda: Optional[CclusterCatalogsClusterBaseKedaValues] = None
|
|
44
|
+
argo_rollouts: Optional[CclusterCatalogsClusterBaseArgoRolloutsValues] = None
|
|
45
|
+
gpu_operator: Optional[CclusterCatalogsClusterBaseGpuOperatorValues] = None
|
|
46
|
+
kai_scheduler: Optional[CclusterCatalogsClusterBaseKaiSchedulerValues] = None
|
|
47
|
+
metrics_server: Optional[CclusterCatalogsClusterBaseMetricsServerValues] = None
|
|
48
|
+
final_stack: Dict[str, Any] = Field(description="Values of the catalogs/cluster_base/final_stack chart, generated from its Go package.")
|
|
49
|
+
__properties: ClassVar[List[str]] = ["kube_prometheus_stack", "istio", "cert_manager", "ingress_nginx", "keda", "argo_rollouts", "gpu_operator", "kai_scheduler", "metrics_server", "final_stack"]
|
|
50
|
+
|
|
51
|
+
model_config = ConfigDict(
|
|
52
|
+
validate_by_name=True,
|
|
53
|
+
validate_by_alias=True,
|
|
54
|
+
validate_assignment=True,
|
|
55
|
+
protected_namespaces=(),
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def to_str(self) -> str:
|
|
60
|
+
"""Returns the string representation of the model using alias"""
|
|
61
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
62
|
+
|
|
63
|
+
def to_json(self) -> str:
|
|
64
|
+
"""Returns the JSON representation of the model using alias"""
|
|
65
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
69
|
+
"""Create an instance of ClusterBaseComponents from a JSON string"""
|
|
70
|
+
return cls.from_dict(json.loads(json_str))
|
|
71
|
+
|
|
72
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
73
|
+
"""Return the dictionary representation of the model using alias.
|
|
74
|
+
|
|
75
|
+
This has the following differences from calling pydantic's
|
|
76
|
+
`self.model_dump(by_alias=True)`:
|
|
77
|
+
|
|
78
|
+
* `None` is only added to the output dict for nullable fields that
|
|
79
|
+
were set at model initialization. Other fields with value `None`
|
|
80
|
+
are ignored.
|
|
81
|
+
"""
|
|
82
|
+
excluded_fields: Set[str] = set([
|
|
83
|
+
])
|
|
84
|
+
|
|
85
|
+
_dict = self.model_dump(
|
|
86
|
+
by_alias=True,
|
|
87
|
+
exclude=excluded_fields,
|
|
88
|
+
exclude_none=True,
|
|
89
|
+
)
|
|
90
|
+
# override the default output from pydantic by calling `to_dict()` of kube_prometheus_stack
|
|
91
|
+
if self.kube_prometheus_stack:
|
|
92
|
+
_dict['kube_prometheus_stack'] = self.kube_prometheus_stack.to_dict()
|
|
93
|
+
# override the default output from pydantic by calling `to_dict()` of istio
|
|
94
|
+
if self.istio:
|
|
95
|
+
_dict['istio'] = self.istio.to_dict()
|
|
96
|
+
# override the default output from pydantic by calling `to_dict()` of cert_manager
|
|
97
|
+
if self.cert_manager:
|
|
98
|
+
_dict['cert_manager'] = self.cert_manager.to_dict()
|
|
99
|
+
# override the default output from pydantic by calling `to_dict()` of ingress_nginx
|
|
100
|
+
if self.ingress_nginx:
|
|
101
|
+
_dict['ingress_nginx'] = self.ingress_nginx.to_dict()
|
|
102
|
+
# override the default output from pydantic by calling `to_dict()` of keda
|
|
103
|
+
if self.keda:
|
|
104
|
+
_dict['keda'] = self.keda.to_dict()
|
|
105
|
+
# override the default output from pydantic by calling `to_dict()` of argo_rollouts
|
|
106
|
+
if self.argo_rollouts:
|
|
107
|
+
_dict['argo_rollouts'] = self.argo_rollouts.to_dict()
|
|
108
|
+
# override the default output from pydantic by calling `to_dict()` of gpu_operator
|
|
109
|
+
if self.gpu_operator:
|
|
110
|
+
_dict['gpu_operator'] = self.gpu_operator.to_dict()
|
|
111
|
+
# override the default output from pydantic by calling `to_dict()` of kai_scheduler
|
|
112
|
+
if self.kai_scheduler:
|
|
113
|
+
_dict['kai_scheduler'] = self.kai_scheduler.to_dict()
|
|
114
|
+
# override the default output from pydantic by calling `to_dict()` of metrics_server
|
|
115
|
+
if self.metrics_server:
|
|
116
|
+
_dict['metrics_server'] = self.metrics_server.to_dict()
|
|
117
|
+
# set to None if kube_prometheus_stack (nullable) is None
|
|
118
|
+
# and model_fields_set contains the field
|
|
119
|
+
if self.kube_prometheus_stack is None and "kube_prometheus_stack" in self.model_fields_set:
|
|
120
|
+
_dict['kube_prometheus_stack'] = None
|
|
121
|
+
|
|
122
|
+
# set to None if istio (nullable) is None
|
|
123
|
+
# and model_fields_set contains the field
|
|
124
|
+
if self.istio is None and "istio" in self.model_fields_set:
|
|
125
|
+
_dict['istio'] = None
|
|
126
|
+
|
|
127
|
+
# set to None if cert_manager (nullable) is None
|
|
128
|
+
# and model_fields_set contains the field
|
|
129
|
+
if self.cert_manager is None and "cert_manager" in self.model_fields_set:
|
|
130
|
+
_dict['cert_manager'] = None
|
|
131
|
+
|
|
132
|
+
# set to None if ingress_nginx (nullable) is None
|
|
133
|
+
# and model_fields_set contains the field
|
|
134
|
+
if self.ingress_nginx is None and "ingress_nginx" in self.model_fields_set:
|
|
135
|
+
_dict['ingress_nginx'] = None
|
|
136
|
+
|
|
137
|
+
# set to None if keda (nullable) is None
|
|
138
|
+
# and model_fields_set contains the field
|
|
139
|
+
if self.keda is None and "keda" in self.model_fields_set:
|
|
140
|
+
_dict['keda'] = None
|
|
141
|
+
|
|
142
|
+
# set to None if argo_rollouts (nullable) is None
|
|
143
|
+
# and model_fields_set contains the field
|
|
144
|
+
if self.argo_rollouts is None and "argo_rollouts" in self.model_fields_set:
|
|
145
|
+
_dict['argo_rollouts'] = None
|
|
146
|
+
|
|
147
|
+
# set to None if gpu_operator (nullable) is None
|
|
148
|
+
# and model_fields_set contains the field
|
|
149
|
+
if self.gpu_operator is None and "gpu_operator" in self.model_fields_set:
|
|
150
|
+
_dict['gpu_operator'] = None
|
|
151
|
+
|
|
152
|
+
# set to None if kai_scheduler (nullable) is None
|
|
153
|
+
# and model_fields_set contains the field
|
|
154
|
+
if self.kai_scheduler is None and "kai_scheduler" in self.model_fields_set:
|
|
155
|
+
_dict['kai_scheduler'] = None
|
|
156
|
+
|
|
157
|
+
# set to None if metrics_server (nullable) is None
|
|
158
|
+
# and model_fields_set contains the field
|
|
159
|
+
if self.metrics_server is None and "metrics_server" in self.model_fields_set:
|
|
160
|
+
_dict['metrics_server'] = None
|
|
161
|
+
|
|
162
|
+
return _dict
|
|
163
|
+
|
|
164
|
+
@classmethod
|
|
165
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
166
|
+
"""Create an instance of ClusterBaseComponents from a dict"""
|
|
167
|
+
if obj is None:
|
|
168
|
+
return None
|
|
169
|
+
|
|
170
|
+
if not isinstance(obj, dict):
|
|
171
|
+
return cls.model_validate(obj)
|
|
172
|
+
|
|
173
|
+
_obj = cls.model_validate({
|
|
174
|
+
"kube_prometheus_stack": CclusterCatalogsClusterBaseKubePrometheusStackValues.from_dict(obj["kube_prometheus_stack"]) if obj.get("kube_prometheus_stack") is not None else None,
|
|
175
|
+
"istio": CclusterCatalogsClusterBaseIstioValues.from_dict(obj["istio"]) if obj.get("istio") is not None else None,
|
|
176
|
+
"cert_manager": CclusterCatalogsClusterBaseCertManagerValues.from_dict(obj["cert_manager"]) if obj.get("cert_manager") is not None else None,
|
|
177
|
+
"ingress_nginx": CclusterCatalogsClusterBaseIngressNginxValues.from_dict(obj["ingress_nginx"]) if obj.get("ingress_nginx") is not None else None,
|
|
178
|
+
"keda": CclusterCatalogsClusterBaseKedaValues.from_dict(obj["keda"]) if obj.get("keda") is not None else None,
|
|
179
|
+
"argo_rollouts": CclusterCatalogsClusterBaseArgoRolloutsValues.from_dict(obj["argo_rollouts"]) if obj.get("argo_rollouts") is not None else None,
|
|
180
|
+
"gpu_operator": CclusterCatalogsClusterBaseGpuOperatorValues.from_dict(obj["gpu_operator"]) if obj.get("gpu_operator") is not None else None,
|
|
181
|
+
"kai_scheduler": CclusterCatalogsClusterBaseKaiSchedulerValues.from_dict(obj["kai_scheduler"]) if obj.get("kai_scheduler") is not None else None,
|
|
182
|
+
"metrics_server": CclusterCatalogsClusterBaseMetricsServerValues.from_dict(obj["metrics_server"]) if obj.get("metrics_server") is not None else None,
|
|
183
|
+
"final_stack": obj.get("final_stack")
|
|
184
|
+
})
|
|
185
|
+
return _obj
|
|
186
|
+
|
|
187
|
+
|
|
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List
|
|
|
22
22
|
from platform_api_python_client.models.gpu_type_capacity import GpuTypeCapacity
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
25
26
|
|
|
26
27
|
class ClusterCapacityResponse(BaseModel):
|
|
27
28
|
"""
|
|
@@ -33,7 +34,8 @@ class ClusterCapacityResponse(BaseModel):
|
|
|
33
34
|
__properties: ClassVar[List[str]] = ["cluster_id", "cluster_name", "gpu_types"]
|
|
34
35
|
|
|
35
36
|
model_config = ConfigDict(
|
|
36
|
-
|
|
37
|
+
validate_by_name=True,
|
|
38
|
+
validate_by_alias=True,
|
|
37
39
|
validate_assignment=True,
|
|
38
40
|
protected_namespaces=(),
|
|
39
41
|
)
|
|
@@ -45,8 +47,7 @@ class ClusterCapacityResponse(BaseModel):
|
|
|
45
47
|
|
|
46
48
|
def to_json(self) -> str:
|
|
47
49
|
"""Returns the JSON representation of the model using alias"""
|
|
48
|
-
|
|
49
|
-
return json.dumps(self.to_dict())
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
51
|
|
|
51
52
|
@classmethod
|
|
52
53
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -75,8 +76,7 @@ class ClusterCapacityResponse(BaseModel):
|
|
|
75
76
|
_items = []
|
|
76
77
|
if self.gpu_types:
|
|
77
78
|
for _item_gpu_types in self.gpu_types:
|
|
78
|
-
if _item_gpu_types
|
|
79
|
-
_items.append(_item_gpu_types.to_dict())
|
|
79
|
+
_items.append(_item_gpu_types.to_dict() if _item_gpu_types is not None else None)
|
|
80
80
|
_dict['gpu_types'] = _items
|
|
81
81
|
return _dict
|
|
82
82
|
|