Search in sources :

Example 6 with GcpNetwork

use of com.sequenceiq.environment.network.dao.domain.GcpNetwork in project cloudbreak by hortonworks.

the class GcpEnvironmentNetworkConverter method setProviderSpecificFields.

@Override
NetworkDto setProviderSpecificFields(NetworkDto.Builder builder, BaseNetwork network) {
    GcpNetwork gcpNetwork = (GcpNetwork) network;
    GcpParams.Builder gcpParamsBuilder = GcpParams.builder();
    Optional.ofNullable(gcpNetwork.getNetworkId()).ifPresent(gcpParamsBuilder::withNetworkId);
    Optional.ofNullable(gcpNetwork.getNoFirewallRules()).ifPresent(gcpParamsBuilder::withNoFirewallRules);
    Optional.ofNullable(gcpNetwork.getNoPublicIp()).ifPresent(gcpParamsBuilder::withNoPublicIp);
    Optional.ofNullable(gcpNetwork.getSharedProjectId()).ifPresent(gcpParamsBuilder::withSharedProjectId);
    return builder.withGcp(gcpParamsBuilder.build()).build();
}
Also used : GcpParams(com.sequenceiq.environment.network.dto.GcpParams) GcpNetwork(com.sequenceiq.environment.network.dao.domain.GcpNetwork)

Aggregations

GcpNetwork (com.sequenceiq.environment.network.dao.domain.GcpNetwork)6 Network (com.sequenceiq.cloudbreak.cloud.model.Network)3 BaseNetwork (com.sequenceiq.environment.network.dao.domain.BaseNetwork)3 NetworkCidr (com.sequenceiq.cloudbreak.cloud.network.NetworkCidr)2 CloudPlatform (com.sequenceiq.cloudbreak.common.mappable.CloudPlatform)2 Credential (com.sequenceiq.environment.credential.domain.Credential)2 Environment (com.sequenceiq.environment.environment.domain.Environment)2 AuthenticationDto (com.sequenceiq.environment.environment.dto.AuthenticationDto)2 EnvironmentBackup (com.sequenceiq.environment.environment.dto.EnvironmentBackup)2 EnvironmentEditDto (com.sequenceiq.environment.environment.dto.EnvironmentEditDto)2 SecurityAccessDto (com.sequenceiq.environment.environment.dto.SecurityAccessDto)2 EnvironmentTelemetry (com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry)2 AwsNetwork (com.sequenceiq.environment.network.dao.domain.AwsNetwork)2 GcpParams (com.sequenceiq.environment.network.dto.GcpParams)2 NetworkDto (com.sequenceiq.environment.network.dto.NetworkDto)2 EnvironmentNetworkConverter (com.sequenceiq.environment.network.v1.converter.EnvironmentNetworkConverter)2 ParametersDto (com.sequenceiq.environment.parameter.dto.ParametersDto)2 ArrayList (java.util.ArrayList)2 Test (org.junit.jupiter.api.Test)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2