Search in sources :

Example 1 with AzureNetwork

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

the class EnvironmentTestData method newNetwork.

private static BaseNetwork newNetwork() {
    AzureNetwork azureNetwork = new AzureNetwork();
    azureNetwork.setNetworkId(NETWORK_ID);
    return azureNetwork;
}
Also used : AzureNetwork(com.sequenceiq.environment.network.dao.domain.AzureNetwork)

Example 2 with AzureNetwork

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

the class AzureEnvironmentNetworkConverter method createProviderSpecificNetwork.

@Override
BaseNetwork createProviderSpecificNetwork(NetworkDto network) {
    AzureNetwork azureNetwork = new AzureNetwork();
    AzureParams azureParams = network.getAzure();
    if (azureParams != null) {
        azureNetwork.setNetworkId(azureParams.getNetworkId());
        azureNetwork.setResourceGroupName(azureParams.getResourceGroupName());
        azureNetwork.setNoPublicIp(azureParams.isNoPublicIp());
        if (ServiceEndpointCreation.ENABLED_PRIVATE_ENDPOINT.equals(network.getServiceEndpointCreation())) {
            azureNetwork.setDatabasePrivateDnsZoneId(azureParams.getDatabasePrivateDnsZoneId());
        }
    }
    return azureNetwork;
}
Also used : AzureParams(com.sequenceiq.environment.network.dto.AzureParams) AzureNetwork(com.sequenceiq.environment.network.dao.domain.AzureNetwork)

Example 3 with AzureNetwork

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

the class AzureEnvironmentNetworkConverter method setCreatedCloudNetwork.

@Override
public BaseNetwork setCreatedCloudNetwork(BaseNetwork baseNetwork, CreatedCloudNetwork createdCloudNetwork) {
    AzureNetwork azureNetwork = (AzureNetwork) baseNetwork;
    azureNetwork.setName(createdCloudNetwork.getStackName());
    azureNetwork.setNetworkId(createdCloudNetwork.getNetworkId());
    azureNetwork.setResourceGroupName(String.valueOf(createdCloudNetwork.getProperties().get("resourceGroupName")));
    azureNetwork.setSubnetMetas(createdCloudNetwork.getSubnets().stream().collect(Collectors.toMap(CreatedSubnet::getSubnetId, subnet -> new CloudSubnet(subnet.getSubnetId(), subnet.getSubnetId(), subnet.getAvailabilityZone(), subnet.getCidr(), subnet.isPublicSubnet(), subnet.isMapPublicIpOnLaunch(), subnet.isIgwAvailable(), subnet.getType()))));
    return azureNetwork;
}
Also used : CreatedSubnet(com.sequenceiq.cloudbreak.cloud.model.network.CreatedSubnet) AzureNetwork(com.sequenceiq.environment.network.dao.domain.AzureNetwork) CloudSubnet(com.sequenceiq.cloudbreak.cloud.model.CloudSubnet)

Example 4 with AzureNetwork

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

the class EnvironmentNetworkServiceTest method getNetwork.

private BaseNetwork getNetwork() {
    AzureNetwork azureNetwork = new AzureNetwork();
    azureNetwork.setNetworkId(NETWORK_ID);
    return azureNetwork;
}
Also used : AzureNetwork(com.sequenceiq.environment.network.dao.domain.AzureNetwork)

Example 5 with AzureNetwork

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

the class NetworkCreationRequestFactoryTest method getNetwork.

private BaseNetwork getNetwork() {
    AzureNetwork azureNetwork = new AzureNetwork();
    azureNetwork.setNetworkId(String.valueOf(NETWORK_ID));
    azureNetwork.setResourceGroupName(LEGACY_RG);
    return azureNetwork;
}
Also used : AzureNetwork(com.sequenceiq.environment.network.dao.domain.AzureNetwork)

Aggregations

AzureNetwork (com.sequenceiq.environment.network.dao.domain.AzureNetwork)15 Test (org.junit.jupiter.api.Test)7 NetworkDto (com.sequenceiq.environment.network.dto.NetworkDto)4 CreatedCloudNetwork (com.sequenceiq.cloudbreak.cloud.model.network.CreatedCloudNetwork)3 Environment (com.sequenceiq.environment.environment.domain.Environment)3 Network (com.sequenceiq.cloudbreak.cloud.model.Network)2 CreatedSubnet (com.sequenceiq.cloudbreak.cloud.model.network.CreatedSubnet)2 CloudPlatformVariant (com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant)1 CloudSubnet (com.sequenceiq.cloudbreak.cloud.model.CloudSubnet)1 Credential (com.sequenceiq.environment.credential.domain.Credential)1 Region (com.sequenceiq.environment.environment.domain.Region)1 EnvironmentDto (com.sequenceiq.environment.environment.dto.EnvironmentDto)1 BaseNetwork (com.sequenceiq.environment.network.dao.domain.BaseNetwork)1 AzureParams (com.sequenceiq.environment.network.dto.AzureParams)1 HashMap (java.util.HashMap)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1