use of com.amazonaws.services.ec2.model.DescribeRouteTablesResult in project photon-model by vmware.
the class AWSNetworkClient method getMainRouteTable.
/**
* Get the main route table for a given VPC
*/
public RouteTable getMainRouteTable(String vpcId) {
// build filter list
List<Filter> filters = new ArrayList<>();
filters.add(AWSUtils.getFilter(AWSUtils.AWS_FILTER_VPC_ID, vpcId));
filters.add(AWSUtils.getFilter(AWS_MAIN_ROUTE_ASSOCIATION, "true"));
DescribeRouteTablesRequest req = new DescribeRouteTablesRequest().withFilters(filters);
DescribeRouteTablesResult res = this.client.describeRouteTables(req);
List<RouteTable> routeTables = res.getRouteTables();
return routeTables.isEmpty() ? null : routeTables.get(0);
}
Aggregations