Search in sources :

Example 1 with NetworkV2Request

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;
}
Also used : HashMap(java.util.HashMap) NetworkV2Request(com.sequenceiq.cloudbreak.api.model.v2.NetworkV2Request)

Example 2 with NetworkV2Request

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;
}
Also used : NetworkV2Request(com.sequenceiq.cloudbreak.api.model.v2.NetworkV2Request)

Example 3 with NetworkV2Request

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;
}
Also used : NetworkV2Request(com.sequenceiq.cloudbreak.api.model.v2.NetworkV2Request)

Example 4 with 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);
}
Also used : IntegrationTestContext(com.sequenceiq.it.IntegrationTestContext) NetworkV2Request(com.sequenceiq.cloudbreak.api.model.v2.NetworkV2Request) Parameters(org.testng.annotations.Parameters) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 5 with NetworkV2Request

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;
}
Also used : StackV2Request(com.sequenceiq.cloudbreak.api.model.v2.StackV2Request) NetworkV2Request(com.sequenceiq.cloudbreak.api.model.v2.NetworkV2Request)

Aggregations

NetworkV2Request (com.sequenceiq.cloudbreak.api.model.v2.NetworkV2Request)7 StackV2Request (com.sequenceiq.cloudbreak.api.model.v2.StackV2Request)1 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)1 HashMap (java.util.HashMap)1 BeforeMethod (org.testng.annotations.BeforeMethod)1 Parameters (org.testng.annotations.Parameters)1