use of com.sequenceiq.cloudbreak.api.model.v2.NetworkV2Request in project cloudbreak by hortonworks.
the class OpenstackCloudProvider method network.
@Override
NetworkV2Request network() {
NetworkV2Request network = new NetworkV2Request();
network.setSubnetCIDR("10.0.0.0/16");
Map<String, Object> parameters = new HashMap<>();
String defaultNetId = "999e09bc-cf75-4a19-98fb-c0b4ddee6d93";
String netIdParameter = getTestParameter().get("integrationtest.openstack.publicNetId");
parameters.put("networkingOption", "self-service");
parameters.put("publicNetId", netIdParameter == null ? defaultNetId : netIdParameter);
network.setParameters(parameters);
return network;
}
use of com.sequenceiq.cloudbreak.api.model.v2.NetworkV2Request in project cloudbreak by hortonworks.
the class AwsCloudProvider method network.
@Override
NetworkV2Request network() {
NetworkV2Request network = new NetworkV2Request();
network.setSubnetCIDR("10.0.0.0/16");
return network;
}
use of com.sequenceiq.cloudbreak.api.model.v2.NetworkV2Request in project cloudbreak by hortonworks.
the class NetworkToNetworkV2RequestConverter method convert.
@Override
public NetworkV2Request convert(Network source) {
NetworkV2Request networkV2Request = new NetworkV2Request();
networkV2Request.setParameters(cleanMap(source.getAttributes().getMap()));
networkV2Request.setSubnetCIDR(source.getSubnetCIDR());
return networkV2Request;
}
use of com.sequenceiq.cloudbreak.api.model.v2.NetworkV2Request in project cloudbreak by hortonworks.
the class OpenstackStackCreationV2Test method networkParams.
@BeforeMethod(dependsOnGroups = "V2StackCreationInit")
@Parameters({ "subnetCidr", "floatingPool" })
public void networkParams(String subnetCidr, @Optional("") String floatingPool) {
IntegrationTestContext itContext = getItContext();
NetworkV2Request networkV2Request = createNetworkRequest(itContext, subnetCidr);
floatingPool = StringUtils.hasText(floatingPool) ? floatingPool : itContext.getContextParam(CloudbreakV2Constants.OPENSTACK_FLOATING_POOL);
Map<String, Object> networkParameters = Maps.newHashMap();
if (StringUtils.hasText(floatingPool)) {
networkParameters.put("publicNetId", floatingPool);
}
networkV2Request.setParameters(networkParameters);
}
use of com.sequenceiq.cloudbreak.api.model.v2.NetworkV2Request 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