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.
Files changed (191) hide show
  1. platform_api_python_client/__init__.py +410 -177
  2. platform_api_python_client/api/external_api.py +41 -47
  3. platform_api_python_client/api_client.py +81 -36
  4. platform_api_python_client/configuration.py +262 -66
  5. platform_api_python_client/exceptions.py +24 -5
  6. platform_api_python_client/models/__init__.py +52 -26
  7. platform_api_python_client/models/admission.py +106 -0
  8. platform_api_python_client/models/autoscaling.py +120 -0
  9. platform_api_python_client/models/ccl_dynamo_pools.py +4 -3
  10. platform_api_python_client/models/ccl_main_pools.py +4 -3
  11. platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_chart_values.py +121 -0
  12. platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_controller.py +106 -0
  13. platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_values.py +110 -0
  14. platform_api_python_client/models/ccluster_catalogs_cluster_base_cert_manager_chart_values.py +117 -0
  15. platform_api_python_client/models/ccluster_catalogs_cluster_base_cert_manager_values.py +110 -0
  16. platform_api_python_client/models/ccluster_catalogs_cluster_base_gpu_operator_chart_values.py +152 -0
  17. platform_api_python_client/models/ccluster_catalogs_cluster_base_gpu_operator_values.py +121 -0
  18. platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_chart_values.py +110 -0
  19. platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_controller.py +121 -0
  20. platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_values.py +110 -0
  21. platform_api_python_client/models/ccluster_catalogs_cluster_base_istio_values.py +143 -0
  22. platform_api_python_client/models/ccluster_catalogs_cluster_base_kai_scheduler_chart_values.py +154 -0
  23. platform_api_python_client/models/ccluster_catalogs_cluster_base_kai_scheduler_values.py +121 -0
  24. platform_api_python_client/models/ccluster_catalogs_cluster_base_keda_chart_values.py +131 -0
  25. platform_api_python_client/models/ccluster_catalogs_cluster_base_keda_values.py +110 -0
  26. platform_api_python_client/models/ccluster_catalogs_cluster_base_kube_prometheus_stack_chart_values.py +121 -0
  27. platform_api_python_client/models/ccluster_catalogs_cluster_base_kube_prometheus_stack_values.py +121 -0
  28. platform_api_python_client/models/ccluster_catalogs_cluster_base_metrics_server_chart_values.py +106 -0
  29. platform_api_python_client/models/ccluster_catalogs_cluster_base_metrics_server_values.py +110 -0
  30. platform_api_python_client/models/{spire_crds.py → cdi.py} +36 -12
  31. platform_api_python_client/models/cluster_base_components.py +187 -0
  32. platform_api_python_client/models/cluster_capacity_response.py +5 -5
  33. platform_api_python_client/models/cluster_credential.py +4 -3
  34. platform_api_python_client/models/cluster_registration_request.py +4 -3
  35. platform_api_python_client/models/cluster_registration_response.py +4 -3
  36. platform_api_python_client/models/{istio_cni_overrides.py → cni.py} +29 -15
  37. platform_api_python_client/models/config_file_mount.py +6 -5
  38. platform_api_python_client/models/create_compute_deployment_request.py +10 -10
  39. platform_api_python_client/models/create_compute_deployment_response.py +4 -3
  40. platform_api_python_client/models/create_dynamo_deployment_request.py +29 -23
  41. platform_api_python_client/models/create_dynamo_deployment_response.py +4 -3
  42. platform_api_python_client/models/create_filesystem_volume_request.py +8 -7
  43. platform_api_python_client/models/create_hardware_instance_request.py +4 -3
  44. platform_api_python_client/models/create_inference_deployment_response.py +4 -3
  45. platform_api_python_client/models/create_inference_v3_deployment_request.py +14 -12
  46. platform_api_python_client/models/create_job_deployment_request.py +10 -10
  47. platform_api_python_client/models/create_job_deployment_response.py +4 -3
  48. platform_api_python_client/models/create_object_volume_request.py +10 -9
  49. platform_api_python_client/models/create_organization_request.py +4 -3
  50. platform_api_python_client/models/create_organization_response.py +4 -3
  51. platform_api_python_client/models/create_service_account_request.py +4 -3
  52. platform_api_python_client/models/create_service_account_response.py +4 -3
  53. platform_api_python_client/models/credits_response.py +4 -3
  54. platform_api_python_client/models/daily_bill_response.py +4 -3
  55. platform_api_python_client/models/{fluent_bit.py → dashboard.py} +29 -12
  56. platform_api_python_client/models/{prometheus_adapter.py → default_priorities.py} +29 -12
  57. platform_api_python_client/models/default_queue.py +106 -0
  58. platform_api_python_client/models/delete_user_vault_item_request.py +4 -3
  59. platform_api_python_client/models/deployment_log_event_v4.py +4 -3
  60. platform_api_python_client/models/deployment_status_request.py +4 -3
  61. platform_api_python_client/models/deployment_status_response.py +4 -3
  62. platform_api_python_client/models/deployment_status_v3_response.py +5 -5
  63. platform_api_python_client/models/deployment_usage.py +5 -5
  64. platform_api_python_client/models/deployment_usage_value.py +4 -3
  65. platform_api_python_client/models/dynamo_communications_input.py +4 -3
  66. platform_api_python_client/models/dynamo_frontend_config.py +105 -0
  67. platform_api_python_client/models/dynamo_frontend_config_response.py +105 -0
  68. platform_api_python_client/models/dynamo_image.py +6 -5
  69. platform_api_python_client/models/dynamo_kv_transfer_configuration.py +4 -3
  70. platform_api_python_client/models/dynamo_weight_transfer_configuration.py +4 -3
  71. platform_api_python_client/models/dynamo_worker_pool_config.py +5 -4
  72. platform_api_python_client/models/dynamo_worker_pools.py +4 -3
  73. platform_api_python_client/models/env.py +4 -3
  74. platform_api_python_client/models/generate_service_account_secret_response.py +4 -3
  75. platform_api_python_client/models/get_cluster_response.py +4 -3
  76. platform_api_python_client/models/get_compute_deployment_response.py +8 -8
  77. platform_api_python_client/models/get_deployment_log_response.py +4 -3
  78. platform_api_python_client/models/get_deployment_log_v4_response.py +5 -5
  79. platform_api_python_client/models/get_deployment_pods_response.py +4 -3
  80. platform_api_python_client/models/get_deployment_response.py +7 -7
  81. platform_api_python_client/models/get_deployment_revision_response.py +4 -3
  82. platform_api_python_client/models/get_deployment_usage_response.py +5 -5
  83. platform_api_python_client/models/get_dynamo_deployment_response.py +23 -17
  84. platform_api_python_client/models/get_filesystem_volume_response.py +4 -3
  85. platform_api_python_client/models/get_inference_deployment_response.py +7 -7
  86. platform_api_python_client/models/get_inference_v3_deployment_response.py +11 -9
  87. platform_api_python_client/models/get_job_deployment_response.py +8 -8
  88. platform_api_python_client/models/get_object_volume_response.py +4 -3
  89. platform_api_python_client/models/gpu_type_capacity.py +4 -3
  90. platform_api_python_client/models/hardware_instance_response.py +4 -3
  91. platform_api_python_client/models/hardware_preset_response.py +4 -3
  92. platform_api_python_client/models/http_validation_error.py +5 -5
  93. platform_api_python_client/models/image.py +6 -5
  94. platform_api_python_client/models/image_pull_secret_credentials.py +4 -3
  95. platform_api_python_client/models/ingress.py +4 -3
  96. platform_api_python_client/models/insight_list_item_response.py +4 -3
  97. platform_api_python_client/models/insight_resource.py +4 -3
  98. platform_api_python_client/models/insight_response.py +5 -5
  99. platform_api_python_client/models/insight_status_change_response.py +4 -3
  100. platform_api_python_client/models/invite_user_request.py +4 -3
  101. platform_api_python_client/models/istio_base.py +106 -0
  102. platform_api_python_client/models/istio_cni.py +124 -0
  103. platform_api_python_client/models/{argo_rollouts.py → istio_gateway.py} +29 -12
  104. platform_api_python_client/models/{istio_cni_subchart_overrides.py → istiod.py} +31 -17
  105. platform_api_python_client/models/list_cluster_capacity_response.py +5 -5
  106. platform_api_python_client/models/list_daily_bill_response.py +5 -5
  107. platform_api_python_client/models/list_deployment_revisions_response.py +5 -5
  108. platform_api_python_client/models/list_get_cluster_response.py +5 -5
  109. platform_api_python_client/models/list_get_deployment_response.py +5 -5
  110. platform_api_python_client/models/list_hardware_instance_response.py +5 -5
  111. platform_api_python_client/models/list_hardware_preset_response.py +5 -5
  112. platform_api_python_client/models/list_insights_response.py +5 -5
  113. platform_api_python_client/models/list_organization_gpu_quota_response.py +5 -5
  114. platform_api_python_client/models/list_prebuilt_image_response.py +5 -5
  115. platform_api_python_client/models/list_service_accounts_response.py +5 -5
  116. platform_api_python_client/models/list_user_vault_items_response.py +5 -5
  117. platform_api_python_client/models/list_volumes_response.py +5 -5
  118. platform_api_python_client/models/{validation_error_loc_inner.py → location_inner.py} +6 -6
  119. platform_api_python_client/models/metrics.py +117 -0
  120. platform_api_python_client/models/metrics_config.py +6 -5
  121. platform_api_python_client/models/{istio_overrides.py → mig.py} +28 -18
  122. platform_api_python_client/models/operator.py +117 -0
  123. platform_api_python_client/models/organization_gpu_quota_request.py +4 -3
  124. platform_api_python_client/models/organization_gpu_quota_response.py +4 -3
  125. platform_api_python_client/models/pilot.py +106 -0
  126. platform_api_python_client/models/pod_details.py +4 -3
  127. platform_api_python_client/models/pool.py +4 -3
  128. platform_api_python_client/models/prebuilt_image_response.py +4 -3
  129. platform_api_python_client/models/prometheus.py +110 -0
  130. platform_api_python_client/models/prometheus_rules.py +120 -0
  131. platform_api_python_client/models/prometheus_spec.py +113 -0
  132. platform_api_python_client/models/prometheus_values.py +117 -0
  133. platform_api_python_client/models/quota.py +106 -0
  134. platform_api_python_client/models/replicas.py +106 -0
  135. platform_api_python_client/models/resource_list.py +113 -0
  136. platform_api_python_client/models/resource_requirements.py +120 -0
  137. platform_api_python_client/models/revision_pod_details.py +5 -5
  138. platform_api_python_client/models/rollout_strategy_params.py +4 -3
  139. platform_api_python_client/models/scheduler.py +117 -0
  140. platform_api_python_client/models/service_account_response.py +4 -3
  141. platform_api_python_client/models/{istio.py → toggle.py} +27 -19
  142. platform_api_python_client/models/toleration.py +134 -0
  143. platform_api_python_client/models/unified_get_compute_deployment_response.py +8 -8
  144. platform_api_python_client/models/unified_get_deployment_logs_response.py +5 -5
  145. platform_api_python_client/models/unified_get_deployment_pods_response.py +4 -3
  146. platform_api_python_client/models/unified_get_deployment_revision_response.py +4 -3
  147. platform_api_python_client/models/unified_get_deployment_rollout_response.py +4 -3
  148. platform_api_python_client/models/unified_get_deployment_usage_response.py +5 -5
  149. platform_api_python_client/models/unified_get_dynamo_deployment_response.py +13 -13
  150. platform_api_python_client/models/unified_get_inference_v3_deployment_response.py +9 -9
  151. platform_api_python_client/models/unified_get_job_deployment_response.py +8 -8
  152. platform_api_python_client/models/unified_list_deployment_revisions_response.py +5 -5
  153. platform_api_python_client/models/unified_update_deployment_rollout_request.py +4 -3
  154. platform_api_python_client/models/unified_write_compute_deployment_request.py +8 -8
  155. platform_api_python_client/models/unified_write_deployment_response.py +4 -3
  156. platform_api_python_client/models/unified_write_dynamo_deployment_request.py +11 -11
  157. platform_api_python_client/models/unified_write_inference_v3_deployment_request.py +9 -9
  158. platform_api_python_client/models/unified_write_job_deployment_request.py +8 -8
  159. platform_api_python_client/models/update_cluster_metadata_request.py +4 -3
  160. platform_api_python_client/models/{cluster_config.py → update_cluster_request.py} +11 -10
  161. platform_api_python_client/models/update_deployment_response.py +4 -3
  162. platform_api_python_client/models/update_deployment_status_v3_request.py +4 -3
  163. platform_api_python_client/models/update_insight_status_request.py +7 -6
  164. platform_api_python_client/models/update_service_account_request.py +4 -3
  165. platform_api_python_client/models/upsert_user_vault_item_request.py +4 -3
  166. platform_api_python_client/models/user_vault_item.py +4 -3
  167. platform_api_python_client/models/validation_error.py +8 -8
  168. platform_api_python_client/models/volume_mount.py +4 -3
  169. platform_api_python_client/models/volume_status_response.py +4 -3
  170. platform_api_python_client/models/{dynamo_communications_output.py → workload.py} +34 -15
  171. platform_api_python_client/rest.py +87 -10
  172. platform_api_python_client-4.41.0.dist-info/METADATA +418 -0
  173. platform_api_python_client-4.41.0.dist-info/RECORD +206 -0
  174. platform_api_python_client/models/cert_manager.py +0 -89
  175. platform_api_python_client/models/cluster_components.py +0 -193
  176. platform_api_python_client/models/external_dns.py +0 -89
  177. platform_api_python_client/models/final_stack.py +0 -89
  178. platform_api_python_client/models/gpu_operator.py +0 -89
  179. platform_api_python_client/models/ingress_nginx.py +0 -89
  180. platform_api_python_client/models/keda.py +0 -89
  181. platform_api_python_client/models/kube_prometheus_stack.py +0 -89
  182. platform_api_python_client/models/longhorn.py +0 -89
  183. platform_api_python_client/models/metrics_server.py +0 -89
  184. platform_api_python_client/models/network_operator.py +0 -89
  185. platform_api_python_client/models/opentelemetry_collector.py +0 -89
  186. platform_api_python_client/models/spire.py +0 -89
  187. platform_api_python_client/models/teleport_kube_agent.py +0 -89
  188. platform_api_python_client-4.37.1.dist-info/METADATA +0 -23
  189. platform_api_python_client-4.37.1.dist-info/RECORD +0 -180
  190. {platform_api_python_client-4.37.1.dist-info → platform_api_python_client-4.41.0.dist-info}/WHEEL +0 -0
  191. {platform_api_python_client-4.37.1.dist-info → platform_api_python_client-4.41.0.dist-info}/top_level.txt +0 -0
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List
22
22
  from platform_api_python_client.models.prebuilt_image_response import PrebuiltImageResponse
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 ListPrebuiltImageResponse(BaseModel):
27
28
  """
@@ -31,7 +32,8 @@ class ListPrebuiltImageResponse(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["results"]
32
33
 
33
34
  model_config = ConfigDict(
34
- populate_by_name=True,
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
35
37
  validate_assignment=True,
36
38
  protected_namespaces=(),
37
39
  )
@@ -43,8 +45,7 @@ class ListPrebuiltImageResponse(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -73,8 +74,7 @@ class ListPrebuiltImageResponse(BaseModel):
73
74
  _items = []
74
75
  if self.results:
75
76
  for _item_results in self.results:
76
- if _item_results:
77
- _items.append(_item_results.to_dict())
77
+ _items.append(_item_results.to_dict() if _item_results is not None else None)
78
78
  _dict['results'] = _items
79
79
  return _dict
80
80
 
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List
22
22
  from platform_api_python_client.models.service_account_response import ServiceAccountResponse
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 ListServiceAccountsResponse(BaseModel):
27
28
  """
