Search in sources :

Example 1 with EnvironmentNetworkAwsParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams in project cloudbreak by hortonworks.

the class AwsEnvironmentNetworkConverterTest method getAttributesForLegacyNetwork.

@Test
void getAttributesForLegacyNetwork() {
    EnvironmentNetworkResponse source = mock(EnvironmentNetworkResponse.class);
    EnvironmentNetworkAwsParams aws = mock(EnvironmentNetworkAwsParams.class);
    when(source.getAws()).thenReturn(aws);
    when(aws.getVpcId()).thenReturn("my_vpc_id");
    Map<String, Object> result = converter.getAttributesForLegacyNetwork(source);
    assertEquals("my_vpc_id", result.get("vpcId"));
}
Also used : EnvironmentNetworkAwsParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams) EnvironmentNetworkResponse(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse) Test(org.junit.jupiter.api.Test)

Example 2 with EnvironmentNetworkAwsParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams in project cloudbreak by hortonworks.

the class DistroXV1RequestToStackV4RequestConverterTest method createAwsNetworkParams.

private EnvironmentNetworkAwsParams createAwsNetworkParams() {
    EnvironmentNetworkAwsParams awsNetwork = new EnvironmentNetworkAwsParams();
    awsNetwork.setVpcId("myvpc");
    return awsNetwork;
}
Also used : EnvironmentNetworkAwsParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams)

Example 3 with EnvironmentNetworkAwsParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams in project cloudbreak by hortonworks.

the class AwsCloudProvider method environmentNetworkParameters.

private EnvironmentNetworkAwsParams environmentNetworkParameters() {
    EnvironmentNetworkAwsParams environmentNetworkAwsParams = new EnvironmentNetworkAwsParams();
    environmentNetworkAwsParams.setVpcId(getVpcId());
    return environmentNetworkAwsParams;
}
Also used : EnvironmentNetworkAwsParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams)

Example 4 with EnvironmentNetworkAwsParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams in project cloudbreak by hortonworks.

the class ProvisionerServiceTest method getEnvironmentResponse.

private DetailedEnvironmentResponse getEnvironmentResponse() {
    DetailedEnvironmentResponse detailedEnvironmentResponse = new DetailedEnvironmentResponse();
    detailedEnvironmentResponse.setName("env");
    detailedEnvironmentResponse.setEnvironmentStatus(EnvironmentStatus.AVAILABLE);
    CompactRegionResponse compactRegionResponse = new CompactRegionResponse();
    compactRegionResponse.setNames(Lists.newArrayList("eu-west-1"));
    compactRegionResponse.setDisplayNames(Map.of("eu-west-1", "ireland"));
    detailedEnvironmentResponse.setRegions(compactRegionResponse);
    detailedEnvironmentResponse.setCrn(CrnTestUtil.getEnvironmentCrnBuilder().setResource(UUID.randomUUID().toString()).setAccountId(UUID.randomUUID().toString()).build().toString());
    EnvironmentNetworkResponse network = new EnvironmentNetworkResponse();
    network.setCrn(CrnTestUtil.getNetworkCrnBuilder().setResource(UUID.randomUUID().toString()).setAccountId(UUID.randomUUID().toString()).build().toString());
    EnvironmentNetworkAwsParams environmentNetworkAwsParams = new EnvironmentNetworkAwsParams();
    environmentNetworkAwsParams.setVpcId("vpc");
    network.setAws(environmentNetworkAwsParams);
    network.setSubnetIds(Sets.newHashSet("subnet"));
    CloudSubnet cloudSubnet = new CloudSubnet();
    cloudSubnet.setId("subnet");
    cloudSubnet.setName("subnet");
    cloudSubnet.setAvailabilityZone("eu-west-1a");
    Map<String, CloudSubnet> cloudSubnetMap = Map.of("subnet", cloudSubnet);
    network.setSubnetMetas(cloudSubnetMap);
    detailedEnvironmentResponse.setNetwork(network);
    EnvironmentAuthenticationResponse authentication = new EnvironmentAuthenticationResponse();
    authentication.setPublicKey("ssh-public-key");
    detailedEnvironmentResponse.setAuthentication(authentication);
    return detailedEnvironmentResponse;
}
Also used : CompactRegionResponse(com.sequenceiq.environment.api.v1.environment.model.response.CompactRegionResponse) EnvironmentNetworkAwsParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams) EnvironmentAuthenticationResponse(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentAuthenticationResponse) DetailedEnvironmentResponse(com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse) EnvironmentNetworkResponse(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) CloudSubnet(com.sequenceiq.cloudbreak.cloud.model.CloudSubnet)

Example 5 with EnvironmentNetworkAwsParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams in project cloudbreak by hortonworks.

the class NetworkRequestToDtoConverterTest method createAwsParams.

private EnvironmentNetworkAwsParams createAwsParams() {
    EnvironmentNetworkAwsParams awsParams = new EnvironmentNetworkAwsParams();
    awsParams.setVpcId(NETWORK_ID);
    return awsParams;
}
Also used : EnvironmentNetworkAwsParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams)

Aggregations

EnvironmentNetworkAwsParams (com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams)6 EnvironmentNetworkResponse (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse)3 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)2 CloudSubnet (com.sequenceiq.cloudbreak.cloud.model.CloudSubnet)1 CompactRegionResponse (com.sequenceiq.environment.api.v1.environment.model.response.CompactRegionResponse)1 EnvironmentAuthenticationResponse (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentAuthenticationResponse)1 Test (org.junit.jupiter.api.Test)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1