• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DescribeRouteTablesResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.amazonaws.services.ec2.model.DescribeRouteTablesResult的典型用法代码示例。如果您正苦于以下问题:Java DescribeRouteTablesResult类的具体用法?Java DescribeRouteTablesResult怎么用?Java DescribeRouteTablesResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DescribeRouteTablesResult类属于com.amazonaws.services.ec2.model包,在下文中一共展示了DescribeRouteTablesResult类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getMainRouteTable

import com.amazonaws.services.ec2.model.DescribeRouteTablesResult; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:16,代码来源:AWSNetworkClient.java


示例2: consumeSuccess

import com.amazonaws.services.ec2.model.DescribeRouteTablesResult; //导入依赖的package包/类
/**
 * 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);
        }
    }
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:20,代码来源:AWSNetworkStateEnumerationAdapterService.java


示例3: getRouteTablesForVpcInRegion

import com.amazonaws.services.ec2.model.DescribeRouteTablesResult; //导入依赖的package包/类
@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();
}
 
开发者ID:kylesm,项目名称:vpcviewer,代码行数:12,代码来源:VpcServiceImpl.java


示例4: describeRouteTables

import com.amazonaws.services.ec2.model.DescribeRouteTablesResult; //导入依赖的package包/类
@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);
}
 
开发者ID:veyronfei,项目名称:clouck,代码行数:16,代码来源:Ec2WrapperImpl.java


示例5: checkIfRoutesExist

import com.amazonaws.services.ec2.model.DescribeRouteTablesResult; //导入依赖的package包/类
/**
 * Checks if routes between the selected VPCs already exist
 *
 * @param vpnEndpoints
 * @return
 */
private boolean checkIfRoutesExist(List<VPNEndpoint> vpnEndpoints) {
  boolean routesExist = false;

  for (VPNEndpoint vpnEndpoint : vpnEndpoints) {
    ec2Client.setEndpoint(vpnEndpoint.getRegion().getEndpoint());
    DescribeRouteTablesResult descRouteTableResult = ec2Client.describeRouteTables();
    List<RouteTable> routeTables = descRouteTableResult.getRouteTables();

    for (RouteTable routeTable : routeTables) {
      if (routeTable.getVpcId().equals(vpnEndpoint.getVpc().getVpcId())) {
        List<Route> routes = routeTable.getRoutes();
        for (Route route : routes) {
          for (VPNEndpoint extVpnEndpoint : vpnEndpoints) {
            if (!vpnEndpoint.equals(extVpnEndpoint)) {
              LOG.debug("Checking if route allows requested traffic: " + route);
              if (route.getDestinationCidrBlock().endsWith(extVpnEndpoint.getVpc().getCidrBlock())) {
                routesExist = true;
                LOG.error("A route already exists between " + vpnEndpoint.getVpc().getCidrBlock() + " and " + extVpnEndpoint.getVpc().getCidrBlock());
              }
            }
          }
        }
      }
    }

  }

  return routesExist;
}
 
开发者ID:vinayselvaraj,项目名称:vpc2vpc,代码行数:36,代码来源:CreateConnection.java


示例6: createAndAssociateRoutes

import com.amazonaws.services.ec2.model.DescribeRouteTablesResult; //导入依赖的package包/类
/**
 * Create routes
 *
 * @param vpnEndpoints
 */
private void createAndAssociateRoutes(List<VPNEndpoint> vpnEndpoints) {

  for (VPNEndpoint vpnEndpoint : vpnEndpoints) {
    ec2Client.setEndpoint(vpnEndpoint.getRegion().getEndpoint());

    for (VPNEndpoint extVpnEndpoint : vpnEndpoints) {
      if (!vpnEndpoint.equals(extVpnEndpoint)) {

        // Get route tables
        DescribeRouteTablesResult descRouteTablesResult = ec2Client.describeRouteTables();
        List<RouteTable> routeTables = descRouteTablesResult.getRouteTables();
        for (RouteTable routeTable : routeTables) {
          if (routeTable.getVpcId().equals(vpnEndpoint.getVpc().getVpcId())) {
            // Create the route
            CreateRouteRequest createRouteReq = new CreateRouteRequest();
            createRouteReq.setDestinationCidrBlock(extVpnEndpoint.getVpc().getCidrBlock());
            createRouteReq.setInstanceId(vpnEndpoint.getInstance().getInstanceId());
            createRouteReq.setRouteTableId(routeTable.getRouteTableId());
            LOG.debug("About to create a route in " + vpnEndpoint.getVpc().getVpcId() + " to " + extVpnEndpoint.getVpc().getVpcId() + " in route table: " + routeTable.getRouteTableId());
            ec2Client.createRoute(createRouteReq);
            LOG.debug("Created route in " + vpnEndpoint.getVpc().getVpcId() + " to " + extVpnEndpoint.getVpc().getVpcId() + " in route table: " + routeTable.getRouteTableId());
          }
        }
      }
    }

  }

}
 
开发者ID:vinayselvaraj,项目名称:vpc2vpc,代码行数:35,代码来源:CreateConnection.java


示例7: getRouteTable

import com.amazonaws.services.ec2.model.DescribeRouteTablesResult; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:treelogic-swe,项目名称:aws-mock,代码行数:17,代码来源:BaseTest.java


示例8: describeRouteTables

import com.amazonaws.services.ec2.model.DescribeRouteTablesResult; //导入依赖的package包/类
@Override
public DescribeRouteTablesResult describeRouteTables(DescribeRouteTablesRequest describeRouteTablesRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException("Not supported in mock");
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:AmazonEC2Mock.java


示例9: load

import com.amazonaws.services.ec2.model.DescribeRouteTablesResult; //导入依赖的package包/类
@Override
public boolean load(DescribeRouteTablesRequest request,
        ResultCapture<DescribeRouteTablesResult> extractor) {

    return resource.load(request, extractor);
}
 
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:7,代码来源:RouteTableImpl.java


示例10: load

import com.amazonaws.services.ec2.model.DescribeRouteTablesResult; //导入依赖的package包/类
/**
 * 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);
 
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:24,代码来源:RouteTable.java



注:本文中的com.amazonaws.services.ec2.model.DescribeRouteTablesResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AbstractNode类代码示例发布时间:2022-05-23
下一篇:
Java Column类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap