Search in sources :

Example 1 with DistroXRepairV1Request

use of com.sequenceiq.distrox.api.v1.distrox.model.DistroXRepairV1Request in project cloudbreak by hortonworks.

the class DistroXRepairAction method createRepairRequest.

private DistroXRepairV1Request createRepairRequest() {
    DistroXRepairV1Request distroXRepairV1Request = new DistroXRepairV1Request();
    distroXRepairV1Request.setHostGroups(hostGroupTypes.stream().map(hostGroupType -> hostGroupType.getName()).collect(Collectors.toList()));
    return distroXRepairV1Request;
}
Also used : DistroXRepairV1Request(com.sequenceiq.distrox.api.v1.distrox.model.DistroXRepairV1Request)

Example 2 with DistroXRepairV1Request

use of com.sequenceiq.distrox.api.v1.distrox.model.DistroXRepairV1Request 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 3 with DistroXRepairV1Request

use of com.sequenceiq.distrox.api.v1.distrox.model.DistroXRepairV1Request 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 4 with DistroXRepairV1Request

use of com.sequenceiq.distrox.api.v1.distrox.model.DistroXRepairV1Request in project cloudbreak by hortonworks.

the class DistroXRepairInstancesAction method createRepairRequest.

private DistroXRepairV1Request createRepairRequest(List<String> instanceIds) {
    DistroXRepairV1Request distroXRepairV1Request = new DistroXRepairV1Request();
    DistroXRepairNodesV1Request nodes = new DistroXRepairNodesV1Request();
    nodes.setIds(instanceIds);
    distroXRepairV1Request.setNodes(nodes);
    return distroXRepairV1Request;
}
Also used : DistroXRepairV1Request(com.sequenceiq.distrox.api.v1.distrox.model.DistroXRepairV1Request) DistroXRepairNodesV1Request(com.sequenceiq.distrox.api.v1.distrox.model.DistroXRepairNodesV1Request)

Aggregations

DistroXRepairV1Request (com.sequenceiq.distrox.api.v1.distrox.model.DistroXRepairV1Request)4 StackV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response)2 FlowIdentifier (com.sequenceiq.flow.api.model.FlowIdentifier)2 DistroXRepairNodesV1Request (com.sequenceiq.distrox.api.v1.distrox.model.DistroXRepairNodesV1Request)1