Search in sources :

Example 1 with SdxBackupResponse

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);
}
Also used : FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier) SdxBackupResponse(com.sequenceiq.sdx.api.model.SdxBackupResponse) DatalakeTriggerBackupEvent(com.sequenceiq.datalake.flow.dr.backup.event.DatalakeTriggerBackupEvent)

Example 2 with SdxBackupResponse

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;
}
Also used : SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) SdxBackupResponse(com.sequenceiq.sdx.api.model.SdxBackupResponse)

Example 3 with SdxBackupResponse

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;
}
Also used : SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) SdxBackupResponse(com.sequenceiq.sdx.api.model.SdxBackupResponse)

Example 4 with SdxBackupResponse

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);
}
Also used : FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier) SdxBackupResponse(com.sequenceiq.sdx.api.model.SdxBackupResponse) DatalakeTriggerBackupEvent(com.sequenceiq.datalake.flow.dr.backup.event.DatalakeTriggerBackupEvent)

Aggregations

SdxBackupResponse (com.sequenceiq.sdx.api.model.SdxBackupResponse)4 DatalakeTriggerBackupEvent (com.sequenceiq.datalake.flow.dr.backup.event.DatalakeTriggerBackupEvent)2 FlowIdentifier (com.sequenceiq.flow.api.model.FlowIdentifier)2 SdxClusterDetailResponse (com.sequenceiq.sdx.api.model.SdxClusterDetailResponse)2