hyperstack 1.25.0a0__py3-none-any.whl → 1.41.2a0__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.
- hyperstack/__init__.py +80 -131
- hyperstack/api/__init__.py +2 -0
- hyperstack/api/alive_api.py +240 -0
- hyperstack/api/api_key_api.py +16 -20
- hyperstack/api/assigning_member_role_api.py +15 -17
- hyperstack/api/auth_api.py +1050 -5
- hyperstack/api/beta_access_api.py +856 -0
- hyperstack/api/billing_api.py +6461 -673
- hyperstack/api/calculate_api.py +8 -9
- hyperstack/api/callbacks_api.py +120 -126
- hyperstack/api/cluster_events_api.py +1 -2
- hyperstack/api/clusters_api.py +2816 -199
- hyperstack/api/compliance_api.py +14 -18
- hyperstack/api/credit_api.py +17 -15
- hyperstack/api/customer_contract_api.py +30 -33
- hyperstack/api/dashboard_api.py +4 -5
- hyperstack/api/deployment_api.py +4 -8
- hyperstack/api/environment_api.py +285 -16
- hyperstack/api/firewall_attachment_api.py +11 -9
- hyperstack/api/firewalls_api.py +341 -347
- hyperstack/api/flavor_api.py +4 -5
- hyperstack/api/floating_ip_api.py +50 -49
- hyperstack/api/gpu_api.py +1 -2
- hyperstack/api/image_api.py +35 -39
- hyperstack/api/invite_api.py +288 -18
- hyperstack/api/keypair_api.py +22 -26
- hyperstack/api/organization_api.py +12 -15
- hyperstack/api/partner_config_api.py +564 -0
- hyperstack/api/payment_api.py +299 -18
- hyperstack/api/permission_api.py +4 -5
- hyperstack/api/policy_api.py +4 -5
- hyperstack/api/pricebook_api.py +14 -12
- hyperstack/api/profile_api.py +13 -17
- hyperstack/api/rbac_role_api.py +20 -25
- hyperstack/api/region_api.py +7 -8
- hyperstack/api/security_rules_api.py +1 -2
- hyperstack/api/snapshot_events_api.py +1 -2
- hyperstack/api/snapshots_api.py +166 -172
- hyperstack/api/stock_api.py +4 -5
- hyperstack/api/template_api.py +14 -19
- hyperstack/api/user_api.py +55 -49
- hyperstack/api/user_detail_choice_api.py +1 -2
- hyperstack/api/user_permission_api.py +8 -10
- hyperstack/api/virtual_machine_api.py +1529 -929
- hyperstack/api/virtual_machine_events_api.py +21 -22
- hyperstack/api/vnc_url_api.py +54 -50
- hyperstack/api/volume_api.py +340 -40
- hyperstack/api/volume_attachment_api.py +342 -42
- hyperstack/api_client.py +1 -1
- hyperstack/configuration.py +1 -11
- hyperstack/models/__init__.py +77 -130
- hyperstack/models/{environment_fieldsfor_volume.py → access_token_field.py} +7 -7
- hyperstack/models/attach_volume_fields.py +6 -2
- hyperstack/models/attach_volumes_payload.py +4 -2
- hyperstack/models/{virtual_machine_usage.py → attachments_fields_for_volume.py} +13 -11
- hyperstack/models/{flavor_vm_fields.py → attributes.py} +15 -18
- hyperstack/models/auth_get_token_response_model.py +4 -6
- hyperstack/models/{future_node_model.py → beta_access_request_fields.py} +27 -25
- hyperstack/models/{create_gpu.py → beta_access_request_payload.py} +9 -11
- hyperstack/models/{create_discount_response.py → beta_access_request_response_model.py} +11 -11
- hyperstack/models/{export_billing_data_request.py → beta_access_status_item.py} +20 -23
- hyperstack/models/{get_all_discount_for_all_organization_response.py → beta_access_status_response_model.py} +15 -15
- hyperstack/models/{exclude_billing_post_response.py → billing_history.py} +13 -11
- hyperstack/models/billing_history_data_synthesis_details.py +105 -0
- hyperstack/models/{vm_usage_response.py → billing_history_fine_tuning.py} +23 -19
- hyperstack/models/billing_history_model_evalutation_details.py +105 -0
- hyperstack/models/{get_all_discounts_fields.py → billing_history_serverless_inference.py} +23 -24
- hyperstack/models/billing_history_serverless_inference_details.py +105 -0
- hyperstack/models/{billingmetricesfields.py → billing_metrices_fields.py} +4 -4
- hyperstack/models/{billingmetricesresponse.py → billing_metrices_response.py} +7 -7
- hyperstack/models/cluster_fields.py +27 -9
- hyperstack/models/{add_update_flavor_organization_payload.py → cluster_flavor_fields.py} +28 -26
- hyperstack/models/{historical_instances_fields.py → cluster_node_fields.py} +24 -22
- hyperstack/models/{internal_instance_flavor_fields.py → cluster_node_group_fields.py} +17 -17
- hyperstack/models/{create_update_policy_response_model.py → cluster_node_groups_create_response.py} +21 -11
- hyperstack/models/{create_update_permission_response_model.py → cluster_node_groups_get_response.py} +11 -11
- hyperstack/models/{auth_request_login_response_model.py → cluster_node_groups_list_response.py} +15 -11
- hyperstack/models/{contract_eligible_instance_fields.py → cluster_node_instance_fields.py} +13 -11
- hyperstack/models/{image_logos.py → cluster_nodes_list_response.py} +14 -14
- hyperstack/models/{internal_environment_fields.py → cluster_version.py} +13 -9
- hyperstack/models/cluster_versions.py +10 -2
- hyperstack/models/{future_nodes_stock_model.py → colors.py} +17 -15
- hyperstack/models/contract_discount_plan_fields.py +3 -1
- hyperstack/models/contract_instance_fields.py +7 -1
- hyperstack/models/{future_node_response_model.py → create_cluster_node_fields.py} +23 -18
- hyperstack/models/{update_gpu.py → create_cluster_node_group_payload.py} +12 -11
- hyperstack/models/create_cluster_payload.py +31 -8
- hyperstack/models/create_environment.py +1 -1
- hyperstack/models/create_instances_payload.py +7 -7
- hyperstack/models/create_profile_payload.py +1 -1
- hyperstack/models/create_snapshot_payload.py +2 -4
- hyperstack/models/create_volume_payload.py +1 -1
- hyperstack/models/data_synthesis_billing_history_details_response_schema.py +95 -0
- hyperstack/models/{deployment_fieldsforstartdeployments.py → deployment_fields_for_start_deployments.py} +4 -4
- hyperstack/models/{editlabelofanexisting_vm_payload.py → edit_label_of_an_existing_vm_payload.py} +4 -4
- hyperstack/models/environment_features.py +14 -2
- hyperstack/models/{node_stocks_payload.py → environment_fields_for_volume.py} +10 -12
- hyperstack/models/flavor_fields.py +3 -1
- hyperstack/models/{customer_fields.py → flavor_label_fields.py} +7 -7
- hyperstack/models/{getcreditandthresholdinfo.py → get_credit_and_threshold_info.py} +4 -4
- hyperstack/models/{getcreditandthresholdinfoinresponse.py → get_credit_and_threshold_info_in_response.py} +7 -7
- hyperstack/models/{region_payload.py → get_instance_logs_response.py} +7 -9
- hyperstack/models/instance_fields.py +8 -4
- hyperstack/models/instance_flavor_fields.py +13 -1
- hyperstack/models/{flavor_response.py → keypair_environment_features.py} +20 -16
- hyperstack/models/{internal_instance_keypair_fields.py → keypair_environment_fields.py} +13 -11
- hyperstack/models/keypair_fields.py +6 -2
- hyperstack/models/{lastdaycostfields.py → last_day_cost_fields.py} +4 -4
- hyperstack/models/{lastdaycostresponse.py → last_day_cost_response.py} +7 -7
- hyperstack/models/{export_billing_data_response.py → logos.py} +13 -9
- hyperstack/models/{verify_api_key_response_model.py → manual_reconciliation_model.py} +13 -13
- hyperstack/models/{creditrequestresponse.py → master_flavors_response.py} +14 -14
- hyperstack/models/{customer_payload.py → mfa_status_fields.py} +8 -10
- hyperstack/models/{gpu.py → mfa_status_response.py} +11 -11
- hyperstack/models/model_evaluation_billing_history_details_response_schema.py +95 -0
- hyperstack/models/{organization_thresholdfields.py → organization_threshold_fields.py} +4 -4
- hyperstack/models/{organizationthresholdupdateresponse.py → organization_threshold_update_response.py} +7 -7
- hyperstack/models/{organizationthresholdsresponse.py → organization_thresholds_response.py} +7 -7
- hyperstack/models/{logo_get_response.py → pagination.py} +12 -12
- hyperstack/models/{billing_response.py → partner_config.py} +31 -20
- hyperstack/models/payment_details_fields.py +5 -1
- hyperstack/models/{logout_payload.py → primary_color.py} +10 -8
- hyperstack/models/region_fields.py +16 -2
- hyperstack/models/{vm_usage_request_payload.py → request_instance_logs_payload.py} +8 -8
- hyperstack/models/{stock_visibility_user_payload.py → request_instance_logs_response.py} +8 -8
- hyperstack/models/{contract_billing_history.py → resource_level_billing_bucket_details_resources.py} +10 -10
- hyperstack/models/{node_response_model.py → resource_level_billing_history_resources_cluster.py} +21 -11
- hyperstack/models/resource_level_billing_history_response_attributes.py +3 -1
- hyperstack/models/{get_all_contracts_response_model.py → resource_level_bucket_billing_details_response_model.py} +11 -15
- hyperstack/models/{contract_billing_history_response_model.py → resource_level_bucket_billing_history_response_model.py} +11 -11
- hyperstack/models/resource_level_cluster_billing_details_response_model.py +95 -0
- hyperstack/models/resource_level_cluster_billing_history_response_model.py +95 -0
- hyperstack/models/{get_discount_detail_response.py → resource_level_cluster_graph_billing_details_response_model.py} +11 -11
- hyperstack/models/{organization_object_response.py → resource_level_graph_billing_details_bucket.py} +18 -14
- hyperstack/models/{update_discounts_status_payload.py → secondary_color.py} +10 -8
- hyperstack/models/{security_rules_fieldsfor_instance.py → security_rules_fields_for_instance.py} +4 -4
- hyperstack/models/serverless_inferenced_billing_history_details_response_schema.py +95 -0
- hyperstack/models/snapshot_fields.py +6 -1
- hyperstack/models/snapshot_retrieve_fields.py +29 -2
- hyperstack/models/start_deployment.py +3 -3
- hyperstack/models/{subscribeorunsubscribeupdatepayload.py → subscribe_or_unsubscribe_update_payload.py} +4 -4
- hyperstack/models/token_based_billing_history_response.py +95 -0
- hyperstack/models/{update_keypairnameresponse.py → update_keypair_name_response.py} +4 -4
- hyperstack/models/update_volume_attachment_payload.py +87 -0
- hyperstack/models/{verify_api_key_payload.py → update_volume_payload.py} +7 -7
- hyperstack/models/{stock_visibility_user_list_response.py → update_volume_response.py} +14 -16
- hyperstack/models/{auth_request_login_fields.py → uris.py} +19 -9
- hyperstack/models/{userinfopostpayload.py → user_info_post_payload.py} +4 -4
- hyperstack/models/{node_stock_response_model.py → user_organizations_response.py} +14 -14
- hyperstack/models/users_info_fields.py +3 -1
- hyperstack/models/volume_attachment_fields.py +9 -5
- hyperstack/models/volume_fields.py +14 -4
- hyperstack/models/{volume_fieldsfor_instance.py → volume_fields_for_instance.py} +4 -4
- hyperstack/models/volumes.py +17 -11
- hyperstack/models/{instances_summary_fields.py → volumes_fields.py} +33 -29
- hyperstack/models/workload_billing_history_response.py +95 -0
- {hyperstack-1.25.0a0.dist-info → hyperstack-1.41.2a0.dist-info}/METADATA +2 -2
- hyperstack-1.41.2a0.dist-info/RECORD +350 -0
- {hyperstack-1.25.0a0.dist-info → hyperstack-1.41.2a0.dist-info}/WHEEL +1 -1
- hyperstack/models/api_key_verify_fields.py +0 -93
- hyperstack/models/billing_immune_resources_response.py +0 -95
- hyperstack/models/contract_billing_history_response_attributes.py +0 -99
- hyperstack/models/contract_change_payload.py +0 -101
- hyperstack/models/contract_eligible_instances_response.py +0 -101
- hyperstack/models/contract_event_create_model.py +0 -91
- hyperstack/models/contract_resource_payload.py +0 -95
- hyperstack/models/contractl_billing_history_response_metrics.py +0 -87
- hyperstack/models/create_contract_fields.py +0 -110
- hyperstack/models/create_contract_payload.py +0 -106
- hyperstack/models/create_discounts_payload.py +0 -112
- hyperstack/models/create_update_permission_payload.py +0 -93
- hyperstack/models/create_update_policy_payload.py +0 -93
- hyperstack/models/creditrechargelimitfield.py +0 -93
- hyperstack/models/creditrechargelimitresponse.py +0 -99
- hyperstack/models/creditrequests.py +0 -96
- hyperstack/models/data.py +0 -91
- hyperstack/models/discount_entity_model.py +0 -97
- hyperstack/models/discount_fields.py +0 -100
- hyperstack/models/discount_plan_fields.py +0 -108
- hyperstack/models/discount_resource_fields.py +0 -93
- hyperstack/models/discount_resource_payload.py +0 -93
- hyperstack/models/exclude_billing_post_payload.py +0 -91
- hyperstack/models/field_change.py +0 -91
- hyperstack/models/flavor_payload.py +0 -101
- hyperstack/models/flavor_vms_response.py +0 -99
- hyperstack/models/future_node_stock_model.py +0 -93
- hyperstack/models/future_node_update_model.py +0 -98
- hyperstack/models/get_all_contract_fields.py +0 -100
- hyperstack/models/get_discount_response.py +0 -99
- hyperstack/models/get_entity_discount_detail_response.py +0 -108
- hyperstack/models/get_token_payload.py +0 -89
- hyperstack/models/get_version_response.py +0 -91
- hyperstack/models/historical_instance.py +0 -101
- hyperstack/models/infrahub_resource_object_response.py +0 -119
- hyperstack/models/insert_discount_plan_fields.py +0 -112
- hyperstack/models/internal_instance_fields.py +0 -156
- hyperstack/models/internal_instance_image_fields.py +0 -95
- hyperstack/models/internal_instances_response.py +0 -99
- hyperstack/models/internal_security_rules_fields_for_instance.py +0 -104
- hyperstack/models/internal_volume_attachment_fields.py +0 -98
- hyperstack/models/internal_volume_fields.py +0 -95
- hyperstack/models/internal_volumes_response.py +0 -99
- hyperstack/models/new_stock_update_response_model.py +0 -89
- hyperstack/models/node_model.py +0 -114
- hyperstack/models/node_payload_model.py +0 -97
- hyperstack/models/node_power_usage_model.py +0 -120
- hyperstack/models/node_stock_payload_model.py +0 -95
- hyperstack/models/organizationcreditrechargelimitresponse.py +0 -95
- hyperstack/models/power_usage_model.py +0 -89
- hyperstack/models/pricebook_resource_object_response.py +0 -107
- hyperstack/models/refresh_token_payload.py +0 -89
- hyperstack/models/region_response.py +0 -95
- hyperstack/models/set_defaults_payload.py +0 -89
- hyperstack/models/single_visibility_user_response.py +0 -91
- hyperstack/models/success_response_model.py +0 -89
- hyperstack/models/token_fields.py +0 -91
- hyperstack/models/update_contract_payload.py +0 -104
- hyperstack/models/update_discounts_payload.py +0 -102
- hyperstack/models/user_transfer_payload.py +0 -89
- hyperstack/models/volume_status_change_fields.py +0 -96
- hyperstack/models/volumes_last_status_change_response.py +0 -99
- hyperstack/models/warning_mail_log_fields.py +0 -99
- hyperstack/models/warning_mail_log_response.py +0 -101
- hyperstack-1.25.0a0.dist-info/RECORD +0 -401
- {hyperstack-1.25.0a0.dist-info → hyperstack-1.41.2a0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Infrahub-API
|
|
5
|
+
|
|
6
|
+
Leverage the Infrahub API and Hyperstack platform to easily create, manage, and scale powerful GPU virtual machines and their associated resources. Access this SDK to automate the deployment of your workloads and streamline your infrastructure management. To contribute, please raise an issue with a bug report, feature request, feedback, or general inquiry.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from ..models.billing_history import BillingHistory
|
|
23
|
+
from ..models.pagination import Pagination
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class BillingHistoryModelEvalutationDetails(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
BillingHistoryModelEvalutationDetails
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
billing_history: Optional[List[BillingHistory]] = None
|
|
32
|
+
org_id: Optional[StrictInt] = None
|
|
33
|
+
pagination: Optional[Pagination] = None
|
|
34
|
+
total_count: Optional[StrictInt] = None
|
|
35
|
+
__properties: ClassVar[List[str]] = ["billing_history", "org_id", "pagination", "total_count"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=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
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of BillingHistoryModelEvalutationDetails 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
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
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 each item in billing_history (list)
|
|
77
|
+
_items = []
|
|
78
|
+
if self.billing_history:
|
|
79
|
+
for _item_billing_history in self.billing_history:
|
|
80
|
+
if _item_billing_history:
|
|
81
|
+
_items.append(_item_billing_history.to_dict())
|
|
82
|
+
_dict['billing_history'] = _items
|
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of pagination
|
|
84
|
+
if self.pagination:
|
|
85
|
+
_dict['pagination'] = self.pagination.to_dict()
|
|
86
|
+
return _dict
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
90
|
+
"""Create an instance of BillingHistoryModelEvalutationDetails from a dict"""
|
|
91
|
+
if obj is None:
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
if not isinstance(obj, dict):
|
|
95
|
+
return cls.model_validate(obj)
|
|
96
|
+
|
|
97
|
+
_obj = cls.model_validate({
|
|
98
|
+
"billing_history": [BillingHistory.from_dict(_item) for _item in obj["billing_history"]] if obj.get("billing_history") is not None else None,
|
|
99
|
+
"org_id": obj.get("org_id"),
|
|
100
|
+
"pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None,
|
|
101
|
+
"total_count": obj.get("total_count")
|
|
102
|
+
})
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -17,24 +17,22 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt
|
|
22
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
-
from ..models.
|
|
22
|
+
from ..models.billing_history import BillingHistory
|
|
23
|
+
from ..models.pagination import Pagination
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
26
|
|
|
27
|
-
class
|
|
27
|
+
class BillingHistoryServerlessInference(BaseModel):
|
|
28
28
|
"""
|
|
29
|
-
|
|
29
|
+
BillingHistoryServerlessInference
|
|
30
30
|
""" # noqa: E501
|
|
31
|
-
|
|
32
|
-
discount_status: Optional[StrictStr] = None
|
|
33
|
-
end_date: Optional[datetime] = None
|
|
31
|
+
billing_history: Optional[List[BillingHistory]] = None
|
|
34
32
|
org_id: Optional[StrictInt] = None
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
__properties: ClassVar[List[str]] = ["
|
|
33
|
+
pagination: Optional[Pagination] = None
|
|
34
|
+
total_count: Optional[StrictInt] = None
|
|
35
|
+
__properties: ClassVar[List[str]] = ["billing_history", "org_id", "pagination", "total_count"]
|
|
38
36
|
|
|
39
37
|
model_config = ConfigDict(
|
|
40
38
|
populate_by_name=True,
|
|
@@ -54,7 +52,7 @@ class GetAllDiscountsFields(BaseModel):
|
|
|
54
52
|
|
|
55
53
|
@classmethod
|
|
56
54
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
-
"""Create an instance of
|
|
55
|
+
"""Create an instance of BillingHistoryServerlessInference from a JSON string"""
|
|
58
56
|
return cls.from_dict(json.loads(json_str))
|
|
59
57
|
|
|
60
58
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -75,18 +73,21 @@ class GetAllDiscountsFields(BaseModel):
|
|
|
75
73
|
exclude=excluded_fields,
|
|
76
74
|
exclude_none=True,
|
|
77
75
|
)
|
|
78
|
-
# override the default output from pydantic by calling `to_dict()` of each item in
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of each item in billing_history (list)
|
|
79
77
|
_items = []
|
|
80
|
-
if self.
|
|
81
|
-
for
|
|
82
|
-
if
|
|
83
|
-
_items.append(
|
|
84
|
-
_dict['
|
|
78
|
+
if self.billing_history:
|
|
79
|
+
for _item_billing_history in self.billing_history:
|
|
80
|
+
if _item_billing_history:
|
|
81
|
+
_items.append(_item_billing_history.to_dict())
|
|
82
|
+
_dict['billing_history'] = _items
|
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of pagination
|
|
84
|
+
if self.pagination:
|
|
85
|
+
_dict['pagination'] = self.pagination.to_dict()
|
|
85
86
|
return _dict
|
|
86
87
|
|
|
87
88
|
@classmethod
|
|
88
89
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
-
"""Create an instance of
|
|
90
|
+
"""Create an instance of BillingHistoryServerlessInference from a dict"""
|
|
90
91
|
if obj is None:
|
|
91
92
|
return None
|
|
92
93
|
|
|
@@ -94,12 +95,10 @@ class GetAllDiscountsFields(BaseModel):
|
|
|
94
95
|
return cls.model_validate(obj)
|
|
95
96
|
|
|
96
97
|
_obj = cls.model_validate({
|
|
97
|
-
"
|
|
98
|
-
"discount_status": obj.get("discount_status"),
|
|
99
|
-
"end_date": obj.get("end_date"),
|
|
98
|
+
"billing_history": [BillingHistory.from_dict(_item) for _item in obj["billing_history"]] if obj.get("billing_history") is not None else None,
|
|
100
99
|
"org_id": obj.get("org_id"),
|
|
101
|
-
"
|
|
102
|
-
"
|
|
100
|
+
"pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None,
|
|
101
|
+
"total_count": obj.get("total_count")
|
|
103
102
|
})
|
|
104
103
|
return _obj
|
|
105
104
|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Infrahub-API
|
|
5
|
+
|
|
6
|
+
Leverage the Infrahub API and Hyperstack platform to easily create, manage, and scale powerful GPU virtual machines and their associated resources. Access this SDK to automate the deployment of your workloads and streamline your infrastructure management. To contribute, please raise an issue with a bug report, feature request, feedback, or general inquiry.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from ..models.billing_history import BillingHistory
|
|
23
|
+
from ..models.pagination import Pagination
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class BillingHistoryServerlessInferenceDetails(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
BillingHistoryServerlessInferenceDetails
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
billing_history: Optional[List[BillingHistory]] = None
|
|
32
|
+
org_id: Optional[StrictInt] = None
|
|
33
|
+
pagination: Optional[Pagination] = None
|
|
34
|
+
total_count: Optional[StrictInt] = None
|
|
35
|
+
__properties: ClassVar[List[str]] = ["billing_history", "org_id", "pagination", "total_count"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=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
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of BillingHistoryServerlessInferenceDetails 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
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
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 each item in billing_history (list)
|
|
77
|
+
_items = []
|
|
78
|
+
if self.billing_history:
|
|
79
|
+
for _item_billing_history in self.billing_history:
|
|
80
|
+
if _item_billing_history:
|
|
81
|
+
_items.append(_item_billing_history.to_dict())
|
|
82
|
+
_dict['billing_history'] = _items
|
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of pagination
|
|
84
|
+
if self.pagination:
|
|
85
|
+
_dict['pagination'] = self.pagination.to_dict()
|
|
86
|
+
return _dict
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
90
|
+
"""Create an instance of BillingHistoryServerlessInferenceDetails from a dict"""
|
|
91
|
+
if obj is None:
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
if not isinstance(obj, dict):
|
|
95
|
+
return cls.model_validate(obj)
|
|
96
|
+
|
|
97
|
+
_obj = cls.model_validate({
|
|
98
|
+
"billing_history": [BillingHistory.from_dict(_item) for _item in obj["billing_history"]] if obj.get("billing_history") is not None else None,
|
|
99
|
+
"org_id": obj.get("org_id"),
|
|
100
|
+
"pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None,
|
|
101
|
+
"total_count": obj.get("total_count")
|
|
102
|
+
})
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -23,9 +23,9 @@ from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class BillingMetricesFields(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
BillingMetricesFields
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
active: Optional[StrictBool] = None
|
|
31
31
|
bill_per_minute: Optional[Union[StrictFloat, StrictInt]] = None
|
|
@@ -58,7 +58,7 @@ class Billingmetricesfields(BaseModel):
|
|
|
58
58
|
|
|
59
59
|
@classmethod
|
|
60
60
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
-
"""Create an instance of
|
|
61
|
+
"""Create an instance of BillingMetricesFields from a JSON string"""
|
|
62
62
|
return cls.from_dict(json.loads(json_str))
|
|
63
63
|
|
|
64
64
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -83,7 +83,7 @@ class Billingmetricesfields(BaseModel):
|
|
|
83
83
|
|
|
84
84
|
@classmethod
|
|
85
85
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
-
"""Create an instance of
|
|
86
|
+
"""Create an instance of BillingMetricesFields from a dict"""
|
|
87
87
|
if obj is None:
|
|
88
88
|
return None
|
|
89
89
|
|
|
@@ -19,15 +19,15 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from ..models.
|
|
22
|
+
from ..models.billing_metrices_fields import BillingMetricesFields
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class BillingMetricesResponse(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
BillingMetricesResponse
|
|
29
29
|
""" # noqa: E501
|
|
30
|
-
data: Optional[List[
|
|
30
|
+
data: Optional[List[BillingMetricesFields]] = None
|
|
31
31
|
message: Optional[StrictStr] = None
|
|
32
32
|
status: Optional[StrictBool] = None
|
|
33
33
|
__properties: ClassVar[List[str]] = ["data", "message", "status"]
|
|
@@ -50,7 +50,7 @@ class Billingmetricesresponse(BaseModel):
|
|
|
50
50
|
|
|
51
51
|
@classmethod
|
|
52
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
-
"""Create an instance of
|
|
53
|
+
"""Create an instance of BillingMetricesResponse from a JSON string"""
|
|
54
54
|
return cls.from_dict(json.loads(json_str))
|
|
55
55
|
|
|
56
56
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -82,7 +82,7 @@ class Billingmetricesresponse(BaseModel):
|
|
|
82
82
|
|
|
83
83
|
@classmethod
|
|
84
84
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
-
"""Create an instance of
|
|
85
|
+
"""Create an instance of BillingMetricesResponse from a dict"""
|
|
86
86
|
if obj is None:
|
|
87
87
|
return None
|
|
88
88
|
|
|
@@ -90,7 +90,7 @@ class Billingmetricesresponse(BaseModel):
|
|
|
90
90
|
return cls.model_validate(obj)
|
|
91
91
|
|
|
92
92
|
_obj = cls.model_validate({
|
|
93
|
-
"data": [
|
|
93
|
+
"data": [BillingMetricesFields.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None,
|
|
94
94
|
"message": obj.get("message"),
|
|
95
95
|
"status": obj.get("status")
|
|
96
96
|
})
|
|
@@ -20,7 +20,9 @@ import json
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
-
from ..models.
|
|
23
|
+
from ..models.cluster_flavor_fields import ClusterFlavorFields
|
|
24
|
+
from ..models.cluster_node_fields import ClusterNodeFields
|
|
25
|
+
from ..models.cluster_node_group_fields import ClusterNodeGroupFields
|
|
24
26
|
from typing import Optional, Set
|
|
25
27
|
from typing_extensions import Self
|
|
26
28
|
|
|
@@ -35,12 +37,13 @@ class ClusterFields(BaseModel):
|
|
|
35
37
|
keypair_name: Optional[StrictStr] = None
|
|
36
38
|
kube_config: Optional[StrictStr] = None
|
|
37
39
|
kubernetes_version: Optional[StrictStr] = None
|
|
40
|
+
master_flavor: Optional[ClusterFlavorFields] = None
|
|
38
41
|
name: Optional[StrictStr] = None
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
node_groups: Optional[List[ClusterNodeGroupFields]] = None
|
|
43
|
+
nodes: Optional[List[ClusterNodeFields]] = None
|
|
41
44
|
status: Optional[StrictStr] = None
|
|
42
45
|
status_reason: Optional[StrictStr] = None
|
|
43
|
-
__properties: ClassVar[List[str]] = ["api_address", "created_at", "environment_name", "id", "keypair_name", "kube_config", "kubernetes_version", "name", "
|
|
46
|
+
__properties: ClassVar[List[str]] = ["api_address", "created_at", "environment_name", "id", "keypair_name", "kube_config", "kubernetes_version", "master_flavor", "name", "node_groups", "nodes", "status", "status_reason"]
|
|
44
47
|
|
|
45
48
|
model_config = ConfigDict(
|
|
46
49
|
populate_by_name=True,
|
|
@@ -81,9 +84,23 @@ class ClusterFields(BaseModel):
|
|
|
81
84
|
exclude=excluded_fields,
|
|
82
85
|
exclude_none=True,
|
|
83
86
|
)
|
|
84
|
-
# override the default output from pydantic by calling `to_dict()` of
|
|
85
|
-
if self.
|
|
86
|
-
_dict['
|
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of master_flavor
|
|
88
|
+
if self.master_flavor:
|
|
89
|
+
_dict['master_flavor'] = self.master_flavor.to_dict()
|
|
90
|
+
# override the default output from pydantic by calling `to_dict()` of each item in node_groups (list)
|
|
91
|
+
_items = []
|
|
92
|
+
if self.node_groups:
|
|
93
|
+
for _item_node_groups in self.node_groups:
|
|
94
|
+
if _item_node_groups:
|
|
95
|
+
_items.append(_item_node_groups.to_dict())
|
|
96
|
+
_dict['node_groups'] = _items
|
|
97
|
+
# override the default output from pydantic by calling `to_dict()` of each item in nodes (list)
|
|
98
|
+
_items = []
|
|
99
|
+
if self.nodes:
|
|
100
|
+
for _item_nodes in self.nodes:
|
|
101
|
+
if _item_nodes:
|
|
102
|
+
_items.append(_item_nodes.to_dict())
|
|
103
|
+
_dict['nodes'] = _items
|
|
87
104
|
return _dict
|
|
88
105
|
|
|
89
106
|
@classmethod
|
|
@@ -103,9 +120,10 @@ class ClusterFields(BaseModel):
|
|
|
103
120
|
"keypair_name": obj.get("keypair_name"),
|
|
104
121
|
"kube_config": obj.get("kube_config"),
|
|
105
122
|
"kubernetes_version": obj.get("kubernetes_version"),
|
|
123
|
+
"master_flavor": ClusterFlavorFields.from_dict(obj["master_flavor"]) if obj.get("master_flavor") is not None else None,
|
|
106
124
|
"name": obj.get("name"),
|
|
107
|
-
"
|
|
108
|
-
"
|
|
125
|
+
"node_groups": [ClusterNodeGroupFields.from_dict(_item) for _item in obj["node_groups"]] if obj.get("node_groups") is not None else None,
|
|
126
|
+
"nodes": [ClusterNodeFields.from_dict(_item) for _item in obj["nodes"]] if obj.get("nodes") is not None else None,
|
|
109
127
|
"status": obj.get("status"),
|
|
110
128
|
"status_reason": obj.get("status_reason")
|
|
111
129
|
})
|
|
@@ -17,29 +17,27 @@ 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, StrictFloat, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
+
from ..models.lable_resonse import LableResonse
|
|
22
23
|
from typing import Optional, Set
|
|
23
24
|
from typing_extensions import Self
|
|
24
25
|
|
|
25
|
-
class
|
|
26
|
+
class ClusterFlavorFields(BaseModel):
|
|
26
27
|
"""
|
|
27
|
-
|
|
28
|
+
ClusterFlavorFields
|
|
28
29
|
""" # noqa: E501
|
|
29
|
-
cpu: StrictInt
|
|
30
|
-
|
|
31
|
-
disk: StrictInt
|
|
30
|
+
cpu: Optional[StrictInt] = None
|
|
31
|
+
disk: Optional[StrictInt] = None
|
|
32
32
|
ephemeral: Optional[StrictInt] = None
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
region_id: StrictInt
|
|
42
|
-
__properties: ClassVar[List[str]] = ["cpu", "description", "disk", "ephemeral", "gpu_count", "gpu_id", "is_public", "labels", "name", "openstack_id", "organizations", "ram", "region_id"]
|
|
33
|
+
features: Optional[Dict[str, Any]] = None
|
|
34
|
+
gpu: Optional[StrictStr] = None
|
|
35
|
+
gpu_count: Optional[StrictInt] = None
|
|
36
|
+
id: Optional[StrictInt] = None
|
|
37
|
+
labels: Optional[List[LableResonse]] = None
|
|
38
|
+
name: Optional[StrictStr] = None
|
|
39
|
+
ram: Optional[Union[StrictFloat, StrictInt]] = None
|
|
40
|
+
__properties: ClassVar[List[str]] = ["cpu", "disk", "ephemeral", "features", "gpu", "gpu_count", "id", "labels", "name", "ram"]
|
|
43
41
|
|
|
44
42
|
model_config = ConfigDict(
|
|
45
43
|
populate_by_name=True,
|
|
@@ -59,7 +57,7 @@ class AddUpdateFlavorOrganizationPayload(BaseModel):
|
|
|
59
57
|
|
|
60
58
|
@classmethod
|
|
61
59
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
62
|
-
"""Create an instance of
|
|
60
|
+
"""Create an instance of ClusterFlavorFields from a JSON string"""
|
|
63
61
|
return cls.from_dict(json.loads(json_str))
|
|
64
62
|
|
|
65
63
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -80,11 +78,18 @@ class AddUpdateFlavorOrganizationPayload(BaseModel):
|
|
|
80
78
|
exclude=excluded_fields,
|
|
81
79
|
exclude_none=True,
|
|
82
80
|
)
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of each item in labels (list)
|
|
82
|
+
_items = []
|
|
83
|
+
if self.labels:
|
|
84
|
+
for _item_labels in self.labels:
|
|
85
|
+
if _item_labels:
|
|
86
|
+
_items.append(_item_labels.to_dict())
|
|
87
|
+
_dict['labels'] = _items
|
|
83
88
|
return _dict
|
|
84
89
|
|
|
85
90
|
@classmethod
|
|
86
91
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
87
|
-
"""Create an instance of
|
|
92
|
+
"""Create an instance of ClusterFlavorFields from a dict"""
|
|
88
93
|
if obj is None:
|
|
89
94
|
return None
|
|
90
95
|
|
|
@@ -93,18 +98,15 @@ class AddUpdateFlavorOrganizationPayload(BaseModel):
|
|
|
93
98
|
|
|
94
99
|
_obj = cls.model_validate({
|
|
95
100
|
"cpu": obj.get("cpu"),
|
|
96
|
-
"description": obj.get("description"),
|
|
97
101
|
"disk": obj.get("disk"),
|
|
98
102
|
"ephemeral": obj.get("ephemeral"),
|
|
103
|
+
"features": obj.get("features"),
|
|
104
|
+
"gpu": obj.get("gpu"),
|
|
99
105
|
"gpu_count": obj.get("gpu_count"),
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"labels": obj.get("labels"),
|
|
106
|
+
"id": obj.get("id"),
|
|
107
|
+
"labels": [LableResonse.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None,
|
|
103
108
|
"name": obj.get("name"),
|
|
104
|
-
"
|
|
105
|
-
"organizations": obj.get("organizations"),
|
|
106
|
-
"ram": obj.get("ram"),
|
|
107
|
-
"region_id": obj.get("region_id")
|
|
109
|
+
"ram": obj.get("ram")
|
|
108
110
|
})
|
|
109
111
|
return _obj
|
|
110
112
|
|
|
@@ -18,28 +18,28 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from ..models.cluster_node_instance_fields import ClusterNodeInstanceFields
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
26
|
-
class
|
|
27
|
+
class ClusterNodeFields(BaseModel):
|
|
27
28
|
"""
|
|
28
|
-
|
|
29
|
+
ClusterNodeFields
|
|
29
30
|
""" # noqa: E501
|
|
30
31
|
created_at: Optional[datetime] = None
|
|
31
|
-
environment: Optional[StrictStr] = None
|
|
32
|
-
environment_id: Optional[StrictInt] = None
|
|
33
|
-
flavor: Optional[StrictStr] = None
|
|
34
|
-
flavor_id: Optional[StrictInt] = None
|
|
35
|
-
floating_ip: Optional[StrictStr] = None
|
|
36
|
-
host: Optional[StrictStr] = None
|
|
37
32
|
id: Optional[StrictInt] = None
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
instance: Optional[ClusterNodeInstanceFields] = None
|
|
34
|
+
is_bastion: Optional[StrictBool] = None
|
|
35
|
+
node_group_id: Optional[StrictInt] = None
|
|
36
|
+
node_group_name: Optional[StrictStr] = None
|
|
37
|
+
requires_public_ip: Optional[StrictBool] = None
|
|
38
|
+
role: Optional[StrictStr] = None
|
|
40
39
|
status: Optional[StrictStr] = None
|
|
40
|
+
status_reason: Optional[StrictStr] = None
|
|
41
41
|
updated_at: Optional[datetime] = None
|
|
42
|
-
__properties: ClassVar[List[str]] = ["created_at", "
|
|
42
|
+
__properties: ClassVar[List[str]] = ["created_at", "id", "instance", "is_bastion", "node_group_id", "node_group_name", "requires_public_ip", "role", "status", "status_reason", "updated_at"]
|
|
43
43
|
|
|
44
44
|
model_config = ConfigDict(
|
|
45
45
|
populate_by_name=True,
|
|
@@ -59,7 +59,7 @@ class HistoricalInstancesFields(BaseModel):
|
|
|
59
59
|
|
|
60
60
|
@classmethod
|
|
61
61
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
62
|
-
"""Create an instance of
|
|
62
|
+
"""Create an instance of ClusterNodeFields from a JSON string"""
|
|
63
63
|
return cls.from_dict(json.loads(json_str))
|
|
64
64
|
|
|
65
65
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -80,11 +80,14 @@ class HistoricalInstancesFields(BaseModel):
|
|
|
80
80
|
exclude=excluded_fields,
|
|
81
81
|
exclude_none=True,
|
|
82
82
|
)
|
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of instance
|
|
84
|
+
if self.instance:
|
|
85
|
+
_dict['instance'] = self.instance.to_dict()
|
|
83
86
|
return _dict
|
|
84
87
|
|
|
85
88
|
@classmethod
|
|
86
89
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
87
|
-
"""Create an instance of
|
|
90
|
+
"""Create an instance of ClusterNodeFields from a dict"""
|
|
88
91
|
if obj is None:
|
|
89
92
|
return None
|
|
90
93
|
|
|
@@ -93,16 +96,15 @@ class HistoricalInstancesFields(BaseModel):
|
|
|
93
96
|
|
|
94
97
|
_obj = cls.model_validate({
|
|
95
98
|
"created_at": obj.get("created_at"),
|
|
96
|
-
"environment": obj.get("environment"),
|
|
97
|
-
"environment_id": obj.get("environment_id"),
|
|
98
|
-
"flavor": obj.get("flavor"),
|
|
99
|
-
"flavor_id": obj.get("flavor_id"),
|
|
100
|
-
"floating_ip": obj.get("floating_ip"),
|
|
101
|
-
"host": obj.get("host"),
|
|
102
99
|
"id": obj.get("id"),
|
|
103
|
-
"
|
|
104
|
-
"
|
|
100
|
+
"instance": ClusterNodeInstanceFields.from_dict(obj["instance"]) if obj.get("instance") is not None else None,
|
|
101
|
+
"is_bastion": obj.get("is_bastion"),
|
|
102
|
+
"node_group_id": obj.get("node_group_id"),
|
|
103
|
+
"node_group_name": obj.get("node_group_name"),
|
|
104
|
+
"requires_public_ip": obj.get("requires_public_ip"),
|
|
105
|
+
"role": obj.get("role"),
|
|
105
106
|
"status": obj.get("status"),
|
|
107
|
+
"status_reason": obj.get("status_reason"),
|
|
106
108
|
"updated_at": obj.get("updated_at")
|
|
107
109
|
})
|
|
108
110
|
return _obj
|