Example usage for com.amazonaws.services.ec2.model Vpc getCidrBlock

List of usage examples for com.amazonaws.services.ec2.model Vpc getCidrBlock

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model Vpc getCidrBlock.

Prototype


public String getCidrBlock() 

Source Link

Document

The primary IPv4 CIDR block for the VPC.

Usage

From source file:com.infinitechaos.vpcviewer.web.rest.dto.VpcDTO.java

License:Open Source License

public VpcDTO(final Vpc vpc) {
    this.vpcId = vpc.getVpcId();
    this.cidrBlock = vpc.getCidrBlock();
    this.state = vpc.getState();
    this.tags.addAll(vpc.getTags().stream().map(TagDTO::new).collect(Collectors.toList()));

    this.name = vpc.getTags().stream().filter(t -> t.getKey().equals("Name")).findFirst().map(Tag::getValue)
            .orElse("n/a");
}

From source file:com.vmware.photon.controller.model.adapters.awsadapter.AWSUtils.java

License:Open Source License

/**
 * Gets the subnet associated with the default VPC.
 *//*from   ww  w . ja v a 2s. c  o m*/
public static String getDefaultVPCSubnet(AWSAllocation aws) {
    String subnet = null;
    DescribeVpcsResult result = aws.amazonEC2Client.describeVpcs();
    List<Vpc> vpcs = result.getVpcs();

    for (Vpc vpc : vpcs) {
        if (vpc.isDefault()) {
            subnet = vpc.getCidrBlock();
        }
    }
    return subnet;
}