Search in sources :

Example 21 with ClusterClientInitException

use of com.sequenceiq.cloudbreak.cluster.service.ClusterClientInitException in project cloudbreak by hortonworks.

the class ClouderaManagerSetupService method initApiClient.

@PostConstruct
public void initApiClient() throws ClusterClientInitException {
    Cluster cluster = stack.getCluster();
    String user = cluster.getCloudbreakAmbariUser();
    String password = cluster.getCloudbreakAmbariPassword();
    try {
        ClouderaManagerRepo clouderaManagerRepoDetails = clusterComponentProvider.getClouderaManagerRepoDetails(cluster.getId());
        if (isVersionNewerOrEqualThanLimited(clouderaManagerRepoDetails::getVersion, CLOUDERAMANAGER_VERSION_7_1_0)) {
            apiClient = clouderaManagerApiClientProvider.getV40Client(stack.getGatewayPort(), user, password, clientConfig);
        } else {
            apiClient = clouderaManagerApiClientProvider.getV31Client(stack.getGatewayPort(), user, password, clientConfig);
        }
    } catch (ClouderaManagerClientInitException e) {
        throw new ClusterClientInitException(e);
    }
}
Also used : ClouderaManagerRepo(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo) ClusterClientInitException(com.sequenceiq.cloudbreak.cluster.service.ClusterClientInitException) ApiCluster(com.cloudera.api.swagger.model.ApiCluster) Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) ClouderaManagerClientInitException(com.sequenceiq.cloudbreak.cm.client.ClouderaManagerClientInitException) PostConstruct(javax.annotation.PostConstruct)

Example 22 with ClusterClientInitException

use of com.sequenceiq.cloudbreak.cluster.service.ClusterClientInitException in project cloudbreak by hortonworks.

the class ClouderaManagerClusterCommissionService method initApiClient.

@PostConstruct
public void initApiClient() throws ClusterClientInitException {
    Cluster cluster = stack.getCluster();
    String user = cluster.getCloudbreakAmbariUser();
    String password = cluster.getCloudbreakAmbariPassword();
    try {
        client = clouderaManagerApiClientProvider.getV31Client(stack.getGatewayPort(), user, password, clientConfig);
    } 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)

Example 23 with ClusterClientInitException

use of com.sequenceiq.cloudbreak.cluster.service.ClusterClientInitException 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 24 with ClusterClientInitException

use of com.sequenceiq.cloudbreak.cluster.service.ClusterClientInitException 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

ClusterClientInitException (com.sequenceiq.cloudbreak.cluster.service.ClusterClientInitException)24 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)17 ClouderaManagerClientInitException (com.sequenceiq.cloudbreak.cm.client.ClouderaManagerClientInitException)12 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)10 InstanceMetaData (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData)9 InstanceStatus (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceStatus)8 ClusterApi (com.sequenceiq.cloudbreak.cluster.api.ClusterApi)8 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)8 ClusterApiConnectors (com.sequenceiq.cloudbreak.service.cluster.ClusterApiConnectors)8 StackService (com.sequenceiq.cloudbreak.service.stack.StackService)8 Map (java.util.Map)8 Set (java.util.Set)8 Collectors (java.util.stream.Collectors)8 Test (org.junit.jupiter.api.Test)8 EventStatus (com.sequenceiq.cloudbreak.cloud.event.model.EventStatus)7 ClusterCommissionService (com.sequenceiq.cloudbreak.cluster.api.ClusterCommissionService)7 ClusterSetupService (com.sequenceiq.cloudbreak.cluster.api.ClusterSetupService)7 CloudbreakFlowMessageService (com.sequenceiq.cloudbreak.core.flow2.stack.CloudbreakFlowMessageService)7 HostGroup (com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup)7 InstanceGroup (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup)7