Search in sources :

Example 51 with SdxClusterResponse

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

the class DataLakeStatusCheckerServiceTest method createSdxResponse.

private List<SdxClusterResponse> createSdxResponse(SdxClusterStatusResponse status, String statusReason) {
    SdxClusterResponse sdxClusterResponse = new SdxClusterResponse();
    sdxClusterResponse.setStatus(status);
    sdxClusterResponse.setStatusReason(statusReason);
    return Collections.singletonList(sdxClusterResponse);
}
Also used : SdxClusterResponse(com.sequenceiq.sdx.api.model.SdxClusterResponse)

Example 52 with SdxClusterResponse

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

the class SdxCreateCustomAction method action.

@Override
public SdxCustomTestDto action(TestContext testContext, SdxCustomTestDto testDto, SdxClient client) throws Exception {
    Log.when(LOGGER, " SDX endpoint: %s" + client.getDefaultClient().sdxEndpoint() + ", SDX's environment: " + testDto.getRequest().getEnvironment());
    Log.whenJson(LOGGER, " SDX create request: ", testDto.getRequest());
    SdxClusterResponse sdxClusterResponse = client.getDefaultClient().sdxEndpoint().create(testDto.getName(), testDto.getRequest());
    testDto.setFlow("SDX create", sdxClusterResponse.getFlowIdentifier());
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetailByCrn(sdxClusterResponse.getCrn(), Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX create response: ", client.getDefaultClient().sdxEndpoint().get(testDto.getName()));
    return testDto;
}
Also used : SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) SdxClusterResponse(com.sequenceiq.sdx.api.model.SdxClusterResponse)

Example 53 with SdxClusterResponse

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

the class SdxCreateInternalAction method action.

@Override
public SdxInternalTestDto action(TestContext testContext, SdxInternalTestDto testDto, SdxClient client) throws Exception {
    Log.when(LOGGER, " SDX endpoint: %s" + client.getDefaultClient().sdxEndpoint() + ", SDX's environment: " + testDto.getRequest().getEnvironment());
    Log.whenJson(LOGGER, " SDX create request: ", testDto.getRequest());
    SdxClusterResponse sdxClusterResponse = client.getDefaultClient().sdxInternalEndpoint().create(testDto.getName(), testDto.getRequest());
    testDto.setFlow("SDX create internal", sdxClusterResponse.getFlowIdentifier());
    testDto.setResponse(client.getDefaultClient().sdxEndpoint().getDetailByCrn(sdxClusterResponse.getCrn(), Collections.emptySet()));
    Log.whenJson(LOGGER, " SDX create response: ", testDto.getResponse());
    return testDto;
}
Also used : SdxClusterResponse(com.sequenceiq.sdx.api.model.SdxClusterResponse)

Example 54 with SdxClusterResponse

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

the class SdxResizeAction method action.

/**
 * Starts SDX resize operation, and retrieves the detailed SDX response after it's finished.
 * @return result of the resize
 * @throws Exception if the SdxClusterDetailResponse cannot be converted to JSON
 */
@Override
public SdxInternalTestDto action(TestContext testContext, SdxInternalTestDto testDto, SdxClient client) throws Exception {
    SdxClusterResizeRequest clusterResizeRequest = testDto.getSdxResizeRequest();
    Log.when(LOGGER, " SDX endpoint: %s" + client.getDefaultClient().sdxEndpoint() + ", SDX's environment: " + testDto.getRequest().getEnvironment());
    Log.whenJson(LOGGER, " SDX resize request: ", clusterResizeRequest);
    SdxClusterResponse sdxClusterResponse = client.getDefaultClient().sdxEndpoint().resize(testDto.getName(), clusterResizeRequest);
    testDto.setFlow("SDX resize", sdxClusterResponse.getFlowIdentifier());
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(testDto.getName(), Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX resize response: ", detailedResponse);
    return testDto;
}
Also used : SdxClusterResizeRequest(com.sequenceiq.sdx.api.model.SdxClusterResizeRequest) SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) SdxClusterResponse(com.sequenceiq.sdx.api.model.SdxClusterResponse)

Aggregations

SdxClusterResponse (com.sequenceiq.sdx.api.model.SdxClusterResponse)54 Test (org.junit.jupiter.api.Test)22 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)13 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)12 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)12 ValidationResult (com.sequenceiq.cloudbreak.validation.ValidationResult)10 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)8 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)8 Test (org.junit.Test)8 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)7 ArrayList (java.util.ArrayList)7 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)5 FlowIdentifier (com.sequenceiq.flow.api.model.FlowIdentifier)5 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)5 SdxClientService (com.sequenceiq.cloudbreak.service.datalake.SdxClientService)4 LoggingResponse (com.sequenceiq.common.api.telemetry.response.LoggingResponse)4 CompactRegionResponse (com.sequenceiq.environment.api.v1.environment.model.response.CompactRegionResponse)4 Set (java.util.Set)4 StackV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response)3 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)3