use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response 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.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response 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.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response in project cloudbreak by hortonworks.
the class DistroXScaleStopInstancesAction method action.
@Override
public DistroXTestDto action(TestContext testContext, DistroXTestDto testDto, CloudbreakClient client) throws Exception {
Log.when(LOGGER, String.format(" Stopping instances [%s] for distrox '%s' Compute scaling... ", testDto.getInstanceIdsForAction(), testDto.getName()));
Log.whenJson(LOGGER, " Distrox Compute scale stop instances request: ", testDto.getRequest());
testDto.setFlow("scale stop", client.getDefaultClient().autoscaleEndpoint().stopInstancesForClusterName(testDto.getName(), testDto.getInstanceIdsForAction(), false, ScalingStrategy.STOPSTART));
StackV4Response stackV4Response = client.getDefaultClient().distroXV1Endpoint().getByName(testDto.getName(), new HashSet<>(Arrays.asList("hardware_info", "events")));
testDto.setResponse(stackV4Response);
Log.whenJson(LOGGER, " Distrox Compute scale stop instances response: ", stackV4Response);
LOGGER.info(String.format("Hardware info for distrox '%s' after stop instances for Compute scale: %s", testDto.getName(), stackV4Response.getHardwareInfoGroups()));
return testDto;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response 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;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response in project cloudbreak by hortonworks.
the class CheckVariant method action.
@Override
public DistroXTestDto action(TestContext testContext, DistroXTestDto testDto, CloudbreakClient client) throws Exception {
Log.when(LOGGER, " Checking the stack variant, expected: " + variant);
StackV4Response stackV4Response = client.getDefaultClient().distroXV1Endpoint().getByName(testDto.getName(), Collections.emptySet());
if (!stackV4Response.getVariant().equals(variant)) {
throw new TestFailException("Variants are mismatched: expected: " + variant + ", got: " + stackV4Response.getVariant());
}
Log.when(LOGGER, " Stack variant checked and matched");
return testDto;
}
Aggregations