List of usage examples for com.amazonaws.services.ec2.model Subnet getState
public String getState()
The current state of the subnet.
From source file:com.infinitechaos.vpcviewer.web.rest.dto.SubnetDTO.java
License:Open Source License
public SubnetDTO(final Subnet subnet) { this.subnetId = subnet.getSubnetId(); this.vpcId = subnet.getVpcId(); this.state = subnet.getState(); this.availabilityZone = subnet.getAvailabilityZone(); this.cidrBlock = subnet.getCidrBlock(); this.tags.addAll(subnet.getTags().stream().map(TagDTO::new).collect(Collectors.toList())); this.name = subnet.getTags().stream().filter(t -> t.getKey().equals("Name")).findFirst().map(Tag::getValue) .orElse("n/a"); }
From source file:org.wildfly.camel.test.common.aws.EC2Utils.java
License:Apache License
public static String getSubnetId(AmazonEC2Client ec2Client) { Subnet subnet = null;//from w w w . j a v a2 s .c om for (Subnet aux : ec2Client.describeSubnets().getSubnets()) { System.out.println(); if (aux.getState().equals("available") && aux.getAvailabilityZone().startsWith("eu-west-1")) { subnet = aux; break; } } Assert.assertNotNull("Subnet not null", subnet); return subnet.getSubnetId(); }