use of com.cloudera.api.swagger.model.ApiConfigureForKerberosArguments in project cloudbreak by hortonworks.
the class ClouderaManagerKerberosService method configureKerberosViaApi.
public void configureKerberosViaApi(ApiClient client, HttpClientConfig clientConfig, Stack stack, KerberosConfig kerberosConfig) throws ApiException, CloudbreakException {
Cluster cluster = stack.getCluster();
if (kerberosDetailService.isAdJoinable(kerberosConfig) || kerberosDetailService.isIpaJoinable(kerberosConfig)) {
ClouderaManagerModificationService modificationService = applicationContext.getBean(ClouderaManagerModificationService.class, stack, clientConfig);
ClouderaManagerResourceApi clouderaManagerResourceApi = clouderaManagerApiFactory.getClouderaManagerResourceApi(client);
modificationService.stopCluster(false);
ClustersResourceApi clustersResourceApi = clouderaManagerApiFactory.getClustersResourceApi(client);
ApiCommand configureForKerberos = clustersResourceApi.configureForKerberos(cluster.getName(), new ApiConfigureForKerberosArguments());
clouderaManagerPollingServiceProvider.startPollingCmKerberosJob(stack, client, configureForKerberos.getId());
ApiCommand generateCredentials = clouderaManagerResourceApi.generateCredentialsCommand();
clouderaManagerPollingServiceProvider.startPollingCmKerberosJob(stack, client, generateCredentials.getId());
List<ApiCommand> commands = clustersResourceApi.listActiveCommands(stack.getName(), SUMMARY).getItems();
BigDecimal deployClusterConfigId = clouderaManagerCommonCommandService.getDeployClientConfigCommandId(stack, clustersResourceApi, commands);
clouderaManagerPollingServiceProvider.startPollingCmKerberosJob(stack, client, deployClusterConfigId);
modificationService.startCluster();
}
}
Aggregations