use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response in project cloudbreak by hortonworks.
the class StackScalePostAction method action.
@Override
public StackTestDto action(TestContext testContext, StackTestDto testDto, CloudbreakClient client) throws Exception {
Log.when(LOGGER, String.format("Stack scale request on: %s. Hostgroup: %s, desiredCount: %d", testDto.getName(), request.getGroup(), request.getDesiredCount()));
Log.whenJson(LOGGER, " Stack scale request: ", testDto.getRequest());
FlowIdentifier flowIdentifier = client.getDefaultClient().stackV4Endpoint().putScaling(client.getWorkspaceId(), testDto.getName(), request, testContext.getActingUserCrn().getAccountId());
testDto.setFlow("Stack scale", flowIdentifier);
StackV4Response stackV4Response = client.getDefaultClient().stackV4Endpoint().get(client.getWorkspaceId(), testDto.getName(), new HashSet<>(), testContext.getActingUserCrn().getAccountId());
testDto.setResponse(stackV4Response);
Log.whenJson(LOGGER, " Stack scale response: ", stackV4Response);
LOGGER.info("Hardware info for stack after upscale: {}", stackV4Response.getHardwareInfoGroups());
return testDto;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response in project cloudbreak by hortonworks.
the class StackCreateAction method action.
@Override
public StackTestDto action(TestContext testContext, StackTestDto testDto, CloudbreakClient client) throws Exception {
Log.whenJson(LOGGER, " Stack create request: ", testDto.getRequest());
StackV4Response response = client.getDefaultClient().stackV4Endpoint().post(client.getWorkspaceId(), testDto.getRequest(), testContext.getActingUserCrn().getAccountId());
testDto.setResponse(response);
testDto.setFlow("Stack create", response.getFlowIdentifier());
Log.whenJson(LOGGER, " Stack create response ", response);
return testDto;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response in project cloudbreak by hortonworks.
the class DatalakeServiceTest method testAddSharedServiceResponseWhenDatalakeCrnIsNotNullAndDatalakeIsMissing.
@Test
public void testAddSharedServiceResponseWhenDatalakeCrnIsNotNullAndDatalakeIsMissing() {
lenient().when(stackService.getResourceBasicViewByResourceCrn(anyString())).thenReturn(Optional.empty());
Stack source = new Stack();
source.setDatalakeCrn("crn");
StackV4Response x = new StackV4Response();
underTest.addSharedServiceResponse(source, x);
verify(stackService, times(1)).getResourceBasicViewByResourceCrn("crn");
assertNull(x.getSharedService().getSharedClusterId());
assertNull(x.getSharedService().getSharedClusterName());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response in project cloudbreak by hortonworks.
the class DatalakeServiceTest method testAddSharedServiceResponseWhenDatalakeCrnIsNull.
@Test
public void testAddSharedServiceResponseWhenDatalakeCrnIsNull() {
Stack source = new Stack();
source.setDatalakeCrn(null);
StackV4Response x = new StackV4Response();
underTest.addSharedServiceResponse(source, x);
verify(stackService, never()).getByCrnOrElseNull("crn");
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response in project cloudbreak by hortonworks.
the class DatahubPollerProviderTest method testStartDistroXPoller.
@ParameterizedTest
@MethodSource("distroxStartStatuses")
void testStartDistroXPoller(Status s1Status, Status c1Status, Status s2Status, Status c2Status, AttemptState attemptState, String message, List<String> remaining) throws Exception {
List<String> pollingCrn = new ArrayList<>();
pollingCrn.add("crn1");
pollingCrn.add("crn2");
StackV4Response stack1 = getStackV4Response(s1Status, c1Status, "crn1");
StackV4Response stack2 = getStackV4Response(s2Status, c2Status, "crn2");
Mockito.when(datahubService.getByCrn("crn1", Collections.emptySet())).thenReturn(stack1);
Mockito.when(datahubService.getByCrn("crn2", Collections.emptySet())).thenReturn(stack2);
AttemptResult<Void> result = underTest.startDatahubClustersPoller(pollingCrn, ENV_ID).process();
assertEquals(attemptState, result.getState());
}
Aggregations