@@ -5134,3 +5134,58 @@ def verify_notification_item(self,
51345134 return None
51355135
51365136 return self .send_request (action , body )
5137+
5138+ def start_clusters (self , clusters ,
5139+ ** ignore ):
5140+ """ Start one or more clusters.
5141+ @param clusters: the array of clusters IDs.
5142+ """
5143+ action = const .ACTION_START_CLUSTERS
5144+ body = {'clusters' : clusters }
5145+ if not self .req_checker .check_params (body ,
5146+ required_params = ['clusters' ],
5147+ integer_params = [],
5148+ list_params = ['clusters' ]
5149+ ):
5150+ return None
5151+
5152+ return self .send_request (action , body )
5153+
5154+ def stop_clusters (self , clusters ,
5155+ ** ignore ):
5156+ """ Stop one or more clusters.
5157+ @param clusters: the array of clusters IDs.
5158+ """
5159+ action = const .ACTION_STOP_CLUSTERS
5160+ body = {'clusters' : clusters }
5161+ if not self .req_checker .check_params (body ,
5162+ required_params = ['clusters' ],
5163+ integer_params = [],
5164+ list_params = ['clusters' ]
5165+ ):
5166+ return None
5167+
5168+ return self .send_request (action , body )
5169+
5170+ def resize_cluster (self , cluster ,
5171+ node_role = None ,
5172+ cpu = None ,
5173+ memory = None ,
5174+ storage_size = None ,
5175+ ** ignore ):
5176+ """ Resize cluster
5177+ @param cluster: the ID of the cluster you want to resize.
5178+ @param cpu: cpu core number.
5179+ @param memory: memory size in MB.
5180+ @param storage_size: The new larger size of the storage_size, unit is GB.
5181+ """
5182+ action = const .ACTION_RESIZE_CLUSTER
5183+ valid_keys = ['cluster' , 'node_role' , 'cpu' , 'memory' , 'storage_size' ]
5184+ body = filter_out_none (locals (), valid_keys )
5185+ if not self .req_checker .check_params (body ,
5186+ required_params = ['cluster' ],
5187+ integer_params = ['cpu' , 'memory' ]
5188+ ):
5189+ return None
5190+
5191+ return self .send_request (action , body )
0 commit comments