Search in sources :

Example 1 with MockNetworkV1Parameters

use of com.sequenceiq.distrox.api.v1.distrox.model.network.mock.MockNetworkV1Parameters in project cloudbreak by hortonworks.

the class NetworkV1ToNetworkV4Converter method convertToMockNetworkV1Parameters.

private MockNetworkV1Parameters convertToMockNetworkV1Parameters(MockNetworkV4Parameters source) {
    MockNetworkV1Parameters response = new MockNetworkV1Parameters();
    response.setSubnetId(source.getSubnetId());
    response.setVpcId(source.getVpcId());
    response.setInternetGatewayId(source.getInternetGatewayId());
    return response;
}
Also used : MockNetworkV1Parameters(com.sequenceiq.distrox.api.v1.distrox.model.network.mock.MockNetworkV1Parameters)

Example 2 with MockNetworkV1Parameters

use of com.sequenceiq.distrox.api.v1.distrox.model.network.mock.MockNetworkV1Parameters in project cloudbreak by hortonworks.

the class NetworkV1ToNetworkV4Converter method convertToMockNetworkParams.

private MockNetworkV4Parameters convertToMockNetworkParams(Pair<MockNetworkV1Parameters, EnvironmentNetworkResponse> source) {
    EnvironmentNetworkResponse value = source.getValue();
    MockNetworkV1Parameters key = source.getKey();
    MockNetworkV4Parameters params = new MockNetworkV4Parameters();
    if (key != null) {
        String subnetId = key.getSubnetId();
        if (value != null) {
            evaluateIfTrueDoOtherwise(subnetId, StringUtils::isNotEmpty, params::setSubnetId, s -> params.setSubnetId(value.getPreferedSubnetId()));
        }
        params.setInternetGatewayId(key.getInternetGatewayId());
        params.setVpcId(key.getVpcId());
    }
    return params;
}
Also used : MockNetworkV1Parameters(com.sequenceiq.distrox.api.v1.distrox.model.network.mock.MockNetworkV1Parameters) StringUtils(org.apache.commons.lang3.StringUtils) EnvironmentNetworkResponse(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse) MockNetworkV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.MockNetworkV4Parameters)

Example 3 with MockNetworkV1Parameters

use of com.sequenceiq.distrox.api.v1.distrox.model.network.mock.MockNetworkV1Parameters in project cloudbreak by hortonworks.

the class MockCloudProvider method distroXNetworkParameters.

private MockNetworkV1Parameters distroXNetworkParameters() {
    MockNetworkV1Parameters params = new MockNetworkV1Parameters();
    params.setSubnetId(getSubnetId());
    params.setInternetGatewayId(getInternetGatewayId());
    params.setVpcId(getVpcId());
    return params;
}
Also used : MockNetworkV1Parameters(com.sequenceiq.distrox.api.v1.distrox.model.network.mock.MockNetworkV1Parameters)

Aggregations

MockNetworkV1Parameters (com.sequenceiq.distrox.api.v1.distrox.model.network.mock.MockNetworkV1Parameters)3 MockNetworkV4Parameters (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.MockNetworkV4Parameters)1 EnvironmentNetworkResponse (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse)1 StringUtils (org.apache.commons.lang3.StringUtils)1