baiducloud-python-sdk-cce 0.0.1__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 (74) hide show
  1. baiducloud_python_sdk_cce/__init__.py +5 -0
  2. baiducloud_python_sdk_cce/api/__init__.py +0 -0
  3. baiducloud_python_sdk_cce/api/cce_client.py +931 -0
  4. baiducloud_python_sdk_cce/models/__init__.py +77 -0
  5. baiducloud_python_sdk_cce/models/autoscaler.py +76 -0
  6. baiducloud_python_sdk_cce/models/ca_config.py +151 -0
  7. baiducloud_python_sdk_cce/models/cluster_autoscaler_spec.py +82 -0
  8. baiducloud_python_sdk_cce/models/create_a_shrinking_node_group_task_v2_request.py +105 -0
  9. baiducloud_python_sdk_cce/models/create_a_shrinking_node_group_task_v2_response.py +70 -0
  10. baiducloud_python_sdk_cce/models/create_an_autoscaler_v2_request.py +58 -0
  11. baiducloud_python_sdk_cce/models/create_an_autoscaler_v2_response.py +62 -0
  12. baiducloud_python_sdk_cce/models/create_expansion_node_group_task_v2_request.py +76 -0
  13. baiducloud_python_sdk_cce/models/create_expansion_node_group_task_v2_response.py +69 -0
  14. baiducloud_python_sdk_cce/models/create_node_group_v2_request.py +135 -0
  15. baiducloud_python_sdk_cce/models/create_node_group_v2_response.py +69 -0
  16. baiducloud_python_sdk_cce/models/create_nodes_cluster_expansion_v2_request.py +67 -0
  17. baiducloud_python_sdk_cce/models/create_nodes_cluster_expansion_v2_response.py +69 -0
  18. baiducloud_python_sdk_cce/models/delete_node_group_v2_request.py +76 -0
  19. baiducloud_python_sdk_cce/models/delete_node_group_v2_response.py +62 -0
  20. baiducloud_python_sdk_cce/models/delete_nodes_cluster_scaling_v2_request.py +83 -0
  21. baiducloud_python_sdk_cce/models/delete_nodes_cluster_scaling_v2_response.py +61 -0
  22. baiducloud_python_sdk_cce/models/delete_option.py +74 -0
  23. baiducloud_python_sdk_cce/models/existed_instance_in_cluster.py +58 -0
  24. baiducloud_python_sdk_cce/models/get_node_details_v2_request.py +64 -0
  25. baiducloud_python_sdk_cce/models/get_node_details_v2_response.py +70 -0
  26. baiducloud_python_sdk_cce/models/get_node_group_details_v2_request.py +64 -0
  27. baiducloud_python_sdk_cce/models/get_node_group_details_v2_response.py +70 -0
  28. baiducloud_python_sdk_cce/models/get_package_list_v2_request.py +66 -0
  29. baiducloud_python_sdk_cce/models/get_package_list_v2_response.py +62 -0
  30. baiducloud_python_sdk_cce/models/get_task_list_v2_request.py +110 -0
  31. baiducloud_python_sdk_cce/models/get_task_list_v2_response.py +70 -0
  32. baiducloud_python_sdk_cce/models/get_the_list_of_cluster_node_groups_v2_request.py +103 -0
  33. baiducloud_python_sdk_cce/models/get_the_list_of_cluster_node_groups_v2_response.py +70 -0
  34. baiducloud_python_sdk_cce/models/get_the_list_of_cluster_nodes_v2_request.py +96 -0
  35. baiducloud_python_sdk_cce/models/get_the_list_of_cluster_nodes_v2_response.py +70 -0
  36. baiducloud_python_sdk_cce/models/instance.py +82 -0
  37. baiducloud_python_sdk_cce/models/instance_group.py +74 -0
  38. baiducloud_python_sdk_cce/models/instance_page.py +133 -0
  39. baiducloud_python_sdk_cce/models/instance_set.py +66 -0
  40. baiducloud_python_sdk_cce/models/instance_template.py +268 -0
  41. baiducloud_python_sdk_cce/models/list_instance_group_page.py +82 -0
  42. baiducloud_python_sdk_cce/models/list_instances_by_instance_group_id_page.py +82 -0
  43. baiducloud_python_sdk_cce/models/list_task_page.py +82 -0
  44. baiducloud_python_sdk_cce/models/machine_spec_status.py +66 -0
  45. baiducloud_python_sdk_cce/models/modify_ig_auto_scaler_request.py +98 -0
  46. baiducloud_python_sdk_cce/models/modify_ig_auto_scaler_response.py +61 -0
  47. baiducloud_python_sdk_cce/models/modify_node_group_node_shrink_protection_status_v2_request.py +74 -0
  48. baiducloud_python_sdk_cce/models/modify_node_group_node_shrink_protection_status_v2_response.py +69 -0
  49. baiducloud_python_sdk_cce/models/modify_the_number_of_node_replicas_in_a_node_group_v2_request.py +99 -0
  50. baiducloud_python_sdk_cce/models/modify_the_number_of_node_replicas_in_a_node_group_v2_response.py +62 -0
  51. baiducloud_python_sdk_cce/models/move_into_an_existing_node_v2_request.py +126 -0
  52. baiducloud_python_sdk_cce/models/move_into_an_existing_node_v2_response.py +69 -0
  53. baiducloud_python_sdk_cce/models/query_the_configuration_of_autoscaler_v2_request.py +58 -0
  54. baiducloud_python_sdk_cce/models/query_the_configuration_of_autoscaler_v2_response.py +70 -0
  55. baiducloud_python_sdk_cce/models/retrieve_the_node_group_node_list_v2_request.py +76 -0
  56. baiducloud_python_sdk_cce/models/retrieve_the_node_group_node_list_v2_response.py +72 -0
  57. baiducloud_python_sdk_cce/models/step.py +124 -0
  58. baiducloud_python_sdk_cce/models/steps_to_obtain_node_events_v2_request.py +58 -0
  59. baiducloud_python_sdk_cce/models/steps_to_obtain_node_events_v2_response.py +78 -0
  60. baiducloud_python_sdk_cce/models/synchronize_node_metadata_v2_request.py +58 -0
  61. baiducloud_python_sdk_cce/models/synchronize_node_metadata_v2_response.py +69 -0
  62. baiducloud_python_sdk_cce/models/taint.py +74 -0
  63. baiducloud_python_sdk_cce/models/task.py +108 -0
  64. baiducloud_python_sdk_cce/models/update_autoscaler_configuration_v2_request.py +169 -0
  65. baiducloud_python_sdk_cce/models/update_autoscaler_configuration_v2_response.py +61 -0
  66. baiducloud_python_sdk_cce/models/update_node_attributes_v2_request.py +97 -0
  67. baiducloud_python_sdk_cce/models/update_node_attributes_v2_response.py +72 -0
  68. baiducloud_python_sdk_cce/models/view_task_details_v2_request.py +64 -0
  69. baiducloud_python_sdk_cce/models/view_task_details_v2_response.py +70 -0
  70. baiducloud_python_sdk_cce-0.0.1.dist-info/LICENSE +177 -0
  71. baiducloud_python_sdk_cce-0.0.1.dist-info/METADATA +76 -0
  72. baiducloud_python_sdk_cce-0.0.1.dist-info/RECORD +74 -0
  73. baiducloud_python_sdk_cce-0.0.1.dist-info/WHEEL +5 -0
  74. baiducloud_python_sdk_cce-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,77 @@
