use of com.sequenceiq.sdx.api.model.SdxBackupResponse in project cloudbreak by hortonworks.
the class SdxBackupRestoreService method triggerDatalakeBackupFlow.
private SdxBackupResponse triggerDatalakeBackupFlow(Long clusterId, String backupLocation, String backupName) {
String selector = DATALAKE_TRIGGER_BACKUP_EVENT.event();
String userId = ThreadBasedUserCrnProvider.getUserCrn();
DatalakeTriggerBackupEvent startEvent = new DatalakeTriggerBackupEvent(selector, clusterId, userId, backupLocation, backupName, DatalakeBackupFailureReason.USER_TRIGGERED);
FlowIdentifier flowIdentifier = sdxReactorFlowManager.triggerDatalakeBackupFlow(startEvent);
return new SdxBackupResponse(startEvent.getDrStatus().getOperationId(), flowIdentifier);
}
use of com.sequenceiq.sdx.api.model.SdxBackupResponse 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;
}
use of com.sequenceiq.sdx.api.model.SdxBackupResponse 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;
}
use of com.sequenceiq.sdx.api.model.SdxBackupResponse in project cloudbreak by hortonworks.
the class SdxBackupRestoreService method triggerDatalakeBackupFlow.
private SdxBackupResponse triggerDatalakeBackupFlow(SdxCluster cluster, String backupLocation, String backupName) {
String selector = DATALAKE_TRIGGER_BACKUP_EVENT.event();
String userId = ThreadBasedUserCrnProvider.getUserCrn();
DatalakeTriggerBackupEvent startEvent = new DatalakeTriggerBackupEvent(selector, cluster.getId(), userId, backupLocation, backupName, DatalakeBackupFailureReason.USER_TRIGGERED);
FlowIdentifier flowIdentifier = sdxReactorFlowManager.triggerDatalakeBackupFlow(startEvent, cluster.getClusterName());
return new SdxBackupResponse(startEvent.getDrStatus().getOperationId(), flowIdentifier);
}
Aggregations