Search in sources :

Example 21 with FlowIdentifier

use of com.sequenceiq.flow.api.model.FlowIdentifier in project cloudbreak by hortonworks.

the class SdxRepairAction method action.

@Override
public SdxTestDto action(TestContext testContext, SdxTestDto testDto, SdxClient client) throws Exception {
    Log.when(LOGGER, format(" Starting repair on SDX: %s ", testDto.getName()));
    Log.whenJson(LOGGER, " SDX repair request: ", testDto.getSdxRepairRequest(hostGroups));
    FlowIdentifier flowIdentifier = client.getDefaultClient().sdxEndpoint().repairCluster(testDto.getName(), testDto.getSdxRepairRequest(hostGroups));
    testDto.setFlow("SDX repair", flowIdentifier);
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(testDto.getName(), Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX repair response: ", detailedResponse);
    return testDto;
}
Also used : SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier)

Example 22 with FlowIdentifier

use of com.sequenceiq.flow.api.model.FlowIdentifier in project cloudbreak by hortonworks.

the class SdxRepairCustomAction method action.

@Override
public SdxCustomTestDto action(TestContext testContext, SdxCustomTestDto testDto, SdxClient client) throws Exception {
    Log.when(LOGGER, format(" Starting repair on SDX Internal: %s ", testDto.getName()));
    Log.whenJson(LOGGER, " SDX Custom repair request: ", testDto.getSdxRepairRequest());
    FlowIdentifier flowIdentifier = client.getDefaultClient().sdxEndpoint().repairCluster(testDto.getName(), testDto.getSdxRepairRequest());
    testDto.setFlow("SDX Custom repair", flowIdentifier);
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(testDto.getName(), Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX Custom repair response: ", detailedResponse);
    return testDto;
}
Also used : SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier)

Example 23 with FlowIdentifier

use of com.sequenceiq.flow.api.model.FlowIdentifier in project cloudbreak by hortonworks.

the class SdxRepairInternalAction method action.

@Override
public SdxInternalTestDto action(TestContext testContext, SdxInternalTestDto testDto, SdxClient client) throws Exception {
    Log.when(LOGGER, format(" Starting repair on SDX Internal: %s ", testDto.getName()));
    Log.whenJson(LOGGER, " SDX Internal repair request: ", testDto.getSdxRepairRequest(hostGroups));
    FlowIdentifier flowIdentifier = client.getDefaultClient().sdxEndpoint().repairCluster(testDto.getName(), testDto.getSdxRepairRequest(hostGroups));
    testDto.setFlow("SDX Internal repair", flowIdentifier);
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(testDto.getName(), Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX Internal repair response: ", detailedResponse);
    return testDto;
}
Also used : SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier)

Example 24 with FlowIdentifier

use of com.sequenceiq.flow.api.model.FlowIdentifier in project cloudbreak by hortonworks.

the class SdxStartCustomAction method action.

@Override
public SdxCustomTestDto action(TestContext testContext, SdxCustomTestDto testDto, SdxClient client) throws Exception {
    Log.when(LOGGER, format(" Starting custom SDX: %s ", testDto.getName()));
    Log.whenJson(LOGGER, " SDX start custom request: ", testDto.getRequest());
    FlowIdentifier flowIdentifier = client.getDefaultClient().sdxEndpoint().startByName(testDto.getName());
    testDto.setFlow("SDX start", flowIdentifier);
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(testDto.getName(), Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX start custom response: ", detailedResponse);
    return testDto;
}
Also used : SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier)

Example 25 with FlowIdentifier

use of com.sequenceiq.flow.api.model.FlowIdentifier in project cloudbreak by hortonworks.

the class SdxStopCustomAction method action.

@Override
public SdxCustomTestDto action(TestContext testContext, SdxCustomTestDto testDto, SdxClient client) throws Exception {
    Log.when(LOGGER, format(" Stop custom SDX: %s ", testDto.getName()));
    Log.whenJson(LOGGER, " SDX stop custom request: ", testDto.getRequest());
    FlowIdentifier flowIdentifier = client.getDefaultClient().sdxEndpoint().stopByName(testDto.getName());
    testDto.setFlow("SDX stop", flowIdentifier);
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(testDto.getName(), Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX stop custom response: ", detailedResponse);
    return testDto;
}
Also used : SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier)

Aggregations

FlowIdentifier (com.sequenceiq.flow.api.model.FlowIdentifier)150 Test (org.junit.jupiter.api.Test)55 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)37 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)18 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)15 StackV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request)14 SdxClusterDetailResponse (com.sequenceiq.sdx.api.model.SdxClusterDetailResponse)14 StackV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response)13 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)13 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)13 SdxClusterRequest (com.sequenceiq.sdx.api.model.SdxClusterRequest)10 Supplier (java.util.function.Supplier)10 ImageChangeDto (com.sequenceiq.cloudbreak.service.image.ImageChangeDto)9 Status (com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status)7 StackImageChangeV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackImageChangeV4Request)7 ImageInfoV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageInfoV4Response)7 UpgradeV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.upgrade.UpgradeV4Response)7 TransactionService (com.sequenceiq.cloudbreak.common.service.TransactionService)7 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)7 CloudbreakApiException (com.sequenceiq.cloudbreak.exception.CloudbreakApiException)7