Search in sources :

Example 11 with StackResponse

use of com.sequenceiq.cloudbreak.api.model.StackResponse in project cloudbreak by hortonworks.

the class ScalingUtil method checkClusterScaled.

public static void checkClusterScaled(StackEndpoint stackV1Endpoint, String port, String stackId, String ambariUser, String ambariPassword, int expectedNodeCount, IntegrationTestContext itContext) {
    StackResponse stackResponse = stackV1Endpoint.get(Long.valueOf(stackId), new HashSet<>());
    checkClusterScaled(CloudbreakUtil.getAmbariIp(stackResponse, itContext), port, ambariUser, ambariPassword, expectedNodeCount, stackResponse);
}
Also used : StackResponse(com.sequenceiq.cloudbreak.api.model.StackResponse)

Example 12 with StackResponse

use of com.sequenceiq.cloudbreak.api.model.StackResponse in project cloudbreak by hortonworks.

the class ScalingUtil method putInstanceCountToContext.

public static void putInstanceCountToContext(IntegrationTestContext itContext, String stackId) {
    Collection<Map<String, Integer>> tmpInstanceCount = new ArrayList<>();
    StackV1Endpoint stackV1Endpoint = itContext.getContextParam(CloudbreakITContextConstants.CLOUDBREAK_CLIENT, CloudbreakClient.class).stackV1Endpoint();
    StackResponse stackResponse = stackV1Endpoint.get(Long.valueOf(stackId), new HashSet<>());
    if (itContext.getContextParam(CloudbreakITContextConstants.INSTANCE_COUNT, List.class) != null) {
        tmpInstanceCount = itContext.getContextParam(CloudbreakITContextConstants.INSTANCE_COUNT, List.class);
        tmpInstanceCount.add(getNodeCountByHostgroup(stackResponse));
    } else {
        tmpInstanceCount.add(getNodeCountByHostgroup(stackResponse));
    }
    itContext.putContextParam(CloudbreakITContextConstants.INSTANCE_COUNT, tmpInstanceCount);
}
Also used : StackV1Endpoint(com.sequenceiq.cloudbreak.api.endpoint.v1.StackV1Endpoint) CloudbreakClient(com.sequenceiq.cloudbreak.client.CloudbreakClient) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) StackResponse(com.sequenceiq.cloudbreak.api.model.StackResponse)

Example 13 with StackResponse

use of com.sequenceiq.cloudbreak.api.model.StackResponse in project cloudbreak by hortonworks.

the class CloudbreakUtil method checkClusterFailed.

public static void checkClusterFailed(StackEndpoint stackV1Endpoint, String stackId, CharSequence failMessage) {
    StackResponse stackResponse = stackV1Endpoint.get(Long.valueOf(stackId), new HashSet<>());
    Assert.assertNotEquals(stackResponse.getCluster().getStatus(), Status.AVAILABLE);
    Assert.assertTrue(stackResponse.getCluster().getStatusReason().contains(failMessage));
}
Also used : StackResponse(com.sequenceiq.cloudbreak.api.model.StackResponse)

Example 14 with StackResponse

use of com.sequenceiq.cloudbreak.api.model.StackResponse in project cloudbreak by hortonworks.

the class CloudbreakUtil method checkClusterStopped.

public static void checkClusterStopped(StackEndpoint stackV1Endpoint, String port, String stackId, String ambariUser, String ambariPassword) {
    StackResponse stackResponse = stackV1Endpoint.get(Long.valueOf(stackId), new HashSet<>());
    checkClusterStopped(port, ambariUser, ambariPassword, stackResponse);
}
Also used : StackResponse(com.sequenceiq.cloudbreak.api.model.StackResponse)

Example 15 with StackResponse

use of com.sequenceiq.cloudbreak.api.model.StackResponse in project cloudbreak by hortonworks.

the class StackService method getJsonById.

@Transactional(TxType.NEVER)
public StackResponse getJsonById(Long id, Collection<String> entry) {
    Stack stack = getByIdWithLists(id);
    authorizationService.hasReadPermission(stack);
    StackResponse stackResponse = conversionService.convert(stack, StackResponse.class);
    stackResponse = stackResponseDecorator.decorate(stackResponse, stack, entry);
    return stackResponse;
}
Also used : AutoscaleStackResponse(com.sequenceiq.cloudbreak.api.model.AutoscaleStackResponse) StackResponse(com.sequenceiq.cloudbreak.api.model.StackResponse) Stack(com.sequenceiq.cloudbreak.domain.Stack) Transactional(javax.transaction.Transactional)

Aggregations

StackResponse (com.sequenceiq.cloudbreak.api.model.StackResponse)32 Test (org.testng.annotations.Test)10 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)9 Parameters (org.testng.annotations.Parameters)9 AbstractCloudbreakIntegrationTest (com.sequenceiq.it.cloudbreak.AbstractCloudbreakIntegrationTest)8 StackV1Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v1.StackV1Endpoint)7 Map (java.util.Map)7 CredentialResponse (com.sequenceiq.cloudbreak.api.model.CredentialResponse)6 ImageJson (com.sequenceiq.cloudbreak.api.model.ImageJson)6 OrchestratorResponse (com.sequenceiq.cloudbreak.api.model.OrchestratorResponse)6 StackAuthenticationResponse (com.sequenceiq.cloudbreak.api.model.StackAuthenticationResponse)6 HashMap (java.util.HashMap)6 CloudbreakDetailsJson (com.sequenceiq.cloudbreak.api.model.CloudbreakDetailsJson)5 ClusterResponse (com.sequenceiq.cloudbreak.api.model.ClusterResponse)5 FailurePolicyResponse (com.sequenceiq.cloudbreak.api.model.FailurePolicyResponse)5 InstanceGroupRequest (com.sequenceiq.cloudbreak.api.model.InstanceGroupRequest)5 InstanceMetaDataJson (com.sequenceiq.cloudbreak.api.model.InstanceMetaDataJson)5 NetworkResponse (com.sequenceiq.cloudbreak.api.model.NetworkResponse)5 CloudbreakClient (com.sequenceiq.cloudbreak.client.CloudbreakClient)5 Test (org.junit.Test)5