Search in sources :

Example 1 with SdxClusterDetailResponse

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

the class SdxAutotlsCertRotationAction method action.

@Override
public SdxTestDto action(TestContext testContext, SdxTestDto testDto, SdxClient client) throws Exception {
    CertificatesRotationV4Request certificatesRotationV4Request = new CertificatesRotationV4Request();
    Log.when(LOGGER, " SDX endpoint: %s" + client.getDefaultClient().sdxEndpoint() + ", SDX's environment: " + testDto.getRequest().getEnvironment());
    Log.whenJson(LOGGER, " SDX autotls cert rotation request: ", certificatesRotationV4Request);
    FlowIdentifier flowIdentifier = client.getDefaultClient().sdxEndpoint().rotateAutoTlsCertificatesByName(testDto.getName(), new CertificatesRotationV4Request());
    testDto.setFlow("SDX autotls cert rotation", flowIdentifier);
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(testDto.getName(), Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX response after autotls cert rotation: ", detailedResponse);
    return testDto;
}
Also used : CertificatesRotationV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.CertificatesRotationV4Request) SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier)

Example 2 with SdxClusterDetailResponse

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

the class SdxBackupAction method action.

@Override
public SdxTestDto action(TestContext testContext, SdxTestDto testDto, SdxClient client) throws Exception {
    String sdxName = testDto.getName();
    testContext.waitingFor(Duration.ofMinutes(2), "Waiting for CM services to be synchronized has been interrupted");
    Log.when(LOGGER, format(" SDX '%s' backup has been started to '%s' by name '%s'... ", sdxName, backupLocation, backupName));
    Log.whenJson(LOGGER, " SDX backup request: ", testDto.getRequest());
    LOGGER.info(format(" SDX '%s' backup has been started to '%s' by name '%s'... ", sdxName, backupLocation, backupName));
    SdxBackupResponse sdxBackupResponse = client.getDefaultClient().sdxBackupEndpoint().backupDatalakeByName(sdxName, backupLocation, backupName);
    testDto.setFlow("SDX backup", sdxBackupResponse.getFlowIdentifier());
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(sdxName, Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX response after backup: ", client.getDefaultClient().sdxEndpoint().get(sdxName));
    return testDto;
}
Also used : SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) SdxBackupResponse(com.sequenceiq.sdx.api.model.SdxBackupResponse)

Example 3 with SdxClusterDetailResponse

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

the class SdxBackupInternalAction method action.

@Override
public SdxInternalTestDto action(TestContext testContext, SdxInternalTestDto testDto, SdxClient client) throws Exception {
    String sdxName = testDto.getName();
    testContext.waitingFor(Duration.ofMinutes(2), "Waiting for CM services to be synchronized has been interrupted");
    Log.when(LOGGER, format(" Internal SDX '%s' backup has been started to '%s' by name '%s'... ", sdxName, backupLocation, backupName));
    Log.whenJson(LOGGER, " Internal SDX backup request: ", testDto.getRequest());
    LOGGER.info(format(" Internal SDX '%s' backup has been started to '%s' by name '%s'... ", sdxName, backupLocation, backupName));
    SdxBackupResponse sdxBackupResponse = client.getDefaultClient().sdxBackupEndpoint().backupDatalakeByName(sdxName, backupLocation, backupName);
    testDto.setFlow("SDX backup", sdxBackupResponse.getFlowIdentifier());
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(sdxName, Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " Internal SDX response after backup: ", client.getDefaultClient().sdxEndpoint().get(sdxName));
    return testDto;
}
Also used : SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) SdxBackupResponse(com.sequenceiq.sdx.api.model.SdxBackupResponse)

Example 4 with SdxClusterDetailResponse

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

the class SdxCreateAction method action.

@Override
public SdxTestDto action(TestContext testContext, SdxTestDto 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 5 with SdxClusterDetailResponse

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

the class SdxDeleteAction method action.

@Override
public SdxTestDto action(TestContext testContext, SdxTestDto testDto, SdxClient client) throws Exception {
    Log.when(LOGGER, " SDX endpoint: %s" + client.getDefaultClient().sdxEndpoint() + ", SDX's environment: " + testDto.getRequest().getEnvironment());
    Log.whenJson(LOGGER, " SDX delete request: ", testDto.getRequest());
    FlowIdentifier flowIdentifier = client.getDefaultClient().sdxEndpoint().delete(testDto.getName(), false);
    testDto.setFlow("SDX delete", flowIdentifier);
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(testDto.getName(), Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX delete response: ", detailedResponse);
    return testDto;
}
Also used : SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier)

Aggregations

SdxClusterDetailResponse (com.sequenceiq.sdx.api.model.SdxClusterDetailResponse)27 FlowIdentifier (com.sequenceiq.flow.api.model.FlowIdentifier)14 SdxClusterResponse (com.sequenceiq.sdx.api.model.SdxClusterResponse)3 SdxBackupResponse (com.sequenceiq.sdx.api.model.SdxBackupResponse)2 SdxRestoreResponse (com.sequenceiq.sdx.api.model.SdxRestoreResponse)2 SdxUpgradeRequest (com.sequenceiq.sdx.api.model.SdxUpgradeRequest)2 SdxUpgradeResponse (com.sequenceiq.sdx.api.model.SdxUpgradeResponse)2 CertificatesRotationV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.CertificatesRotationV4Request)1 SdxClusterResizeRequest (com.sequenceiq.sdx.api.model.SdxClusterResizeRequest)1 SdxRecoveryRequest (com.sequenceiq.sdx.api.model.SdxRecoveryRequest)1 SdxRecoveryResponse (com.sequenceiq.sdx.api.model.SdxRecoveryResponse)1