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,82 @@
1
+ """
2
+ ListTaskPage information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class ListTaskPage(AbstractModel):
9
+ """
10
+ ListTaskPage
11
+ """
12
+
13
+ def __init__(self, page_no=None, page_size=None, total_count=None, items=None):
14
+ """
15
+ Initialize ListTaskPage instance.
16
+
17
+ :param page_no: 查询页码序号
18
+ :type page_no: int (optional)
19
+
20
+ :param page_size: 查询结果每页条目数
21
+ :type page_size: int (optional)
22
+
23
+ :param total_count: 查询结果总条目数
24
+ :type total_count: int (optional)
25
+
26
+ :param items: 任务列表
27
+ :type items: List[object] (optional)
28
+ """
29
+ super().__init__()
30
+ self.page_no = page_no
31
+ self.page_size = page_size
32
+ self.total_count = total_count
33
+ self.items = items
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.page_no is not None:
49
+ result['pageNo'] = self.page_no
50
+ if self.page_size is not None:
51
+ result['pageSize'] = self.page_size
52
+ if self.total_count is not None:
53
+ result['totalCount'] = self.total_count
54
+ if self.items is not None:
55
+ result['items'] = self.items
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: ListTaskPage
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('pageNo') is not None:
75
+ self.page_no = m.get('pageNo')
76
+ if m.get('pageSize') is not None:
77
+ self.page_size = m.get('pageSize')
78
+ if m.get('totalCount') is not None:
79
+ self.total_count = m.get('totalCount')
80
+ if m.get('items') is not None:
81
+ self.items = m.get('items')
82
+ return self
@@ -0,0 +1,66 @@
1
+ """
2
+ MachineSpecStatus information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class MachineSpecStatus(AbstractModel):
9
+ """
10
+ MachineSpecStatus
11
+ """
12
+
13
+ def __init__(self, machine_spec=None, status=None):
14
+ """
15
+ Initialize MachineSpecStatus instance.
16
+
17
+ :param machine_spec:
18
+ :type machine_spec: str (optional)
19
+
20
+ :param status:
21
+ :type status: str (optional)
22
+ """
23
+ super().__init__()
24
+ self.machine_spec = machine_spec
25
+ self.status = status
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
+ :return: Dictionary representation of the model
34
+ :rtype: dict
35
+ """
36
+ _map = super().to_dict()
37
+ if _map is not None:
38
+ return _map
39
+ result = dict()
40
+ if self.machine_spec is not None:
41
+ result['machineSpec'] = self.machine_spec
42
+ if self.status is not None:
43
+ result['status'] = self.status
44
+ return result
45
+
46
+ def from_dict(self, m):
47
+ """
48
+ Populate the model instance from a dictionary.
49
+
50
+ Nested dictionaries are recursively converted to model objects.
51
+
52
+ :param m: Dictionary containing model data
53
+ :type m: dict
54
+
55
+ :return: Self reference for method chaining
56
+ :rtype: MachineSpecStatus
57
+
58
+ :raises TypeError: If input is not a dictionary type
59
+ :raises ValueError: If nested model conversion fails
60
+ """
61
+ m = m or dict()
62
+ if m.get('machineSpec') is not None:
63
+ self.machine_spec = m.get('machineSpec')
64
+ if m.get('status') is not None:
65
+ self.status = m.get('status')
66
+ return self
@@ -0,0 +1,98 @@
1
+ """
2
+ Request entity for ModifyIGAutoScalerRequest information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class ModifyIGAutoScalerRequest(AbstractModel):
9
+ """
10
+ Request entity for ModifyIGAutoScalerRequest operation.
11
+
12
+ This class encapsulates all parameters for the API request.
13
+ """
14
+
15
+ def __init__(
16
+ self, cluster_id, instance_group_id, enabled, max_replicas, min_replicas=None, scaling_group_priority=None
17
+ ):
18
+ """
19
+ Initialize ModifyIGAutoScalerRequest request entity.
20
+
21
+ :param cluster_id: cluster_id parameter
22
+ :type cluster_id: str (required)
23
+
24
+ :param instance_group_id: instance_group_id parameter
25
+ :type instance_group_id: str (required)
26
+
27
+ :param enabled: 是否启用Autoscaler
28
+ :type enabled: bool (required)
29
+
30
+ :param min_replicas: 最小副本数. 取值范围是自然数集, 默认值为0.
31
+ :type min_replicas: int (optional)
32
+
33
+ :param max_replicas: 最大副本数. 取值范围是自然数集, 需大于minReplicas.
34
+ :type max_replicas: int (required)
35
+
36
+ :param scaling_group_priority: 伸缩组优先级. 取值范围是自然数集,默认值为0.
37
+ :type scaling_group_priority: int (optional)
38
+ """
39
+ super().__init__()
40
+ self.cluster_id = cluster_id
41
+ self.instance_group_id = instance_group_id
42
+ self.enabled = enabled
43
+ self.min_replicas = min_replicas
44
+ self.max_replicas = max_replicas
45
+ self.scaling_group_priority = scaling_group_priority
46
+
47
+ def to_dict(self):
48
+ """
49
+ Convert the request entity to a dictionary representation.
50
+
51
+ Nested model objects are recursively converted to dictionaries.
52
+
53
+ :return: Dictionary representation of the request
54
+ :rtype: dict
55
+ """
56
+ _map = super().to_dict()
57
+ if _map is not None:
58
+ return _map
59
+ result = dict()
60
+ if self.enabled is not None:
61
+ result['enabled'] = self.enabled
62
+ if self.min_replicas is not None:
63
+ result['minReplicas'] = self.min_replicas
64
+ if self.max_replicas is not None:
65
+ result['maxReplicas'] = self.max_replicas
66
+ if self.scaling_group_priority is not None:
67
+ result['scalingGroupPriority'] = self.scaling_group_priority
68
+ return result
69
+
70
+ def from_dict(self, m):
71
+ """
72
+ Populate the request entity from a dictionary.
73
+
74
+ Nested dictionaries are recursively converted to model objects.
75
+
76
+ :param m: Dictionary containing request data
77
+ :type m: dict
78
+
79
+ :return: Self reference for method chaining
80
+ :rtype: ModifyIGAutoScalerRequest
81
+
82
+ :raises TypeError: If input is not a dictionary or field type mismatch
83
+ :raises ValueError: If nested model conversion fails
84
+ """
85
+ m = m or dict()
86
+ if m.get('clusterID') is not None:
87
+ self.cluster_id = m.get('clusterID')
88
+ if m.get('instanceGroupID') is not None:
89
+ self.instance_group_id = m.get('instanceGroupID')
90
+ if m.get('enabled') is not None:
91
+ self.enabled = m.get('enabled')
92
+ if m.get('minReplicas') is not None:
93
+ self.min_replicas = m.get('minReplicas')
94
+ if m.get('maxReplicas') is not None:
95
+ self.max_replicas = m.get('maxReplicas')
96
+ if m.get('scalingGroupPriority') is not None:
97
+ self.scaling_group_priority = m.get('scalingGroupPriority')
98
+ return self
@@ -0,0 +1,61 @@
1
+ """
2
+ Request entity for ModifyIGAutoScalerResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+
7
+
8
+ class ModifyIGAutoScalerResponse(BceResponse):
9
+ """
10
+ ModifyIGAutoScalerResponse
11
+ """
12
+
13
+ def __init__(self, request_id=None):
14
+ """
15
+ Initialize ModifyIGAutoScalerResponse response.
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 response instance to a dictionary representation.
26
+
27
+ Includes metadata from the parent BceResponse class.
28
+ Nested model objects are recursively converted to dictionaries.
29
+
30
+ :return: Dictionary representation of the response
31
+ :rtype: dict
32
+ """
33
+ _map = super().to_dict()
34
+ if _map is not None:
35
+ return _map
36
+ result = dict()
37
+ if self.metadata is not None:
38
+ result['metadata'] = dict(self.metadata)
39
+ if self.request_id is not None:
40
+ result['requestID'] = self.request_id
41
+ return result
42
+
43
+ def from_dict(self, m):
44
+ """
45
+ Populate the response instance from a dictionary.
46
+
47
+ Nested dictionaries are recursively converted to model objects.
48
+
49
+ :param m: Dictionary containing response data
50
+ :type m: dict
51
+
52
+ :return: Self reference for method chaining
53
+ :rtype: ModifyIGAutoScalerResponse
54
+
55
+ :raises TypeError: If input is not a dictionary or field type mismatch
56
+ :raises ValueError: If nested model conversion fails
57
+ """
58
+ m = m or dict()
59
+ if m.get('requestID') is not None:
60
+ self.request_id = m.get('requestID')
61
+ return self
@@ -0,0 +1,74 @@
1
+ """
2
+ Request entity for ModifyNodeGroupNodeShrinkProtectionStatusV2Request information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class ModifyNodeGroupNodeShrinkProtectionStatusV2Request(AbstractModel):
9
+ """
10
+ Request entity for ModifyNodeGroupNodeShrinkProtectionStatusV2Request operation.
11
+
12
+ This class encapsulates all parameters for the API request.
13
+ """
14
+
15
+ def __init__(self, cluster_id, instance_ids, scale_down_disabled):
16
+ """
17
+ Initialize ModifyNodeGroupNodeShrinkProtectionStatusV2Request request entity.
18
+
19
+ :param cluster_id: cluster_id parameter
20
+ :type cluster_id: str (required)
21
+
22
+ :param instance_ids: 需要修改缩容保护状态的节点 ID 列表(CCEInstanceID)
23
+ :type instance_ids: List[str] (required)
24
+
25
+ :param scale_down_disabled: 是否开启缩容保护:true 开启(禁止被缩容),false 关闭
26
+ :type scale_down_disabled: bool (required)
27
+ """
28
+ super().__init__()
29
+ self.cluster_id = cluster_id
30
+ self.instance_ids = instance_ids
31
+ self.scale_down_disabled = scale_down_disabled
32
+
33
+ def to_dict(self):
34
+ """
35
+ Convert the request entity to a dictionary representation.
36
+
37
+ Nested model objects are recursively converted to dictionaries.
38
+
39
+ :return: Dictionary representation of the request
40
+ :rtype: dict
41
+ """
42
+ _map = super().to_dict()
43
+ if _map is not None:
44
+ return _map
45
+ result = dict()
46
+ if self.instance_ids is not None:
47
+ result['instanceIDs'] = self.instance_ids
48
+ if self.scale_down_disabled is not None:
49
+ result['scaleDownDisabled'] = self.scale_down_disabled
50
+ return result
51
+
52
+ def from_dict(self, m):
53
+ """
54
+ Populate the request entity from a dictionary.
55
+
56
+ Nested dictionaries are recursively converted to model objects.
57
+
58
+ :param m: Dictionary containing request data
59
+ :type m: dict
60
+
61
+ :return: Self reference for method chaining
62
+ :rtype: ModifyNodeGroupNodeShrinkProtectionStatusV2Request
63
+
64
+ :raises TypeError: If input is not a dictionary or field type mismatch
65
+ :raises ValueError: If nested model conversion fails
66
+ """
67
+ m = m or dict()
68
+ if m.get('clusterID') is not None:
69
+ self.cluster_id = m.get('clusterID')
70
+ if m.get('instanceIDs') is not None:
71
+ self.instance_ids = m.get('instanceIDs')
72
+ if m.get('scaleDownDisabled') is not None:
73
+ self.scale_down_disabled = m.get('scaleDownDisabled')
74
+ return self
@@ -0,0 +1,69 @@
1
+ """
2
+ Request entity for ModifyNodeGroupNodeShrinkProtectionStatusV2Response information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+
7
+
8
+ class ModifyNodeGroupNodeShrinkProtectionStatusV2Response(BceResponse):
9
+ """
10
+ ModifyNodeGroupNodeShrinkProtectionStatusV2Response
11
+ """
12
+
13
+ def __init__(self, failed_instances=None, request_id=None):
14
+ """
15
+ Initialize ModifyNodeGroupNodeShrinkProtectionStatusV2Response response.
16
+
17
+ :param failed_instances: 修改失败的节点及原因列表,字段见下表
18
+ :type failed_instances: List[object] (optional)
19
+
20
+ :param request_id: 请求 ID, 问题定位提供该 ID
21
+ :type request_id: str (optional)
22
+ """
23
+ super().__init__()
24
+ self.failed_instances = failed_instances
25
+ self.request_id = request_id
26
+
27
+ def to_dict(self):
28
+ """
29
+ Convert the response instance to a dictionary representation.
30
+
31
+ Includes metadata from the parent BceResponse class.
32
+ Nested model objects are recursively converted to dictionaries.
33
+
34
+ :return: Dictionary representation of the response
35
+ :rtype: dict
36
+ """
37
+ _map = super().to_dict()
38
+ if _map is not None:
39
+ return _map
40
+ result = dict()
41
+ if self.metadata is not None:
42
+ result['metadata'] = dict(self.metadata)
43
+ if self.failed_instances is not None:
44
+ result['failedInstances'] = self.failed_instances
45
+ if self.request_id is not None:
46
+ result['requestID'] = self.request_id
47
+ return result
48
+
49
+ def from_dict(self, m):
50
+ """
51
+ Populate the response instance from a dictionary.
52
+
53
+ Nested dictionaries are recursively converted to model objects.
54
+
55
+ :param m: Dictionary containing response data
56
+ :type m: dict
57
+
58
+ :return: Self reference for method chaining
59
+ :rtype: ModifyNodeGroupNodeShrinkProtectionStatusV2Response
60
+
61
+ :raises TypeError: If input is not a dictionary or field type mismatch
62
+ :raises ValueError: If nested model conversion fails
63
+ """
64
+ m = m or dict()
65
+ if m.get('failedInstances') is not None:
66
+ self.failed_instances = m.get('failedInstances')
67
+ if m.get('requestID') is not None:
68
+ self.request_id = m.get('requestID')
69
+ return self
@@ -0,0 +1,99 @@
1
+ """
2
+ Request entity for ModifyTheNumberOfNodeReplicasInANodeGroupV2Request 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 ModifyTheNumberOfNodeReplicasInANodeGroupV2Request(AbstractModel):
10
+ """
11
+ Request entity for ModifyTheNumberOfNodeReplicasInANodeGroupV2Request operation.
12
+
13
+ This class encapsulates all parameters for the API request.
14
+ """
15
+
16
+ def __init__(
17
+ self, cluster_id, instance_group_id, replicas, instance_ids=None, delete_instance=None, delete_option=None
18
+ ):
19
+ """
20
+ Initialize ModifyTheNumberOfNodeReplicasInANodeGroupV2Request request entity.
21
+
22
+ :param cluster_id: cluster_id parameter
23
+ :type cluster_id: str (required)
24
+
25
+ :param instance_group_id: instance_group_id parameter
26
+ :type instance_group_id: str (required)
27
+
28
+ :param replicas: 期望的节点组节点的副本数. 取值范围是自然数集.
29
+ :type replicas: int (required)
30
+
31
+ :param instance_ids: 指定被添加或是优先被删除的节点 ID 集合
32
+ :type instance_ids: List[str] (optional)
33
+
34
+ :param delete_instance: delete_instance parameter
35
+ :type delete_instance: bool (optional)
36
+
37
+ :param delete_option: delete_option parameter
38
+ :type delete_option: DeleteOption (optional)
39
+ """
40
+ super().__init__()
41
+ self.cluster_id = cluster_id
42
+ self.instance_group_id = instance_group_id
43
+ self.replicas = replicas
44
+ self.instance_ids = instance_ids
45
+ self.delete_instance = delete_instance
46
+ self.delete_option = delete_option
47
+
48
+ def to_dict(self):
49
+ """
50
+ Convert the request entity to a dictionary representation.
51
+
52
+ Nested model objects are recursively converted to dictionaries.
53
+
54
+ :return: Dictionary representation of the request
55
+ :rtype: dict
56
+ """
57
+ _map = super().to_dict()
58
+ if _map is not None:
59
+ return _map
60
+ result = dict()
61
+ if self.replicas is not None:
62
+ result['replicas'] = self.replicas
63
+ if self.instance_ids is not None:
64
+ result['instanceIDs'] = self.instance_ids
65
+ if self.delete_instance is not None:
66
+ result['deleteInstance'] = self.delete_instance
67
+ if self.delete_option is not None:
68
+ result['deleteOption'] = self.delete_option.to_dict()
69
+ return result
70
+
71
+ def from_dict(self, m):
72
+ """
73
+ Populate the request entity from a dictionary.
74
+
75
+ Nested dictionaries are recursively converted to model objects.
76
+
77
+ :param m: Dictionary containing request data
78
+ :type m: dict
79
+
80
+ :return: Self reference for method chaining
81
+ :rtype: ModifyTheNumberOfNodeReplicasInANodeGroupV2Request
82
+
83
+ :raises TypeError: If input is not a dictionary or field type mismatch
84
+ :raises ValueError: If nested model conversion fails
85
+ """
86
+ m = m or dict()
87
+ if m.get('clusterID') is not None:
88
+ self.cluster_id = m.get('clusterID')
89
+ if m.get('instanceGroupID') is not None:
90
+ self.instance_group_id = m.get('instanceGroupID')
91
+ if m.get('replicas') is not None:
92
+ self.replicas = m.get('replicas')
93
+ if m.get('instanceIDs') is not None:
94
+ self.instance_ids = m.get('instanceIDs')
95
+ if m.get('deleteInstance') is not None:
96
+ self.delete_instance = m.get('deleteInstance')
97
+ if m.get('deleteOption') is not None:
98
+ self.delete_option = DeleteOption().from_dict(m.get('deleteOption'))
99
+ return self
@@ -0,0 +1,62 @@
1
+ """
2
+ ModifyTheNumberOfNodeReplicasInANodeGroupV2Response information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+
7
+
8
+ class ModifyTheNumberOfNodeReplicasInANodeGroupV2Response(BceResponse):
9
+ """
10
+ ModifyTheNumberOfNodeReplicasInANodeGroupV2Response
11
+ """
12
+
13
+ def __init__(self, request_id=None):
14
+ """
15
+ Initialize ModifyTheNumberOfNodeReplicasInANodeGroupV2Response 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: ModifyTheNumberOfNodeReplicasInANodeGroupV2Response
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