use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.StackV4Endpoint in project cloudbreak by hortonworks.
the class SdxCcmUpgradeServiceTest method testInitAndWaitForStackUpgrade.
@Test
void testInitAndWaitForStackUpgrade() {
when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn:altus:iam:us-west-1:altus:user:__internal__actor__");
FlowIdentifier flowId = new FlowIdentifier(FlowType.FLOW, "pollableId");
StackCcmUpgradeV4Response upgradeResponse = new StackCcmUpgradeV4Response(flowId);
when(stackV4Endpoint.upgradeCcmByCrnInternal(eq(0L), eq(STACK_CRN), any())).thenReturn(upgradeResponse);
PollingConfig pc = new PollingConfig(1L, TimeUnit.HOURS, 1L, TimeUnit.HOURS);
SdxCluster sdx = getSdxCluster();
underTest.initAndWaitForStackUpgrade(sdx, pc);
verify(stackV4Endpoint).upgradeCcmByCrnInternal(any(), eq(STACK_CRN), any());
verify(cloudbreakPoller).pollCcmUpgradeUntilAvailable(sdx, pc);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.StackV4Endpoint in project cloudbreak by hortonworks.
the class StackRequestAction method action.
@Override
public StackTestDto action(TestContext testContext, StackTestDto testDto, CloudbreakClient client) throws Exception {
Log.when(LOGGER, " Stack get cli skeleton:" + testDto.getName());
StackV4Request request = client.getDefaultClient().stackV4Endpoint().getRequestfromName(client.getWorkspaceId(), testDto.getName(), testContext.getActingUserCrn().getAccountId());
testDto.setRequest(request);
Log.whenJson(LOGGER, " get cli skeleton was successfully:\n", testDto.getRequest());
return testDto;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.StackV4Endpoint 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.StackV4Endpoint 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.StackV4Endpoint in project cloudbreak by hortonworks.
the class ProvisionerServiceTest method startForcedStackDeletionStackFound.
@Test
void startForcedStackDeletionStackFound() {
long clusterId = CLUSTER_ID.incrementAndGet();
SdxCluster sdxCluster = generateValidSdxCluster(clusterId);
when(sdxService.getById(clusterId)).thenReturn(sdxCluster);
StackV4Response stackV4Response = new StackV4Response();
stackV4Response.setStatus(Status.CREATE_FAILED);
when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn:cdp:datahub:us-west-1:altus:user:__internal__actor__");
when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
underTest.startStackDeletion(clusterId, true);
verify(stackV4Endpoint).deleteInternal(eq(0L), eq(null), eq(true), nullable(String.class));
}
Aggregations