@Override public DescribeSubnetsResult describeSubnets() { return describeSubnets(new DescribeSubnetsRequest()); }
/** * <p> * Describes one or more of your subnets. * </p> * <p> * For more information about subnets, see * <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html"> Your VPC and Subnets </a> * in the <i>Amazon Virtual Private Cloud User Guide</i> . * </p> * * @return The response from the DescribeSubnets service method, as * returned by AmazonEC2. * * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonEC2 indicating * either a problem with the data in the request, or a server side issue. */ public DescribeSubnetsResult describeSubnets() throws AmazonServiceException, AmazonClientException { return describeSubnets(new DescribeSubnetsRequest()); }
@Override public DescribeSubnetsResult describeSubnets(AmazonEC2Client ec2Client, DescribeSubnetsRequest describeSubnetsRequest) { return ec2Client.describeSubnets(describeSubnetsRequest); }
@Override public DescribeSubnetsResult describeSubnets(AmazonEC2Client ec2Client, DescribeSubnetsRequest describeSubnetsRequest) { return ec2Client.describeSubnets(describeSubnetsRequest); }
@Override public DescribeSubnetsResult describeSubnets() { return describeSubnets(new DescribeSubnetsRequest()); }
public static String getSubnetId(AmazonEC2Client ec2Client) { Subnet subnet = null; 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(); } }
public static String getSubnetId(AmazonEC2Client ec2Client) { Subnet subnet = null; 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(); } }
@Override protected void doScan() { rateLimit(); DescribeSubnetsResult result = getClient().describeSubnets(); GraphNodeGarbageCollector gc = newGarbageCollector().label("AwsSubnet").region(getRegion()); result.getSubnets().forEach(it -> { try { ObjectNode n = convertAwsObject(it, getRegion()); String cypher = "MERGE (v:AwsSubnet {aws_arn:{aws_arn}}) set v+={props}, v.updateTs=timestamp() return v"; NeoRxClient client = getNeoRxClient(); Preconditions.checkNotNull(client); client.execCypher(cypher, "aws_arn",n.get("aws_arn").asText(),"props",n).forEach(r->{ gc.MERGE_ACTION.accept(r); getShadowAttributeRemover().removeTagAttributes("AwsSubnet", n, r); }); incrementEntityCount(); } catch (RuntimeException e) { gc.markException(e); maybeThrow(e,"problem scanning subnets"); } }); gc.invoke(); }