Search in sources :

Example 26 with SdxUpgradeRequest

use of com.sequenceiq.sdx.api.model.SdxUpgradeRequest 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 27 with SdxUpgradeRequest

use of com.sequenceiq.sdx.api.model.SdxUpgradeRequest 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

SdxUpgradeRequest (com.sequenceiq.sdx.api.model.SdxUpgradeRequest)27 Test (org.junit.jupiter.api.Test)19 SdxUpgradeResponse (com.sequenceiq.sdx.api.model.SdxUpgradeResponse)18 DisplayName (org.junit.jupiter.api.DisplayName)9 ImageInfoV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageInfoV4Response)7 UpgradeV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.upgrade.UpgradeV4Response)7 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)6 StackV4Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.StackV4Endpoint)3 ImageComponentVersions (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageComponentVersions)3 ClouderaManagerLicenseProvider (com.sequenceiq.cloudbreak.auth.ClouderaManagerLicenseProvider)3 JsonCMLicense (com.sequenceiq.cloudbreak.auth.JsonCMLicense)3 PaywallAccessChecker (com.sequenceiq.cloudbreak.auth.PaywallAccessChecker)3 ThreadBasedUserCrnProvider (com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider)3 EntitlementService (com.sequenceiq.cloudbreak.auth.altus.EntitlementService)3 RegionAwareInternalCrnGeneratorFactory (com.sequenceiq.cloudbreak.auth.crn.RegionAwareInternalCrnGeneratorFactory)3 CloudbreakMessagesService (com.sequenceiq.cloudbreak.message.CloudbreakMessagesService)3 SdxUpgradeClusterConverter (com.sequenceiq.datalake.controller.sdx.SdxUpgradeClusterConverter)3 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)3 SdxReactorFlowManager (com.sequenceiq.datalake.flow.SdxReactorFlowManager)3 SdxService (com.sequenceiq.datalake.service.sdx.SdxService)3