@@ -31,7 +32,8 @@ class ListServiceAccountsResponse(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["results"]
32
33
 
33
34
  model_config = ConfigDict(
34
- populate_by_name=True,
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
35
37
  validate_assignment=True,
36
38
  protected_namespaces=(),
37
39
  )
@@ -43,8 +45,7 @@ class ListServiceAccountsResponse(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -73,8 +74,7 @@ class ListServiceAccountsResponse(BaseModel):
73
74
  _items = []
74
75
  if self.results:
75
76
  for _item_results in self.results:
76
- if _item_results:
77
- _items.append(_item_results.to_dict())
77
+ _items.append(_item_results.to_dict() if _item_results is not None else None)
78
78
  _dict['results'] = _items
79
79
  return _dict
80
80
 
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List
22
22
  from platform_api_python_client.models.user_vault_item import UserVaultItem
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 ListUserVaultItemsResponse(BaseModel):
27
28
  """
@@ -31,7 +32,8 @@ class ListUserVaultItemsResponse(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["results"]
32
33
 
33
34
  model_config = ConfigDict(
34
- populate_by_name=True,
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
35
37
  validate_assignment=True,
36
38
  protected_namespaces=(),
37
39
  )
@@ -43,8 +45,7 @@ class ListUserVaultItemsResponse(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -73,8 +74,7 @@ class ListUserVaultItemsResponse(BaseModel):
73
74
  _items = []
74
75
  if self.results:
75
76
  for _item_results in self.results:
76
- if _item_results:
77
- _items.append(_item_results.to_dict())
77
+ _items.append(_item_results.to_dict() if _item_results is not None else None)
78
78
  _dict['results'] = _items
79
79
  return _dict
80
80
 
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List
22
22
  from platform_api_python_client.models.get_volume_response import GetVolumeResponse
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 ListVolumesResponse(BaseModel):
27
28
  """
@@ -31,7 +32,8 @@ class ListVolumesResponse(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["results"]
32
33
 
33
34
  model_config = ConfigDict(
34
- populate_by_name=True,
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
35
37
  validate_assignment=True,
36
38
  protected_namespaces=(),
37
39
  )
@@ -43,8 +45,7 @@ class ListVolumesResponse(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -73,8 +74,7 @@ class ListVolumesResponse(BaseModel):
73
74
  _items = []
74
75
  if self.results:
75
76
  for _item_results in self.results:
76
- if _item_results:
77
- _items.append(_item_results.to_dict())
77
+ _items.append(_item_results.to_dict() if _item_results is not None else None)
78
78
  _dict['results'] = _items
79
79
  return _dict
80
80
 
@@ -23,11 +23,11 @@ from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
23
23
  from typing_extensions import Literal, Self
24
24
  from pydantic import Field
25
25
 
26
- VALIDATIONERRORLOCINNER_ANY_OF_SCHEMAS = ["int", "str"]
26
+ LOCATIONINNER_ANY_OF_SCHEMAS = ["int", "str"]
27
27
 
28
- class ValidationErrorLocInner(BaseModel):
28
+ class LocationInner(BaseModel):
29
29
  """
30
- ValidationErrorLocInner
30
+ LocationInner
31
31
  """
32
32
 
33
33
  # data type: str
@@ -57,7 +57,7 @@ class ValidationErrorLocInner(BaseModel):
57
57
 
58
58
  @field_validator('actual_instance')
59
59
  def actual_instance_must_validate_anyof(cls, v):
60
- instance = ValidationErrorLocInner.model_construct()
60
+ instance = LocationInner.model_construct()
61
61
  error_messages = []
62
62
  # validate data type: str
63
63
  try:
@@ -73,7 +73,7 @@ class ValidationErrorLocInner(BaseModel):
73
73
  error_messages.append(str(e))
74
74
  if error_messages:
75
75
  # no match
76
- raise ValueError("No match found when setting the actual_instance in ValidationErrorLocInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages))
76
+ raise ValueError("No match found when setting the actual_instance in LocationInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages))
77
77
  else:
78
78
  return v
79
79
 
@@ -107,7 +107,7 @@ class ValidationErrorLocInner(BaseModel):
107
107
 
108
108
  if error_messages:
109
109
  # no match
110
- raise ValueError("No match found when deserializing the JSON string into ValidationErrorLocInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages))
110
+ raise ValueError("No match found when deserializing the JSON string into LocationInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages))
111
111
  else:
112
112
  return instance
113
113
 
@@ -0,0 +1,117 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from platform_api_python_client.models.toggle import Toggle
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class Metrics(BaseModel):
28
+ """
29
+ Metrics configures the controller's metrics endpoint and ServiceMonitor.
30
+ """ # noqa: E501
31
+ enabled: Optional[StrictBool] = None
32
+ service_monitor: Optional[Toggle] = Field(default=None, alias="serviceMonitor")
33
+ additional_properties: Dict[str, Any] = {}
34
+ __properties: ClassVar[List[str]] = ["enabled", "serviceMonitor"]
35
+
36
+ model_config = ConfigDict(
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ return json.dumps(to_jsonable_python(self.to_dict()))
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of Metrics from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ * Fields in `self.additional_properties` are added to the output dict.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ "additional_properties",
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 service_monitor
78
+ if self.service_monitor:
79
+ _dict['serviceMonitor'] = self.service_monitor.to_dict()
80
+ # puts key-value pairs in additional_properties in the top level
81
+ if self.additional_properties is not None:
82
+ for _key, _value in self.additional_properties.items():
83
+ _dict[_key] = _value
84
+
85
+ # set to None if enabled (nullable) is None
86
+ # and model_fields_set contains the field
87
+ if self.enabled is None and "enabled" in self.model_fields_set:
88
+ _dict['enabled'] = None
89
+
90
+ # set to None if service_monitor (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if self.service_monitor is None and "service_monitor" in self.model_fields_set:
93
+ _dict['serviceMonitor'] = None
94
+
95
+ return _dict
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99
+ """Create an instance of Metrics from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return cls.model_validate(obj)
105
+
106
+ _obj = cls.model_validate({
107
+ "enabled": obj.get("enabled"),
108
+ "serviceMonitor": Toggle.from_dict(obj["serviceMonitor"]) if obj.get("serviceMonitor") is not None else None
109
+ })
110
+ # store additional fields in additional_properties
111
+ for _key in obj.keys():
112
+ if _key not in cls.__properties:
113
+ _obj.additional_properties[_key] = obj.get(_key)
114
+
115
+ return _obj
116
+
117
+
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List
22
22
  from typing_extensions import Annotated
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 MetricsConfig(BaseModel):
27
28
  """
@@ -31,15 +32,16 @@ class MetricsConfig(BaseModel):
31
32
  path: Annotated[str, Field(strict=True)]
32
33
  __properties: ClassVar[List[str]] = ["port", "path"]
33
34
 
34
- @field_validator('path')
35
+ @field_validator('path', mode="before")
35
36
  def path_validate_regular_expression(cls, value):
36
37
  """Validates the regular expression"""
37
- if not re.match(r"^\/[^\s?#]*$", value):
38
+ if isinstance(value, str) and not re.match(r"^\/[^\s?#]*$", value):
38
39
  raise ValueError(r"must validate the regular expression /^\/[^\s?#]*$/")
39
40
  return value
40
41
 
41
42
  model_config = ConfigDict(
42
- populate_by_name=True,
43
+ validate_by_name=True,
44
+ validate_by_alias=True,
43
45
  validate_assignment=True,
44
46
  protected_namespaces=(),
45
47
  )
@@ -51,8 +53,7 @@ class MetricsConfig(BaseModel):
51
53
 
52
54
  def to_json(self) -> str:
53
55
  """Returns the JSON representation of the model using alias"""
54
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
- return json.dumps(self.to_dict())
56
+ return json.dumps(to_jsonable_python(self.to_dict()))
56
57
 
57
58
  @classmethod
58
59
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -17,21 +17,23 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
- from platform_api_python_client.models.istio_cni_subchart_overrides import IstioCniSubchartOverrides
23
22
  from typing import Optional, Set
24
23
  from typing_extensions import Self
24
+ from pydantic_core import to_jsonable_python
25
25
 
26
- class IstioOverrides(BaseModel):
26
+ class MIG(BaseModel):
27
27
  """
28
- IstioOverrides
28
+ MIG configures Multi-Instance GPU partitioning.
29
29
  """ # noqa: E501
30
- istio_cni: Optional[IstioCniSubchartOverrides] = Field(default=None, alias="istio-cni")
31
- __properties: ClassVar[List[str]] = ["istio-cni"]
30
+ strategy: Optional[StrictStr] = None
31
+ additional_properties: Dict[str, Any] = {}
32
+ __properties: ClassVar[List[str]] = ["strategy"]
32
33
 
33
34
  model_config = ConfigDict(
34
- populate_by_name=True,
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
35
37
  validate_assignment=True,
36
38
  protected_namespaces=(),
37
39
  )
@@ -43,12 +45,11 @@ class IstioOverrides(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  def from_json(cls, json_str: str) -> Optional[Self]:
51
- """Create an instance of IstioOverrides from a JSON string"""
52
+ """Create an instance of MIG from a JSON string"""
52
53
  return cls.from_dict(json.loads(json_str))
53
54
 
54
55
  def to_dict(self) -> Dict[str, Any]:
@@ -60,8 +61,10 @@ class IstioOverrides(BaseModel):
60
61
  * `None` is only added to the output dict for nullable fields that
61
62
  were set at model initialization. Other fields with value `None`
62
63
  are ignored.
64
+ * Fields in `self.additional_properties` are added to the output dict.
63
65
  """
64
66
  excluded_fields: Set[str] = set([
67
+ "additional_properties",
65
68
  ])
66
69
 
67
70
  _dict = self.model_dump(
@@ -69,19 +72,21 @@ class IstioOverrides(BaseModel):
69
72
  exclude=excluded_fields,
70
73
  exclude_none=True,
71
74
  )
72
- # override the default output from pydantic by calling `to_dict()` of istio_cni
73
- if self.istio_cni:
74
- _dict['istio-cni'] = self.istio_cni.to_dict()
75
- # set to None if istio_cni (nullable) is None
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 strategy (nullable) is None
76
81
  # and model_fields_set contains the field
77
- if self.istio_cni is None and "istio_cni" in self.model_fields_set:
78
- _dict['istio-cni'] = None
82
+ if self.strategy is None and "strategy" in self.model_fields_set:
83
+ _dict['strategy'] = None
79
84
 
80
85
  return _dict
81
86
 
82
87
  @classmethod
83
88
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
- """Create an instance of IstioOverrides from a dict"""
89
+ """Create an instance of MIG from a dict"""
85
90
  if obj is None:
86
91
  return None
87
92
 
@@ -89,8 +94,13 @@ class IstioOverrides(BaseModel):
89
94
  return cls.model_validate(obj)
90
95
 
91
96
  _obj = cls.model_validate({
92
- "istio-cni": IstioCniSubchartOverrides.from_dict(obj["istio-cni"]) if obj.get("istio-cni") is not None else None
97
+ "strategy": obj.get("strategy")
93
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
+
94
104
  return _obj
95
105
 
96
106
 
@@ -0,0 +1,117 @@
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 platform_api_python_client.models.resource_requirements import ResourceRequirements
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class Operator(BaseModel):
28
+ """
29
+ Operator configures the KAI operator, which deploys every other KAI component.
30
+ """ # noqa: E501
31
+ log_level: Optional[StrictStr] = Field(default=None, alias="logLevel")
32
+ resources: Optional[ResourceRequirements] = None
33
+ additional_properties: Dict[str, Any] = {}
34
+ __properties: ClassVar[List[str]] = ["logLevel", "resources"]
35
+
36
+ model_config = ConfigDict(
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ return json.dumps(to_jsonable_python(self.to_dict()))
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of Operator from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ * Fields in `self.additional_properties` are added to the output dict.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ "additional_properties",
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 resources
78
+ if self.resources:
79
+ _dict['resources'] = self.resources.to_dict()
80
+ # puts key-value pairs in additional_properties in the top level
81
+ if self.additional_properties is not None:
82
+ for _key, _value in self.additional_properties.items():
83
+ _dict[_key] = _value
84
+
85
+ # set to None if log_level (nullable) is None
86
+ # and model_fields_set contains the field
87
+ if self.log_level is None and "log_level" in self.model_fields_set:
88
+ _dict['logLevel'] = None
89
+
90
+ # set to None if resources (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if self.resources is None and "resources" in self.model_fields_set:
93
+ _dict['resources'] = None
94
+
95
+ return _dict
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99
+ """Create an instance of Operator from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return cls.model_validate(obj)
105
+
106
+ _obj = cls.model_validate({
107
+ "logLevel": obj.get("logLevel"),
108
+ "resources": ResourceRequirements.from_dict(obj["resources"]) if obj.get("resources") is not None else None
109
+ })
110
+ # store additional fields in additional_properties
111
+ for _key in obj.keys():
112
+ if _key not in cls.__properties:
113
+ _obj.additional_properties[_key] = obj.get(_key)
114
+
115
+ return _obj
116
+
117
+
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List
22
22
  from typing_extensions import Annotated
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 OrganizationGpuQuotaRequest(BaseModel):
27
28
  """
@@ -31,7 +32,8 @@ class OrganizationGpuQuotaRequest(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["gpu_quota"]
32
33
 
33
34
  model_config = ConfigDict(
34
- populate_by_name=True,
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
35
37
  validate_assignment=True,
36
38
  protected_namespaces=(),
37
39
  )
@@ -43,8 +45,7 @@ class OrganizationGpuQuotaRequest(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, StrictInt
21
21
  from typing import Any, ClassVar, Dict, List
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
26
  class OrganizationGpuQuotaResponse(BaseModel):
26
27
  """
@@ -32,7 +33,8 @@ class OrganizationGpuQuotaResponse(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["organization_id", "cluster_id", "gpu_quota"]
33
34
 
34
35
  model_config = ConfigDict(
35
- populate_by_name=True,
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
36
38
  validate_assignment=True,
37
39
  protected_namespaces=(),
38
40
  )
@@ -44,8 +46,7 @@ class OrganizationGpuQuotaResponse(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]: