File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,23 @@ def hosts_recommission(self, host_names):
245
245
"""
246
246
return self ._cmd ('hostsRecommission' , data = host_names )
247
247
248
+ def hosts_recommission_with_start (self , host_names ):
249
+ """
250
+ Recommission the specified hosts by recommissioning the slave roles.
251
+ This command will start the roles before recommissioning.
252
+
253
+ Warning: Evolving. This method may change in the future and does not
254
+ offer standard compatibility guarantees.
255
+ Do not use without guidance from Cloudera.
256
+
257
+ Currently, only HDFS DataNodes will be started by this command.
258
+
259
+ @param host_names: List of names of hosts to be recommissioned.
260
+ @return: Information about the submitted command.
261
+ @since: API v15
262
+ """
263
+ return self ._cmd ('hostsRecommissionWithStart' , data = host_names , api_version = 15 )
264
+
248
265
def hosts_start_roles (self , host_names ):
249
266
"""
250
267
Start all the roles on the specified hosts.
Original file line number Diff line number Diff line change @@ -849,6 +849,21 @@ def recommission(self, *role_names):
849
849
"""
850
850
return self ._cmd ('recommission' , data = role_names )
851
851
852
+ def recommission_with_start (self , * role_names ):
853
+ """
854
+ Recommission roles in a service. Roles are started before recommissioning.
855
+
856
+ Warning: Evolving. This method may change in the future and does not offer
857
+ standard compatibility guarantees.
858
+ Only support by HDFS.
859
+ Do not use without guidance from Cloudera.
860
+
861
+ @param role_names: Names of the roles to recommission.
862
+ @return: Reference to the submitted command.
863
+ @since: API v15
864
+ """
865
+ return self ._cmd ('recommissionWithStart' , data = role_names , api_version = 15 )
866
+
852
867
def deploy_client_config (self , * role_names ):
853
868
"""
854
869
Deploys client configuration to the hosts where roles are running.
Original file line number Diff line number Diff line change @@ -128,6 +128,20 @@ def test_host_commission(self):
128
128
retdata = {})
129
129
cms .hosts_recommission ([ "host1" , "host2" ])
130
130
131
+ def test_host_commission_with_start (self ):
132
+ resource = utils .MockResource (self )
133
+ cms = ClouderaManager (resource )
134
+
135
+ resource .expect ("POST" , "/cm/commands/hostsDecommission" ,
136
+ data = [ "host1" , "host2" ],
137
+ retdata = {})
138
+ cms .hosts_decommission ([ "host1" , "host2" ])
139
+
140
+ resource .expect ("POST" , "/cm/commands/hostsRecommissionWithStart" ,
141
+ data = [ "host1" , "host2" ],
142
+ retdata = {})
143
+ cms .hosts_recommission_with_start ([ "host1" , "host2" ])
144
+
131
145
def test_get_licensed_feature_usage (self ):
132
146
resource = utils .MockResource (self )
133
147
cms = ClouderaManager (resource )
You can’t perform that action at this time.
0 commit comments