Search in sources :

Example 21 with SdxUpgradeResponse

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

the class SdxCheckForUpgradeAction method action.

@Override
public SdxTestDto action(TestContext testContext, SdxTestDto testDto, SdxClient client) throws Exception {
    Log.log(LOGGER, format(" Environment: %s", testDto.getRequest().getEnvironment()));
    Log.whenJson(LOGGER, " SDX check for upgrade request: ", testDto.getRequest());
    SdxUpgradeRequest request = new SdxUpgradeRequest();
    request.setDryRun(true);
    SdxUpgradeResponse upgradeResponse = client.getDefaultClient().sdxUpgradeEndpoint().upgradeClusterByName(testDto.getName(), request);
    Log.whenJson(LOGGER, " SDX check for upgrade response: ", upgradeResponse);
    Log.log(LOGGER, " SDX name: %s", client.getDefaultClient().sdxEndpoint().get(testDto.getName()).getName());
    return testDto;
}
Also used : SdxUpgradeResponse(com.sequenceiq.sdx.api.model.SdxUpgradeResponse) SdxUpgradeRequest(com.sequenceiq.sdx.api.model.SdxUpgradeRequest)

Example 22 with SdxUpgradeResponse

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

the class SdxInternalUpgradeAction method action.

@Override
public SdxInternalTestDto action(TestContext testContext, SdxInternalTestDto testDto, SdxClient client) throws Exception {
    SdxUpgradeRequest upgradeRequest = testDto.getSdxUpgradeRequest();
    Log.when(LOGGER, " SDX endpoint: %s" + client.getDefaultClient().sdxEndpoint() + ", SDX's environment: " + testDto.getRequest().getEnvironment());
    Log.whenJson(LOGGER, " SDX upgrade request: ", upgradeRequest);
    SdxUpgradeResponse upgradeResponse = client.getDefaultClient().sdxUpgradeEndpoint().upgradeClusterByName(testDto.getName(), upgradeRequest);
    testDto.setFlow("SDX upgrade", upgradeResponse.getFlowIdentifier());
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(testDto.getName(), Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX upgrade response: ", detailedResponse);
    return testDto;
}
Also used : SdxUpgradeResponse(com.sequenceiq.sdx.api.model.SdxUpgradeResponse) SdxUpgradeRequest(com.sequenceiq.sdx.api.model.SdxUpgradeRequest) SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse)

Aggregations

SdxUpgradeResponse (com.sequenceiq.sdx.api.model.SdxUpgradeResponse)22 SdxUpgradeRequest (com.sequenceiq.sdx.api.model.SdxUpgradeRequest)15 Test (org.junit.jupiter.api.Test)15 ImageInfoV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageInfoV4Response)9 UpgradeV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.upgrade.UpgradeV4Response)8 DisplayName (org.junit.jupiter.api.DisplayName)8 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)2 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)2 SdxClusterDetailResponse (com.sequenceiq.sdx.api.model.SdxClusterDetailResponse)2 FlowIdentifier (com.sequenceiq.flow.api.model.FlowIdentifier)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1