Search in sources :

Example 21 with ClouderaManagerClientInitException

use of com.sequenceiq.cloudbreak.cm.client.ClouderaManagerClientInitException in project cloudbreak by hortonworks.

the class ClouderaManagerClusterDecommissionService method initApiClient.

@PostConstruct
public void initApiClient() throws ClusterClientInitException {
    Cluster cluster = stack.getCluster();
    String user = cluster.getCloudbreakAmbariUser();
    String password = cluster.getCloudbreakAmbariPassword();
    try {
        v31Client = clouderaManagerApiClientProvider.getV31Client(stack.getGatewayPort(), user, password, clientConfig);
    } catch (ClouderaManagerClientInitException e) {
        throw new ClusterClientInitException(e);
    }
    try {
        v45Client = clouderaManagerApiClientProvider.getV45Client(stack.getGatewayPort(), user, password, clientConfig);
    } catch (ClouderaManagerClientInitException e) {
        LOGGER.warn("Client init failed for V45 client!");
    }
}
Also used : ClusterClientInitException(com.sequenceiq.cloudbreak.cluster.service.ClusterClientInitException) Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) ClouderaManagerClientInitException(com.sequenceiq.cloudbreak.cm.client.ClouderaManagerClientInitException) PostConstruct(javax.annotation.PostConstruct)

Example 22 with ClouderaManagerClientInitException

use of com.sequenceiq.cloudbreak.cm.client.ClouderaManagerClientInitException in project cloudbreak by hortonworks.

the class ClouderaManagerClusterStatusService method initApiClient.

@PostConstruct
public void initApiClient() throws ClusterClientInitException {
    Cluster cluster = stack.getCluster();
    String cloudbreakAmbariUser = cluster.getCloudbreakAmbariUser();
    String cloudbreakAmbariPassword = cluster.getCloudbreakAmbariPassword();
    try {
        client = clouderaManagerApiClientProvider.getV31Client(stack.getGatewayPort(), cloudbreakAmbariUser, cloudbreakAmbariPassword, clientConfig);
        fastClient = clouderaManagerApiClientProvider.getV31Client(stack.getGatewayPort(), cloudbreakAmbariUser, cloudbreakAmbariPassword, clientConfig);
        fastClient.getHttpClient().setConnectTimeout(connectQuickTimeoutSeconds, TimeUnit.SECONDS);
    } catch (ClouderaManagerClientInitException e) {
        throw new ClusterClientInitException(e);
    }
}
Also used : ClusterClientInitException(com.sequenceiq.cloudbreak.cluster.service.ClusterClientInitException) Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) ClouderaManagerClientInitException(com.sequenceiq.cloudbreak.cm.client.ClouderaManagerClientInitException) PostConstruct(javax.annotation.PostConstruct)

Aggregations

ClouderaManagerClientInitException (com.sequenceiq.cloudbreak.cm.client.ClouderaManagerClientInitException)22 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)18 ClusterClientInitException (com.sequenceiq.cloudbreak.cluster.service.ClusterClientInitException)15 ApiClient (com.cloudera.api.swagger.client.ApiClient)14 ApiException (com.cloudera.api.swagger.client.ApiException)11 CloudbreakException (com.sequenceiq.cloudbreak.service.CloudbreakException)9 ToolsResourceApi (com.cloudera.api.swagger.ToolsResourceApi)5 UsersResourceApi (com.cloudera.api.swagger.UsersResourceApi)5 ApiCluster (com.cloudera.api.swagger.model.ApiCluster)5 PostConstruct (javax.annotation.PostConstruct)5 BatchResourceApi (com.cloudera.api.swagger.BatchResourceApi)4 HostsResourceApi (com.cloudera.api.swagger.HostsResourceApi)4 ApiBatchRequest (com.cloudera.api.swagger.model.ApiBatchRequest)4 ApiBatchResponse (com.cloudera.api.swagger.model.ApiBatchResponse)4 ApiCommand (com.cloudera.api.swagger.model.ApiCommand)4 ApiHostList (com.cloudera.api.swagger.model.ApiHostList)4 ApiUser2 (com.cloudera.api.swagger.model.ApiUser2)4 ApiUser2List (com.cloudera.api.swagger.model.ApiUser2List)4 HttpClientConfig (com.sequenceiq.cloudbreak.client.HttpClientConfig)4 ApiAuthRoleRef (com.cloudera.api.swagger.model.ApiAuthRoleRef)3