Search in sources :

Example 1 with GcpNetworkV1Parameters

use of com.sequenceiq.distrox.api.v1.distrox.model.network.gcp.GcpNetworkV1Parameters in project cloudbreak by hortonworks.

the class NetworkV1ToNetworkV4Converter method convertToGcpNetworkV1Parameters.

private GcpNetworkV1Parameters convertToGcpNetworkV1Parameters(GcpNetworkV4Parameters source) {
    GcpNetworkV1Parameters response = new GcpNetworkV1Parameters();
    response.setSubnetId(source.getSubnetId());
    return response;
}
Also used : GcpNetworkV1Parameters(com.sequenceiq.distrox.api.v1.distrox.model.network.gcp.GcpNetworkV1Parameters)

Example 2 with GcpNetworkV1Parameters

use of com.sequenceiq.distrox.api.v1.distrox.model.network.gcp.GcpNetworkV1Parameters in project cloudbreak by hortonworks.

the class NetworkV1ToNetworkV4Converter method convertToGcpStackRequest.

private GcpNetworkV4Parameters convertToGcpStackRequest(Pair<GcpNetworkV1Parameters, EnvironmentNetworkResponse> source) {
    EnvironmentNetworkResponse value = source.getValue();
    GcpNetworkV1Parameters key = source.getKey();
    GcpNetworkV4Parameters response = new GcpNetworkV4Parameters();
    if (key != null) {
        response.setNetworkId(value.getGcp().getNetworkId());
        response.setNoFirewallRules(value.getGcp().getNoFirewallRules());
        response.setNoPublicIp(value.getGcp().getNoPublicIp());
        response.setSharedProjectId(value.getGcp().getSharedProjectId());
        String subnetId = key.getSubnetId();
        if (!Strings.isNullOrEmpty(subnetId)) {
            response.setSubnetId(subnetId);
        } else {
            response.setSubnetId(getFirstSubnetIdFromEnvironment(value));
        }
    }
    return response;
}
Also used : GcpNetworkV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.GcpNetworkV4Parameters) EnvironmentNetworkResponse(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse) GcpNetworkV1Parameters(com.sequenceiq.distrox.api.v1.distrox.model.network.gcp.GcpNetworkV1Parameters)

Aggregations

GcpNetworkV1Parameters (com.sequenceiq.distrox.api.v1.distrox.model.network.gcp.GcpNetworkV1Parameters)2 GcpNetworkV4Parameters (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.GcpNetworkV4Parameters)1 EnvironmentNetworkResponse (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse)1