Search in sources :

Example 1 with AzureNetworkV4Parameters

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters in project cloudbreak by hortonworks.

the class NetworkV4BaseTest method testAzureNetworkPublicIpIsNotEmpty.

@Test
void testAzureNetworkPublicIpIsNotEmpty() {
    AzureNetworkV4Parameters networkParameters = new AzureNetworkV4Parameters();
    networkParameters.setNoPublicIp(true);
    underTest.setAzure(networkParameters);
    assertTrue(underTest.isNoPublicIp().get());
}
Also used : AzureNetworkV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters) Test(org.junit.jupiter.api.Test)

Example 2 with AzureNetworkV4Parameters

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters in project cloudbreak by hortonworks.

the class NetworkV1ToNetworkV4ConverterTest method createAzureNetworkV4Parameters.

private AzureNetworkV4Parameters createAzureNetworkV4Parameters() {
    AzureNetworkV4Parameters p = new AzureNetworkV4Parameters();
    p.setNetworkId("someNetworkId");
    p.setNoPublicIp(true);
    p.setSubnetId(SUBNET_ID);
    p.setResourceGroupName("someResourceGroupName");
    return p;
}
Also used : AzureNetworkV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters)

Example 3 with AzureNetworkV4Parameters

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters in project cloudbreak by hortonworks.

the class NetworkV1ToNetworkV4Converter method convertToAzureStackRequest.

private AzureNetworkV4Parameters convertToAzureStackRequest(Pair<AzureNetworkV1Parameters, EnvironmentNetworkResponse> source) {
    EnvironmentNetworkResponse value = source.getValue();
    AzureNetworkV1Parameters key = source.getKey();
    AzureNetworkV4Parameters response = new AzureNetworkV4Parameters();
    if (key != null) {
        response.setNetworkId(value.getAzure().getNetworkId());
        response.setNoPublicIp(value.getAzure().getNoPublicIp());
        response.setResourceGroupName(value.getAzure().getResourceGroupName());
        response.setDatabasePrivateDnsZoneId(value.getAzure().getDatabasePrivateDnsZoneId());
        String subnetId = key.getSubnetId();
        if (!Strings.isNullOrEmpty(subnetId)) {
            response.setSubnetId(subnetId);
        } else if (source.getValue() != null) {
            response.setSubnetId(source.getValue().getPreferedSubnetId());
        }
    }
    return response;
}
Also used : AzureNetworkV1Parameters(com.sequenceiq.distrox.api.v1.distrox.model.network.azure.AzureNetworkV1Parameters) AzureNetworkV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters) EnvironmentNetworkResponse(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse)

Example 4 with AzureNetworkV4Parameters

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters in project cloudbreak by hortonworks.

the class NetworkValidationServiceTest method testNetworkIfAzureRequestHasSubnetThenShouldReturnTrue.

@Test
public void testNetworkIfAzureRequestHasSubnetThenShouldReturnTrue() {
    NetworkV4Request networkV4Request = new NetworkV4Request();
    AzureNetworkV4Parameters azureNetworkV4Parameters = new AzureNetworkV4Parameters();
    azureNetworkV4Parameters.setSubnetId("subnet");
    networkV4Request.setAzure(azureNetworkV4Parameters);
    Assert.assertFalse(underTest.shouldAddNetwork(CloudPlatform.AZURE.name(), networkV4Request));
}
Also used : AzureNetworkV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters) NetworkV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.network.NetworkV4Request) Test(org.junit.Test)

Example 5 with AzureNetworkV4Parameters

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters in project cloudbreak by hortonworks.

the class NetworkValidationServiceTest method testNetworkIfAzureRequestEmptyThenShouldReturnTrue.

@Test
public void testNetworkIfAzureRequestEmptyThenShouldReturnTrue() {
    NetworkV4Request networkV4Request = new NetworkV4Request();
    AzureNetworkV4Parameters azureNetworkV4Parameters = new AzureNetworkV4Parameters();
    networkV4Request.setAzure(azureNetworkV4Parameters);
    Assert.assertTrue(underTest.shouldAddNetwork(CloudPlatform.AZURE.name(), networkV4Request));
}
Also used : AzureNetworkV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters) NetworkV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.network.NetworkV4Request) Test(org.junit.Test)

Aggregations

AzureNetworkV4Parameters (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters)6 NetworkV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.network.NetworkV4Request)2 Test (org.junit.Test)2 AzureNetworkV1Parameters (com.sequenceiq.distrox.api.v1.distrox.model.network.azure.AzureNetworkV1Parameters)1 EnvironmentNetworkResponse (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse)1 Test (org.junit.jupiter.api.Test)1