use of com.sequenceiq.distrox.api.v1.distrox.model.DistroXScaleV1Request in project cloudbreak by hortonworks.
the class DistroXScaleAction method action.
@Override
public DistroXTestDto action(TestContext testContext, DistroXTestDto testDto, CloudbreakClient client) throws Exception {
Log.when(LOGGER, String.format("Distrox scale request on: %s. Hostgroup: %s, desiredCount: %d", testDto.getName(), hostGroup, desiredCount));
Log.whenJson(LOGGER, " Distrox scale request: ", testDto.getRequest());
DistroXScaleV1Request scaleRequest = new DistroXScaleV1Request();
scaleRequest.setGroup(hostGroup);
scaleRequest.setDesiredCount(desiredCount);
scaleRequest.setAdjustmentType(adjustmentType);
scaleRequest.setThreshold(threshold);
FlowIdentifier flowIdentifier = client.getDefaultClient().distroXV1Endpoint().putScalingByName(testDto.getName(), scaleRequest);
StackV4Response stackV4Response = client.getDefaultClient().distroXV1Endpoint().getByName(testDto.getName(), new HashSet<>(Arrays.asList("hardware_info", "events")));
testDto.setFlow("Distrox scale", flowIdentifier);
testDto.setResponse(stackV4Response);
Log.whenJson(LOGGER, " Distrox scale response: ", stackV4Response);
LOGGER.info("Hardware info for stack after upscale: {}", stackV4Response.getHardwareInfoGroups());
return testDto;
}
Aggregations