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;
}
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());
}
Aggregations