Search in sources :

Example 1 with SdxBackupStatusResponse

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

the class SdxBackupRestoreTest method validateDatalakeBackupStatus.

private SdxInternalTestDto validateDatalakeBackupStatus(TestContext testContext, SdxInternalTestDto testDto, SdxClient client) {
    String sdxName = testDto.getName();
    backupId = client.getDefaultClient().sdxBackupEndpoint().getDatalakeBackupId(sdxName, null);
    SdxBackupStatusResponse sdxBackupStatusResponse = client.getDefaultClient().sdxBackupEndpoint().getBackupDatalakeStatus(sdxName, backupId, null);
    String status = sdxBackupStatusResponse.getStatus();
    String statusReason = sdxBackupStatusResponse.getReason();
    LOGGER.info(format(" SDX '%s' backup '%s' status '%s', because of %s ", sdxName, backupId, status, statusReason));
    if (status.contains("FAILED")) {
        LOGGER.error(String.format(" Sdx '%s' backup has been failed: '%s' ", testDto.getName(), statusReason));
        throw new TestFailException(String.format(" Sdx '%s' backup has been failed: '%s' ", testDto.getName(), statusReason));
    } else {
        LOGGER.info(String.format(" Sdx '%s' backup has been done with '%s'. ", testDto.getName(), statusReason));
        Log.then(LOGGER, format(" Sdx '%s' backup has been done with '%s'. ", testDto.getName(), statusReason));
    }
    return testDto;
}
Also used : SdxBackupStatusResponse(com.sequenceiq.sdx.api.model.SdxBackupStatusResponse) TestFailException(com.sequenceiq.it.cloudbreak.exception.TestFailException)

Example 2 with SdxBackupStatusResponse

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

the class SdxBackupRestoreService method getDatalakeBackupStatus.

public SdxBackupStatusResponse getDatalakeBackupStatus(String datalakeName, String backupId, String backupName, String userCrn) {
    LOGGER.info("Requesting datalake backup status for datalake: '{}'", datalakeName);
    DatalakeBackupStatusResponse datalakeBackupStatusResponse = datalakeDrClient.getBackupStatus(datalakeName, backupId, backupName, userCrn);
    return new SdxBackupStatusResponse(datalakeBackupStatusResponse.getBackupId(), datalakeBackupStatusResponse.getState().name(), datalakeBackupStatusResponse.getFailureReason());
}
Also used : SdxBackupStatusResponse(com.sequenceiq.sdx.api.model.SdxBackupStatusResponse) DatalakeBackupStatusResponse(com.sequenceiq.cloudbreak.datalakedr.model.DatalakeBackupStatusResponse)

Aggregations

SdxBackupStatusResponse (com.sequenceiq.sdx.api.model.SdxBackupStatusResponse)2 DatalakeBackupStatusResponse (com.sequenceiq.cloudbreak.datalakedr.model.DatalakeBackupStatusResponse)1 TestFailException (com.sequenceiq.it.cloudbreak.exception.TestFailException)1