Search in sources :

Example 1 with ApiConfigureForKerberosArguments

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();
    }
}
Also used : ApiCommand(com.cloudera.api.swagger.model.ApiCommand) ApiConfigureForKerberosArguments(com.cloudera.api.swagger.model.ApiConfigureForKerberosArguments) ClouderaManagerResourceApi(com.cloudera.api.swagger.ClouderaManagerResourceApi) Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) ClustersResourceApi(com.cloudera.api.swagger.ClustersResourceApi) BigDecimal(java.math.BigDecimal)

Aggregations

ClouderaManagerResourceApi (com.cloudera.api.swagger.ClouderaManagerResourceApi)1 ClustersResourceApi (com.cloudera.api.swagger.ClustersResourceApi)1 ApiCommand (com.cloudera.api.swagger.model.ApiCommand)1 ApiConfigureForKerberosArguments (com.cloudera.api.swagger.model.ApiConfigureForKerberosArguments)1 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)1 BigDecimal (java.math.BigDecimal)1