key = f.read() instargs = cm_client.ApiHostInstallArguments( host_names=['YourHostname'], user_name='root', private_key=key, cm_repo_url='https://archive.cloudera.com/cm6/6.3.0', java_install_strategy='NONE', ssh_port=22, passphrase='') cmd = cm_api.host_install_command(body=instargs) wait(cmd) # Configure Hosts with property needed by SMM host_api = cm_client.AllHostsResourceApi(api_client) message = 'updating CM Agent safety valve for SMM' body = cm_client.ApiConfigList( ) # ApiConfigList | Configuration changes. (optional) body.items = [ cm_client.ApiConfig( name="host_agent_safety_valve", value="kafka_broker_topic_partition_metrics_for_smm_enabled=true") ] cmd = host_api.update_config(message=message, body=body) # create MGMT/CMS mgmt_api = cm_client.MgmtServiceResourceApi(api_client) api_service = cm_client.ApiService()
def all_hosts_api(self): if self._all_hosts_api is None: self._all_hosts_api = cm_client.AllHostsResourceApi( self.api_client) return self._all_hosts_api