Java 类com.amazonaws.services.ec2.model.DescribeRouteTablesRequest 实例源码

项目:photon-model    文件:AWSNetworkClient.java   
/**
 * 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);
}
项目:photon-model    文件:AWSNetworkStateEnumerationAdapterService.java   
/**
 * Gets the main route table information associated with a VPC that is being mapped to a network
 * state in the system. *
 */
private void getMainRouteTableInformation(AWSNetworkStateCreationContext context,
        AWSNetworkStateCreationStage next) {
    DescribeRouteTablesRequest routeTablesRequest = new DescribeRouteTablesRequest();
    List<String> vpcList = new ArrayList<>(context.vpcs.keySet());

    // build filter list
    List<Filter> filters = new ArrayList<>();
    filters.add(new Filter(AWS_FILTER_VPC_ID, vpcList));
    filters.add(AWSUtils.getFilter(AWS_MAIN_ROUTE_ASSOCIATION, "true"));

    AWSMainRouteTableAsyncHandler asyncHandler = new AWSMainRouteTableAsyncHandler(next,
            context);
    context.amazonEC2Client.describeRouteTablesAsync(routeTablesRequest, asyncHandler);
}
项目:photon-model    文件:AWSNetworkStateEnumerationAdapterService.java   
/**
 * Update the main route table information for the VPC that is being mapped to a network
 * state. Query AWS for the main route tables with a list of VPCs. From the result set find
 * the relevant route table Id and upda
 */
