use of com.sequenceiq.cloudbreak.api.model.v2.StackV2Request in project cloudbreak by hortonworks.
the class AbstractStackCreationV2Test method testStackCreation.
@Test
public void testStackCreation() throws Exception {
// GIVEN
IntegrationTestContext itContext = getItContext();
StackV2Request stackV2Request = itContext.getContextParam(CloudbreakV2Constants.STACK_CREATION_REQUEST, StackV2Request.class);
// WHEN
String stackId = getCloudbreakClient().stackV2Endpoint().postPrivate(stackV2Request).getId().toString();
// THEN
Assert.assertNotNull(stackId);
itContext.putContextParam(CloudbreakITContextConstants.STACK_ID, stackId, true);
itContext.putContextParam(CloudbreakV2Constants.STACK_NAME, stackV2Request.getGeneral().getName());
Map<String, String> desiredStatuses = new HashMap<>();
desiredStatuses.put("status", "AVAILABLE");
desiredStatuses.put("clusterStatus", "AVAILABLE");
CloudbreakUtil.waitAndCheckStatuses(getCloudbreakClient(), stackId, desiredStatuses);
}
use of com.sequenceiq.cloudbreak.api.model.v2.StackV2Request in project cloudbreak by hortonworks.
the class AbstractStackCreationV2Test method ambariParameters.
@BeforeMethod(dependsOnGroups = "V2StackCreationInit")
@Parameters({ "blueprintName", "enableSecurity", "kerberosMasterKey", "kerberosAdmin", "kerberosPassword" })
public void ambariParameters(@Optional("") String blueprintName, @Optional("false") boolean enableSecurity, @Optional String kerberosMasterKey, @Optional String kerberosAdmin, @Optional String kerberosPassword) {
IntegrationTestContext itContext = getItContext();
blueprintName = StringUtils.hasText(blueprintName) ? blueprintName : itContext.getContextParam(CloudbreakV2Constants.SSH_PUBLICKEY_ID);
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.AMBARI_USER_ID), "Ambari user is mandatory.");
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID), "Ambari password is mandatory.");
Assert.assertNotNull(blueprintName, "blueprint name is mandatory.");
StackV2Request stackV2Request = itContext.getContextParam(CloudbreakV2Constants.STACK_CREATION_REQUEST, StackV2Request.class);
ClusterV2Request clusterV2Request = new ClusterV2Request();
stackV2Request.setCluster(clusterV2Request);
AmbariV2Request ambariV2Request = new AmbariV2Request();
clusterV2Request.setAmbari(ambariV2Request);
ambariV2Request.setBlueprintName(blueprintName);
ambariV2Request.setUserName(itContext.getContextParam(CloudbreakITContextConstants.AMBARI_USER_ID));
ambariV2Request.setPassword(itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID));
GatewayJson gatewayJson = new GatewayJson();
gatewayJson.setEnableGateway(Boolean.FALSE);
gatewayJson.setExposedServices(ImmutableList.of("ALL"));
ambariV2Request.setGateway(gatewayJson);
if (enableSecurity) {
ambariV2Request.setEnableSecurity(enableSecurity);
KerberosRequest kerberosRequest = new KerberosRequest();
kerberosRequest.setMasterKey(kerberosMasterKey);
kerberosRequest.setAdmin(kerberosAdmin);
kerberosRequest.setPassword(kerberosPassword);
ambariV2Request.setKerberos(kerberosRequest);
}
}
use of com.sequenceiq.cloudbreak.api.model.v2.StackV2Request in project cloudbreak by hortonworks.
the class AbstractStackCreationV2Test method createNetworkRequest.
protected NetworkV2Request createNetworkRequest(IntegrationTestContext itContext, String subnetCidr) {
subnetCidr = StringUtils.hasText(subnetCidr) ? subnetCidr : itContext.getContextParam(CloudbreakV2Constants.SUBNET_CIDR);
Assert.assertNotNull(subnetCidr, "Subnet cidr is mandatory.");
StackV2Request stackV2Request = itContext.getContextParam(CloudbreakV2Constants.STACK_CREATION_REQUEST, StackV2Request.class);
NetworkV2Request networkRequest = new NetworkV2Request();
networkRequest.setSubnetCIDR(subnetCidr);
stackV2Request.setNetwork(networkRequest);
return networkRequest;
}
Aggregations