1
+ """
2
+ Models for cce SDK.
3
+ """
4
+
5
+ from .autoscaler import Autoscaler
6
+ from .ca_config import CAConfig
7
+ from .cluster_autoscaler_spec import ClusterAutoscalerSpec
8
+ from .create_a_shrinking_node_group_task_v2_request import CreateAShrinkingNodeGroupTaskV2Request
9
+ from .create_a_shrinking_node_group_task_v2_response import CreateAShrinkingNodeGroupTaskV2Response
10
+ from .create_an_autoscaler_v2_response import CreateAnAutoscalerV2Response
11
+ from .create_expansion_node_group_task_v2_response import CreateExpansionNodeGroupTaskV2Response
12
+ from .create_node_group_v2_request import CreateNodeGroupV2Request
13
+ from .create_node_group_v2_response import CreateNodeGroupV2Response
14
+ from .create_nodes_cluster_expansion_v2_request import CreateNodesClusterExpansionV2Request
15
+ from .create_nodes_cluster_expansion_v2_response import CreateNodesClusterExpansionV2Response
16
+ from .delete_node_group_v2_response import DeleteNodeGroupV2Response
17
+ from .delete_nodes_cluster_scaling_v2_request import DeleteNodesClusterScalingV2Request
18
+ from .delete_nodes_cluster_scaling_v2_response import DeleteNodesClusterScalingV2Response
19
+ from .delete_option import DeleteOption
20
+ from .existed_instance_in_cluster import ExistedInstanceInCluster
21
+ from .get_node_details_v2_response import GetNodeDetailsV2Response
22
+ from .get_node_group_details_v2_response import GetNodeGroupDetailsV2Response
23
+ from .get_package_list_v2_request import GetPackageListV2Request
24
+ from .get_package_list_v2_response import GetPackageListV2Response
25
+ from .get_task_list_v2_response import GetTaskListV2Response
26
+ from .get_the_list_of_cluster_node_groups_v2_response import GetTheListOfClusterNodeGroupsV2Response
27
+ from .get_the_list_of_cluster_nodes_v2_response import GetTheListOfClusterNodesV2Response
28
+ from .instance import Instance
29
+ from .instance_group import InstanceGroup
30
+ from .instance_page import InstancePage
31
+ from .instance_set import InstanceSet
32
+ from .instance_template import InstanceTemplate
33
+ from .list_instance_group_page import ListInstanceGroupPage
34
+ from .list_instances_by_instance_group_id_page import ListInstancesByInstanceGroupIDPage
35
+ from .list_task_page import ListTaskPage
36
+ from .machine_spec_status import MachineSpecStatus
37
+ from .modify_ig_auto_scaler_request import ModifyIGAutoScalerRequest
38
+ from .modify_ig_auto_scaler_response import ModifyIGAutoScalerResponse
39
+ from .modify_node_group_node_shrink_protection_status_v2_request import (
40
+ ModifyNodeGroupNodeShrinkProtectionStatusV2Request,
41
+ )
42
+ from .modify_node_group_node_shrink_protection_status_v2_response import (
43
+ ModifyNodeGroupNodeShrinkProtectionStatusV2Response,
44
+ )
45
+ from .modify_the_number_of_node_replicas_in_a_node_group_v2_request import (
46
+ ModifyTheNumberOfNodeReplicasInANodeGroupV2Request,
47
+ )
48
+ from .modify_the_number_of_node_replicas_in_a_node_group_v2_response import (
49
+ ModifyTheNumberOfNodeReplicasInANodeGroupV2Response,
50
+ )
51
+ from .move_into_an_existing_node_v2_request import MoveIntoAnExistingNodeV2Request
52
+ from .move_into_an_existing_node_v2_response import MoveIntoAnExistingNodeV2Response
53
+ from .query_the_configuration_of_autoscaler_v2_response import QueryTheConfigurationOfAutoscalerV2Response
54
+ from .retrieve_the_node_group_node_list_v2_response import RetrieveTheNodeGroupNodeListV2Response
55
+ from .step import Step
56
+ from .steps_to_obtain_node_events_v2_response import StepsToObtainNodeEventsV2Response
57
+ from .synchronize_node_metadata_v2_response import SynchronizeNodeMetadataV2Response
58
+ from .taint import Taint
59
+ from .task import Task
60
+ from .update_autoscaler_configuration_v2_request import UpdateAutoscalerConfigurationV2Request
61
+ from .update_autoscaler_configuration_v2_response import UpdateAutoscalerConfigurationV2Response
62
+ from .update_node_attributes_v2_request import UpdateNodeAttributesV2Request
63
+ from .update_node_attributes_v2_response import UpdateNodeAttributesV2Response
64
+ from .view_task_details_v2_response import ViewTaskDetailsV2Response
65
+ from .steps_to_obtain_node_events_v2_request import StepsToObtainNodeEventsV2Request
66
+ from .get_the_list_of_cluster_node_groups_v2_request import GetTheListOfClusterNodeGroupsV2Request
67
+ from .get_node_group_details_v2_request import GetNodeGroupDetailsV2Request
68
+ from .delete_node_group_v2_request import DeleteNodeGroupV2Request
69
+ from .view_task_details_v2_request import ViewTaskDetailsV2Request
70
+ from .create_expansion_node_group_task_v2_request import CreateExpansionNodeGroupTaskV2Request
71
+ from .query_the_configuration_of_autoscaler_v2_request import QueryTheConfigurationOfAutoscalerV2Request
72
+ from .create_an_autoscaler_v2_request import CreateAnAutoscalerV2Request
73
+ from .get_the_list_of_cluster_nodes_v2_request import GetTheListOfClusterNodesV2Request
74
+ from .get_task_list_v2_request import GetTaskListV2Request
75
+ from .get_node_details_v2_request import GetNodeDetailsV2Request
76
+ from .synchronize_node_metadata_v2_request import SynchronizeNodeMetadataV2Request
77
+ from .retrieve_the_node_group_node_list_v2_request import RetrieveTheNodeGroupNodeListV2Request
@@ -0,0 +1,76 @@
1
+ """
2
+ Autoscaler information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+ from baiducloud_python_sdk_cce.models.ca_config import CAConfig
8
+
9
+
10
+ class Autoscaler(AbstractModel):
11
+ """
12
+ Autoscaler
13
+ """
14
+
15
+ def __init__(self, cluster_id=None, cluster_name=None, ca_config=None):
16
+ """
17
+ Initialize Autoscaler instance.
18
+
19
+ :param cluster_id: 集群 ID
20
+ :type cluster_id: str (optional)
21
+
22
+ :param cluster_name: 集群名称
23
+ :type cluster_name: str (optional)
24
+
25
+ :param ca_config: ca_config attribute
26
+ :type ca_config: CAConfig (optional)
27
+ """
28
+ super().__init__()
29
+ self.cluster_id = cluster_id
30
+ self.cluster_name = cluster_name
31
+ self.ca_config = ca_config
32
+
33
+ def to_dict(self):
34
+ """
35
+ Convert the model instance to a dictionary representation.
36
+
37
+ Nested model objects are recursively converted to dictionaries.
38
+
39
+ :return: Dictionary representation of the model
40
+ :rtype: dict
41
+ """
42
+ _map = super().to_dict()
43
+ if _map is not None:
44
+ return _map
45
+ result = dict()
46
+ if self.cluster_id is not None:
47
+ result['clusterID'] = self.cluster_id
48
+ if self.cluster_name is not None:
49
+ result['clusterName'] = self.cluster_name
50
+ if self.ca_config is not None:
51
+ result['caConfig'] = self.ca_config.to_dict()
52
+ return result
53
+
54
+ def from_dict(self, m):
55
+ """
56
+ Populate the model instance from a dictionary.
57
+
58
+ Nested dictionaries are recursively converted to model objects.
59
+
60
+ :param m: Dictionary containing model data
61
+ :type m: dict
62
+
63
+ :return: Self reference for method chaining
64
+ :rtype: Autoscaler
65
+
66
+ :raises TypeError: If input is not a dictionary type
67
+ :raises ValueError: If nested model conversion fails
68
+ """
69
+ m = m or dict()
70
+ if m.get('clusterID') is not None:
71
+ self.cluster_id = m.get('clusterID')
72
+ if m.get('clusterName') is not None:
73
+ self.cluster_name = m.get('clusterName')
74
+ if m.get('caConfig') is not None:
75
+ self.ca_config = CAConfig().from_dict(m.get('caConfig'))
76
+ return self
@@ -0,0 +1,151 @@
1
+ """
2
+ CAConfig information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class CAConfig(AbstractModel):
9
+ """
10
+ CAConfig
11
+ """
12
+
13
+ def __init__(
14
+ self,
15
+ replica_count=None,
16
+ scale_down_enabled=None,
17
+ scale_down_utilization_threshold=None,
18
+ scale_down_gpu_utilization_threshold=None,
19
+ scale_down_unneeded_time=None,
20
+ scale_down_delay_after_add=None,
21
+ max_empty_bulk_delete=None,
22
+ skip_nodes_with_local_storage=None,
23
+ skip_nodes_with_system_pods=None,
24
+ expander=None,
25
+ custom_configs=None,
26
+ ):
27
+ """
28
+ Initialize CAConfig instance.
29
+
30
+ :param replica_count:
31
+ :type replica_count: int (optional)
32
+
33
+ :param scale_down_enabled:
34
+ :type scale_down_enabled: bool (optional)
35
+
36
+ :param scale_down_utilization_threshold:
37
+ :type scale_down_utilization_threshold: int (optional)
38
+
39
+ :param scale_down_gpu_utilization_threshold:
40
+ :type scale_down_gpu_utilization_threshold: int (optional)
41
+
42
+ :param scale_down_unneeded_time:
43
+ :type scale_down_unneeded_time: int (optional)
44
+
45
+ :param scale_down_delay_after_add:
46
+ :type scale_down_delay_after_add: int (optional)
47
+
48
+ :param max_empty_bulk_delete:
49
+ :type max_empty_bulk_delete: int (optional)
50
+
51
+ :param skip_nodes_with_local_storage:
52
+ :type skip_nodes_with_local_storage: bool (optional)
53
+
54
+ :param skip_nodes_with_system_pods:
55
+ :type skip_nodes_with_system_pods: bool (optional)
56
+
57
+ :param expander:
58
+ :type expander: str (optional)
59
+
60
+ :param custom_configs:
61
+ :type custom_configs: Dict[str, str] (optional)
62
+ """
63
+ super().__init__()
64
+ self.replica_count = replica_count
65
+ self.scale_down_enabled = scale_down_enabled
66
+ self.scale_down_utilization_threshold = scale_down_utilization_threshold
67
+ self.scale_down_gpu_utilization_threshold = scale_down_gpu_utilization_threshold
68
+ self.scale_down_unneeded_time = scale_down_unneeded_time
69
+ self.scale_down_delay_after_add = scale_down_delay_after_add
70
+ self.max_empty_bulk_delete = max_empty_bulk_delete
71
+ self.skip_nodes_with_local_storage = skip_nodes_with_local_storage
72
+ self.skip_nodes_with_system_pods = skip_nodes_with_system_pods
73
+ self.expander = expander
74
+ self.custom_configs = custom_configs
75
+
76
+ def to_dict(self):
77
+ """
78
+ Convert the model instance to a dictionary representation.
79
+
80
+ Nested model objects are recursively converted to dictionaries.
81
+
82
+ :return: Dictionary representation of the model
83
+ :rtype: dict
84
+ """
85
+ _map = super().to_dict()
86
+ if _map is not None:
87
+ return _map
88
+ result = dict()
89
+ if self.replica_count is not None:
90
+ result['replicaCount'] = self.replica_count
91
+ if self.scale_down_enabled is not None:
92
+ result['scaleDownEnabled'] = self.scale_down_enabled
93
+ if self.scale_down_utilization_threshold is not None:
94
+ result['scaleDownUtilizationThreshold'] = self.scale_down_utilization_threshold
95
+ if self.scale_down_gpu_utilization_threshold is not None:
96
+ result['scaleDownGPUUtilizationThreshold'] = self.scale_down_gpu_utilization_threshold
97
+ if self.scale_down_unneeded_time is not None:
98
+ result['scaleDownUnneededTime'] = self.scale_down_unneeded_time
99
+ if self.scale_down_delay_after_add is not None:
100
+ result['scaleDownDelayAfterAdd'] = self.scale_down_delay_after_add
101
+ if self.max_empty_bulk_delete is not None:
102
+ result['maxEmptyBulkDelete'] = self.max_empty_bulk_delete
103
+ if self.skip_nodes_with_local_storage is not None:
104
+ result['skipNodesWithLocalStorage'] = self.skip_nodes_with_local_storage
105
+ if self.skip_nodes_with_system_pods is not None:
106
+ result['skipNodesWithSystemPods'] = self.skip_nodes_with_system_pods
107
+ if self.expander is not None:
108
+ result['expander'] = self.expander
109
+ if self.custom_configs is not None:
110
+ result['customConfigs'] = self.custom_configs
111
+ return result
112
+
113
+ def from_dict(self, m):
114
+ """
115
+ Populate the model instance from a dictionary.
116
+
117
+ Nested dictionaries are recursively converted to model objects.
118
+
119
+ :param m: Dictionary containing model data
120
+ :type m: dict
121
+
122
+ :return: Self reference for method chaining
123
+ :rtype: CAConfig
124
+
125
+ :raises TypeError: If input is not a dictionary type
126
+ :raises ValueError: If nested model conversion fails
127
+ """
128
+ m = m or dict()
129
+ if m.get('replicaCount') is not None:
130
+ self.replica_count = m.get('replicaCount')
131
+ if m.get('scaleDownEnabled') is not None:
132
+ self.scale_down_enabled = m.get('scaleDownEnabled')
133
+ if m.get('scaleDownUtilizationThreshold') is not None:
134
+ self.scale_down_utilization_threshold = m.get('scaleDownUtilizationThreshold')
135
+ if m.get('scaleDownGPUUtilizationThreshold') is not None:
136
+ self.scale_down_gpu_utilization_threshold = m.get('scaleDownGPUUtilizationThreshold')
137
+ if m.get('scaleDownUnneededTime') is not None:
138
+ self.scale_down_unneeded_time = m.get('scaleDownUnneededTime')
139
+ if m.get('scaleDownDelayAfterAdd') is not None:
140
+ self.scale_down_delay_after_add = m.get('scaleDownDelayAfterAdd')
141
+ if m.get('maxEmptyBulkDelete') is not None:
142
+ self.max_empty_bulk_delete = m.get('maxEmptyBulkDelete')
143
+ if m.get('skipNodesWithLocalStorage') is not None:
144
+ self.skip_nodes_with_local_storage = m.get('skipNodesWithLocalStorage')
145
+ if m.get('skipNodesWithSystemPods') is not None:
146
+ self.skip_nodes_with_system_pods = m.get('skipNodesWithSystemPods')
147
+ if m.get('expander') is not None:
148
+ self.expander = m.get('expander')
149
+ if m.get('customConfigs') is not None:
150
+ self.custom_configs = m.get('customConfigs')
151
+ return self
@@ -0,0 +1,82 @@
1
+ """
2
+ ClusterAutoscalerSpec information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class ClusterAutoscalerSpec(AbstractModel):
9
+ """
10
+ ClusterAutoscalerSpec
11
+ """
12
+
13
+ def __init__(self, enabled=None, min_replicas=None, max_replicas=None, scaling_group_priority=None):
14
+ """
15
+ Initialize ClusterAutoscalerSpec instance.
16
+
17
+ :param enabled:
18
+ :type enabled: bool (optional)
19
+
20
+ :param min_replicas:
21
+ :type min_replicas: int (optional)
22
+
23
+ :param max_replicas:
24
+ :type max_replicas: int (optional)
25
+
26
+ :param scaling_group_priority:
27
+ :type scaling_group_priority: int (optional)
28
+ """
29
+ super().__init__()
30
+ self.enabled = enabled
31
+ self.min_replicas = min_replicas
32
+ self.max_replicas = max_replicas
33
+ self.scaling_group_priority = scaling_group_priority
34
+
35
+ def to_dict(self):
36
+ """
37
+ Convert the model instance to a dictionary representation.
38
+
39
+ Nested model objects are recursively converted to dictionaries.
40
+
41
+ :return: Dictionary representation of the model
42
+ :rtype: dict
43
+ """
44
+ _map = super().to_dict()
45
+ if _map is not None:
46
+ return _map
47
+ result = dict()
48
+ if self.enabled is not None:
49
+ result['enabled'] = self.enabled
50
+ if self.min_replicas is not None:
51
+ result['minReplicas'] = self.min_replicas
52
+ if self.max_replicas is not None:
53
+ result['maxReplicas'] = self.max_replicas
54
+ if self.scaling_group_priority is not None:
55
+ result['scalingGroupPriority'] = self.scaling_group_priority
56
+ return result
57
+
58
+ def from_dict(self, m):
59
+ """
60
+ Populate the model instance from a dictionary.
61
+
62
+ Nested dictionaries are recursively converted to model objects.
63
+
64
+ :param m: Dictionary containing model data
65
+ :type m: dict
66
+
67
+ :return: Self reference for method chaining
68
+ :rtype: ClusterAutoscalerSpec
69
+
70
+ :raises TypeError: If input is not a dictionary type
71
+ :raises ValueError: If nested model conversion fails
72
+ """
73
+ m = m or dict()
74
+ if m.get('enabled') is not None:
75
+ self.enabled = m.get('enabled')
76
+ if m.get('minReplicas') is not None:
77
+ self.min_replicas = m.get('minReplicas')
78
+ if m.get('maxReplicas') is not None:
79
+ self.max_replicas = m.get('maxReplicas')
80
+ if m.get('scalingGroupPriority') is not None:
81
+ self.scaling_group_priority = m.get('scalingGroupPriority')
82
+ return self
@@ -0,0 +1,105 @@
1
+ """
2
+ Request entity for CreateAShrinkingNodeGroupTaskV2Request information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+ from baiducloud_python_sdk_cce.models.delete_option import DeleteOption
7
+
8
+
9
+ class CreateAShrinkingNodeGroupTaskV2Request(AbstractModel):
10
+ """
11
+ Request entity for CreateAShrinkingNodeGroupTaskV2Request operation.
12
+
13
+ This class encapsulates all parameters for the API request.
14
+ """
15
+
16
+ def __init__(
17
+ self,
18
+ cluster_id,
19
+ instance_group_id,
20
+ instances_to_be_removed,
21
+ k8s_nodes_to_be_removed,
22
+ clean_policy,
23
+ delete_option=None,
24
+ ):
25
+ """
26
+ Initialize CreateAShrinkingNodeGroupTaskV2Request request entity.
27
+
28
+ :param cluster_id: cluster_id parameter
29
+ :type cluster_id: str (required)
30
+
31
+ :param instance_group_id: instance_group_id parameter
32
+ :type instance_group_id: str (required)
33
+
34
+ :param instances_to_be_removed: 缩容节点组时计划从节点组移除的节点 ID 列表
35
+ :type instances_to_be_removed: List[str] (required)
36
+
37
+ :param k8s_nodes_to_be_removed: k8s_nodes_to_be_removed parameter
38
+ :type k8s_nodes_to_be_removed: List[str] (required)
39
+
40
+ :param clean_policy: 缩容节点组时是否保留节点对应的实例, 可选 [Remain,Delete]
41
+ :type clean_policy: str (required)
42
+
43
+ :param delete_option: delete_option parameter
44
+ :type delete_option: DeleteOption (optional)
45
+ """
46
+ super().__init__()
47
+ self.cluster_id = cluster_id
48
+ self.instance_group_id = instance_group_id
49
+ self.instances_to_be_removed = instances_to_be_removed
50
+ self.k8s_nodes_to_be_removed = k8s_nodes_to_be_removed
51
+ self.clean_policy = clean_policy
52
+ self.delete_option = delete_option
53
+
54
+ def to_dict(self):
55
+ """
56
+ Convert the request entity to a dictionary representation.
57
+
58
+ Nested model objects are recursively converted to dictionaries.
59
+
60
+ :return: Dictionary representation of the request
61
+ :rtype: dict
62
+ """
63
+ _map = super().to_dict()
64
+ if _map is not None:
65
+ return _map
66
+ result = dict()
67
+ if self.instances_to_be_removed is not None:
68
+ result['instancesToBeRemoved'] = self.instances_to_be_removed
69
+ if self.k8s_nodes_to_be_removed is not None:
70
+ result['k8sNodesToBeRemoved'] = self.k8s_nodes_to_be_removed
71
+ if self.clean_policy is not None:
72
+ result['cleanPolicy'] = self.clean_policy
73
+ if self.delete_option is not None:
74
+ result['deleteOption'] = self.delete_option.to_dict()
75
+ return result
76
+
77
+ def from_dict(self, m):
78
+ """
79
+ Populate the request entity from a dictionary.
80
+
81
+ Nested dictionaries are recursively converted to model objects.
82
+
83
+ :param m: Dictionary containing request data
84
+ :type m: dict
85
+
86
+ :return: Self reference for method chaining
87
+ :rtype: CreateAShrinkingNodeGroupTaskV2Request
88
+
89
+ :raises TypeError: If input is not a dictionary or field type mismatch
90
+ :raises ValueError: If nested model conversion fails
91
+ """
92
+ m = m or dict()
93
+ if m.get('clusterID') is not None:
94
+ self.cluster_id = m.get('clusterID')
95
+ if m.get('instanceGroupID') is not None:
96
+ self.instance_group_id = m.get('instanceGroupID')
97
+ if m.get('instancesToBeRemoved') is not None:
98
+ self.instances_to_be_removed = m.get('instancesToBeRemoved')
99
+ if m.get('k8sNodesToBeRemoved') is not None:
100
+ self.k8s_nodes_to_be_removed = m.get('k8sNodesToBeRemoved')
101
+ if m.get('cleanPolicy') is not None:
102
+ self.clean_policy = m.get('cleanPolicy')
103
+ if m.get('deleteOption') is not None:
104
+ self.delete_option = DeleteOption().from_dict(m.get('deleteOption'))
105
+ return self
@@ -0,0 +1,70 @@
1
+ """
2
+ CreateAShrinkingNodeGroupTaskV2Response information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+
7
+
8
+ class CreateAShrinkingNodeGroupTaskV2Response(BceResponse):
9
+ """
10
+ CreateAShrinkingNodeGroupTaskV2Response
11
+ """
12
+
13
+ def __init__(self, task_id=None, request_id=None):
14
+ """
15
+ Initialize CreateAShrinkingNodeGroupTaskV2Response instance.
16
+
17
+ :param task_id: 节点组扩容任务 ID
18
+ :type task_id: str (optional)
19
+
20
+ :param request_id: 请求 ID, 问题定位提供该 ID
21
+ :type request_id: str (optional)
22
+ """
23
+ super().__init__()
24
+ self.task_id = task_id
25
+ self.request_id = request_id
26
+
27
+ def to_dict(self):
28
+ """
29
+ Convert the model instance to a dictionary representation.
30
+
31
+ Nested model objects are recursively converted to dictionaries.
32
+
33
+ Includes metadata from the parent BceResponse class.
34
+
35
+ :return: Dictionary representation of the model
36
+ :rtype: dict
37
+ """
38
+ _map = super().to_dict()
39
+ if _map is not None:
40
+ return _map
41
+ result = dict()
42
+ if self.metadata is not None:
43
+ result['metadata'] = dict(self.metadata)
44
+ if self.task_id is not None:
45
+ result['taskID'] = self.task_id
46
+ if self.request_id is not None:
47
+ result['requestID'] = self.request_id
48
+ return result
49
+
50
+ def from_dict(self, m):
51
+ """
52
+ Populate the model instance from a dictionary.
53
+
54
+ Nested dictionaries are recursively converted to model objects.
55
+
56
+ :param m: Dictionary containing model data
57
+ :type m: dict
58
+
59
+ :return: Self reference for method chaining
60
+ :rtype: CreateAShrinkingNodeGroupTaskV2Response
61
+
62
+ :raises TypeError: If input is not a dictionary type
63
+ :raises ValueError: If nested model conversion fails
64
+ """
65
+ m = m or dict()
66
+ if m.get('taskID') is not None:
67
+ self.task_id = m.get('taskID')
68
+ if m.get('requestID') is not None:
69
+ self.request_id = m.get('requestID')
70
+ return self
@@ -0,0 +1,58 @@
1
+ """
2
+ Request entity for CreateAnAutoscalerV2Request information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class CreateAnAutoscalerV2Request(AbstractModel):
9
+ """
10
+ Request entity for CreateAnAutoscalerV2Request operation.
11
+
12
+ This class encapsulates all parameters for the API request.
13
+ """
14
+
15
+ def __init__(self, cluster_id):
16
+ """
17
+ Initialize CreateAnAutoscalerV2Request request entity.
18
+
19
+ :param cluster_id: cluster_id parameter
20
+ :type cluster_id: str (required)
21
+ """
22
+ super().__init__()
23
+ self.cluster_id = cluster_id
24
+
25
+ def to_dict(self):
26
+ """
27
+ Convert the request entity to a dictionary representation.
28
+
29
+ Nested model objects are recursively converted to dictionaries.
30
+
31
+ :return: Dictionary representation of the request
32
+ :rtype: dict
33
+ """
34
+ _map = super().to_dict()
35
+ if _map is not None:
36
+ return _map
37
+ result = dict()
38
+ return result
39
+
40
+ def from_dict(self, m):
41
+ """
42
+ Populate the request entity from a dictionary.
43
+
44
+ Nested dictionaries are recursively converted to model objects.
45
+
46
+ :param m: Dictionary containing request data
47
+ :type m: dict
48
+
49
+ :return: Self reference for method chaining
50
+ :rtype: CreateAnAutoscalerV2Request
51
+
52
+ :raises TypeError: If input is not a dictionary or field type mismatch
53
+ :raises ValueError: If nested model conversion fails
54
+ """
55
+ m = m or dict()
56
+ if m.get('clusterID') is not None:
57
+ self.cluster_id = m.get('clusterID')
58
+ return self
@@ -0,0 +1,62 @@
1
+ """
2
+ CreateAnAutoscalerV2Response information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+
7
+
8
+ class CreateAnAutoscalerV2Response(BceResponse):
9
+ """
10
+ CreateAnAutoscalerV2Response
11
+ """
12
+
13
+ def __init__(self, request_id=None):
14
+ """
15
+ Initialize CreateAnAutoscalerV2Response instance.
16
+
17
+ :param request_id: 请求 ID,问题定位时请提供该 ID
18
+ :type request_id: str (optional)
19
+ """
20
+ super().__init__()
21
+ self.request_id = request_id
22
+
23
+ def to_dict(self):
24
+ """
25
+ Convert the model instance to a dictionary representation.
26
+
27
+ Nested model objects are recursively converted to dictionaries.
28
+
29
+ Includes metadata from the parent BceResponse class.
30
+
31
+ :return: Dictionary representation of the model
32
+ :rtype: dict
33
+ """
34
+ _map = super().to_dict()
35
+ if _map is not None:
36
+ return _map
37
+ result = dict()
38
+ if self.metadata is not None:
39
+ result['metadata'] = dict(self.metadata)
40
+ if self.request_id is not None:
41
+ result['requestID'] = self.request_id
42
+ return result
43
+
44
+ def from_dict(self, m):
45
+ """
46
+ Populate the model instance from a dictionary.
47
+
48
+ Nested dictionaries are recursively converted to model objects.
49
+
50
+ :param m: Dictionary containing model data
51
+ :type m: dict
52
+
53
+ :return: Self reference for method chaining
54
+ :rtype: CreateAnAutoscalerV2Response
55
+
56
+ :raises TypeError: If input is not a dictionary type
57
+ :raises ValueError: If nested model conversion fails
58
+ """
59
+ m = m or dict()
60
+ if m.get('requestID') is not None:
61
+ self.request_id = m.get('requestID')
62
+ return self