@Override
protected void consumeSuccess(DescribeRouteTablesRequest request,
        DescribeRouteTablesResult result) {
    for (RouteTable routeTable : result.getRouteTables()) {
        if (this.context.vpcs.containsKey(routeTable.getVpcId())) {
            NetworkState networkStateToUpdate = this.context.vpcs
                    .get(routeTable.getVpcId());
            networkStateToUpdate.customProperties.put(AWS_VPC_ROUTE_TABLE_ID,
                    routeTable.getRouteTableId());
            this.context.vpcs.put(routeTable.getVpcId(),
                    networkStateToUpdate);
        }
    }
}
项目:vpcviewer    文件:VpcServiceImpl.java   
@Override
@Cacheable(value = CachingConfiguration.ROUTE_TABLE_CACHE, key = "#vpcId", condition = "#bypassCache == false")
public List<RouteTable> getRouteTablesForVpcInRegion(final String vpcId, final String region, boolean bypassCache) {
    LOG.info("Retrieving route tables for VPC {} in region {} ({})", vpcId, region, bypassCache);
    DescribeRouteTablesRequest request = new DescribeRouteTablesRequest()
        .withFilters(new Filter()
            .withName("vpc-id")
            .withValues(vpcId));
    DescribeRouteTablesResult result = getClientForRegion(region).describeRouteTables(request);
    return result.getRouteTables();
}
项目:aws-sdk-java-resources    文件:RouteTableImpl.java   
@Override
public RouteTableAssociationCollection getAssociations(
        DescribeRouteTablesRequest request) {

    ResourceCollectionImpl result = resource.getCollection("Associations",
            request);

    if (result == null) return null;
    return new RouteTableAssociationCollectionImpl(result);
}
项目:aws-sdk-java-resources    文件:VpcImpl.java   
@Override
public RouteTableCollection getRouteTables(DescribeRouteTablesRequest
        request) {

    ResourceCollectionImpl result = resource.getCollection("RouteTables",
            request);

    if (result == null) return null;
    return new RouteTableCollectionImpl(result);
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public RouteTableCollection getRouteTables(DescribeRouteTablesRequest
        request) {

    ResourceCollectionImpl result = service.getCollection("RouteTables",
            request);

    if (result == null) return null;
    return new RouteTableCollectionImpl(result);
}
项目:clouck    文件:Ec2WrapperImpl.java   
@Override
public List<AbstractResource<?>> describeRouteTables(Account account, Region region, DateTime dt, Ec2Filter... filters) {
    AmazonEC2 ec2 = findClient(account, region);

    DescribeRouteTablesRequest req = new DescribeRouteTablesRequest();
    for (Ec2Filter filter : filters) {
        Filter f = new Filter().withName(filter.getName()).withValues(filter.getValues());
        req.withFilters(f);
    }

    log.debug("start describing route tables for account:{} in region:{} via api", account.getId() + "=>" + account.getName(), region);
    DescribeRouteTablesResult res = ec2.describeRouteTables(req);

    return converter.toVpcRouteTables(res.getRouteTables(), account.getId(), region, dt);
}
项目:aws-mock    文件:BaseTest.java   
/**
 * Describe route table.
 *
 * @return RouteTable
 */
protected final RouteTable getRouteTable() {
    RouteTable routeTable = null;

    DescribeRouteTablesRequest req = new DescribeRouteTablesRequest();
    DescribeRouteTablesResult result = amazonEC2Client.describeRouteTables(req);
    if (result != null && !result.getRouteTables().isEmpty()) {
        routeTable = result.getRouteTables().get(0);
    }

    return routeTable;
}
项目:elasticsearch_my    文件:AmazonEC2Mock.java   
@Override
public DescribeRouteTablesResult describeRouteTables(DescribeRouteTablesRequest describeRouteTablesRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException("Not supported in mock");
}
项目:cmn-project    文件:EC2VPC.java   
public List<RouteTable> describeRouteTables(Collection<String> routeTableIds) {
    logger.info("describe route tables, routeTableIds={}", routeTableIds);
    return ec2.describeRouteTables(new DescribeRouteTablesRequest().withRouteTableIds(routeTableIds)).getRouteTables();
}
项目:aws-sdk-java-resources    文件:RouteTableImpl.java   
@Override
public boolean load(DescribeRouteTablesRequest request) {
    return load(request, null);
}
项目:aws-sdk-java-resources    文件:RouteTableImpl.java   
@Override
public boolean load(DescribeRouteTablesRequest request,
        ResultCapture<DescribeRouteTablesResult> extractor) {

    return resource.load(request, extractor);
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public RouteTableCollection getRouteTables() {
    return getRouteTables((DescribeRouteTablesRequest)null);
}
项目:aws-sdk-java-resources    文件:Vpc.java   
/**
 * Retrieves the RouteTables collection referenced by this resource.
 */
RouteTableCollection getRouteTables(DescribeRouteTablesRequest request);
项目:aws-sdk-java-resources    文件:EC2.java   
/**
 * Retrieves the RouteTables collection referenced by this resource.
 */
RouteTableCollection getRouteTables(DescribeRouteTablesRequest request);
项目:aws-sdk-java-resources    文件:RouteTable.java   
/**
 * Makes a call to the service to load this resource's attributes if they
 * are not loaded yet.
 * The following request parameters will be populated from the data of this
 * <code>RouteTable</code> resource, and any conflicting parameter value set
 * in the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>RouteTableIds.0</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return Returns {@code true} if the resource is not yet loaded when this
 *         method was invoked, which indicates that a service call has been
 *         made to retrieve the attributes.
 * @see DescribeRouteTablesRequest
 */
boolean load(DescribeRouteTablesRequest request);
项目:aws-sdk-java-resources    文件:RouteTable.java   
/**
 * Makes a call to the service to load this resource's attributes if they
 * are not loaded yet, and use a ResultCapture to retrieve the low-level
 * client response
 * The following request parameters will be populated from the data of this
 * <code>RouteTable</code> resource, and any conflicting parameter value set
 * in the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>RouteTableIds.0</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return Returns {@code true} if the resource is not yet loaded when this
 *         method was invoked, which indicates that a service call has been
 *         made to retrieve the attributes.
 * @see DescribeRouteTablesRequest
 */
boolean load(DescribeRouteTablesRequest request,
        ResultCapture<DescribeRouteTablesResult> extractor);
项目:aws-sdk-java-resources    文件:RouteTable.java   
/**
 * Retrieves the Associations collection referenced by this resource.
 */
RouteTableAssociationCollection getAssociations(DescribeRouteTablesRequest
        request);