Search in sources :

Example 16 with FlowIdentifier

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

the class DistroXRepairAction method action.

@Override
public DistroXTestDto action(TestContext testContext, DistroXTestDto testDto, CloudbreakClient client) throws Exception {
    DistroXRepairV1Request distroXRepairV1Request = createRepairRequest();
    Log.when(LOGGER, format(" Starting repair on DistroX: %s ", testDto.getName()));
    Log.whenJson(LOGGER, " DistroX  repair request: ", distroXRepairV1Request);
    FlowIdentifier flowIdentifier = client.getDefaultClient().distroXV1Endpoint().repairClusterByName(testDto.getName(), distroXRepairV1Request);
    testDto.setFlow("DistroX repair flow identifier", flowIdentifier);
    StackV4Response stackV4Response = client.getDefaultClient().distroXV1Endpoint().getByName(testDto.getName(), Collections.emptySet());
    testDto.setResponse(stackV4Response);
    Log.whenJson(LOGGER, " DistroX repair response: ", stackV4Response);
    return testDto;
}
Also used : StackV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response) DistroXRepairV1Request(com.sequenceiq.distrox.api.v1.distrox.model.DistroXRepairV1Request) FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier)

Example 17 with FlowIdentifier

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

the class DistroXRepairInstancesAction method action.

@Override
public DistroXTestDto action(TestContext testContext, DistroXTestDto testDto, CloudbreakClient client) throws Exception {
    DistroXRepairV1Request distroXRepairV1Request = createRepairRequest(testDto.getRepairableInstanceIds().orElse(Collections.emptyList()));
    Log.when(LOGGER, format("Starting repair instances on DistroX: %s ", testDto.getName()));
    Log.whenJson(LOGGER, "DistroX instance id based repair request: ", distroXRepairV1Request);
    FlowIdentifier flowIdentifier = client.getDefaultClient().distroXV1Endpoint().repairClusterByName(testDto.getName(), distroXRepairV1Request);
    testDto.setFlow("DistroX instance id based repair flow identifier", flowIdentifier);
    StackV4Response stackV4Response = client.getDefaultClient().distroXV1Endpoint().getByName(testDto.getName(), Collections.emptySet());
    testDto.setResponse(stackV4Response);
    Log.whenJson(LOGGER, " DistroX instance id based repair response: ", stackV4Response);
    return testDto;
}
Also used : StackV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response) DistroXRepairV1Request(com.sequenceiq.distrox.api.v1.distrox.model.DistroXRepairV1Request) FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier)

Example 18 with FlowIdentifier

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

the class SdxAutotlsCertRotationAction method action.

@Override
public SdxTestDto action(TestContext testContext, SdxTestDto testDto, SdxClient client) throws Exception {
    CertificatesRotationV4Request certificatesRotationV4Request = new CertificatesRotationV4Request();
    Log.when(LOGGER, " SDX endpoint: %s" + client.getDefaultClient().sdxEndpoint() + ", SDX's environment: " + testDto.getRequest().getEnvironment());
    Log.whenJson(LOGGER, " SDX autotls cert rotation request: ", certificatesRotationV4Request);
    FlowIdentifier flowIdentifier = client.getDefaultClient().sdxEndpoint().rotateAutoTlsCertificatesByName(testDto.getName(), new CertificatesRotationV4Request());
    testDto.setFlow("SDX autotls cert rotation", flowIdentifier);
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(testDto.getName(), Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX response after autotls cert rotation: ", detailedResponse);
    return testDto;
}
Also used : CertificatesRotationV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.CertificatesRotationV4Request) SdxClusterDetailResponse(com.sequenceiq.sdx.api.model.SdxClusterDetailResponse) FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier)

Example 19 with FlowIdentifier

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

the class DistroXStartAction method action.

@Override
public DistroXTestDto action(TestContext testContext, DistroXTestDto testDto, CloudbreakClient client) throws Exception {
    Log.when(LOGGER, format(" Starting Distrox: %s ", testDto.getName()));
    Log.whenJson(LOGGER, " Distrox start request: ", testDto.getRequest());
    FlowIdentifier flowIdentifier = client.getDefaultClient().distroXV1Endpoint().putStartByName(testDto.getName());
    testDto.setFlow("DistroX start", flowIdentifier);
    StackV4Response stackV4Response = client.getDefaultClient().distroXV1Endpoint().getByName(testDto.getName(), Collections.emptySet());
    testDto.setResponse(stackV4Response);
    Log.whenJson(LOGGER, " Distrox start response: ", stackV4Response);
    return testDto;
}
Also used : StackV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response) FlowIdentifier(com.sequenceiq.flow.api.model.FlowIdentifier)

Example 20 with FlowIdentifier

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

the class SdxDeleteAction method action.

@Override
public SdxTestDto action(TestContext testContext, SdxTestDto testDto, SdxClient client) throws Exception {
    Log.when(LOGGER, " SDX endpoint: %s" + client.getDefaultClient().sdxEndpoint() + ", SDX's environment: " + testDto.getRequest().getEnvironment());
    Log.whenJson(LOGGER, " SDX delete request: ", testDto.getRequest());
    FlowIdentifier flowIdentifier = client.getDefaultClient().sdxEndpoint().delete(testDto.getName(), false);
    testDto.setFlow("SDX delete", flowIdentifier);
    SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(testDto.getName(), Collections.emptySet());
    testDto.setResponse(detailedResponse);
    Log.whenJson(LOGGER, " SDX delete 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