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;
}
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;
}
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;
}
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;
}
Aggregations