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

Java DescribeInternetGatewaysRequest类代码示例

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

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



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

示例1: consumeSuccess

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
/**
 * Update the Internet gateway information for the VPC in question. For the list of Internet
 * gateways received based on the vpc filter work through the list of attachments and VPCs
 * and update the Internet gateway information in the network state that maps to the VPC.
 */
@Override
protected void consumeSuccess(DescribeInternetGatewaysRequest request,
        DescribeInternetGatewaysResult result) {
    for (InternetGateway resultGateway : result.getInternetGateways()) {
        for (InternetGatewayAttachment attachment : resultGateway.getAttachments()) {
            if (this.context.vpcs.containsKey(attachment.getVpcId())) {
                NetworkState networkStateToUpdate = this.context.vpcs
                        .get(attachment.getVpcId());
                networkStateToUpdate.customProperties.put(AWS_GATEWAY_ID,
                        resultGateway.getInternetGatewayId());
                this.context.vpcs.put(attachment.getVpcId(), networkStateToUpdate);
            }
        }
    }
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:21,代码来源:AWSNetworkStateEnumerationAdapterService.java


示例2: validateExistingIGW

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
private void validateExistingIGW(AwsNetworkView awsNetworkView, AmazonEC2Client amazonEC2Client) {
    if (awsNetworkView.isExistingIGW()) {
        DescribeInternetGatewaysRequest describeInternetGatewaysRequest = new DescribeInternetGatewaysRequest();
        describeInternetGatewaysRequest.withInternetGatewayIds(awsNetworkView.getExistingIGW());
        DescribeInternetGatewaysResult describeInternetGatewaysResult = amazonEC2Client.describeInternetGateways(describeInternetGatewaysRequest);
        if (describeInternetGatewaysResult.getInternetGateways().size() < 1) {
            throw new CloudConnectorException(String.format(IGW_DOES_NOT_EXIST_MSG, awsNetworkView.getExistingIGW()));
        } else {
            InternetGateway internetGateway = describeInternetGatewaysResult.getInternetGateways().get(0);
            InternetGatewayAttachment attachment = internetGateway.getAttachments().get(0);
            if (attachment != null && !attachment.getVpcId().equals(awsNetworkView.getExistingVPC())) {
                throw new CloudConnectorException(String.format(IGWVPC_DOES_NOT_EXIST_MSG, awsNetworkView.getExistingIGW(),
                        awsNetworkView.getExistingVPC()));
            }
        }
    }
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:18,代码来源:AwsSetup.java


示例3: getInternetGateway

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
public InternetGateway getInternetGateway(String resourceId) {
    DescribeInternetGatewaysRequest req = new DescribeInternetGatewaysRequest()
            .withInternetGatewayIds(resourceId);
    DescribeInternetGatewaysResult res = this.client.describeInternetGateways(req);
    List<InternetGateway> internetGateways = res.getInternetGateways();
    return internetGateways.isEmpty() ? null : internetGateways.get(0);
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:8,代码来源:AWSNetworkClient.java


示例4: getInternetGatewayInformation

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
/**
 * Gets the Internet gateways that are attached to the VPCs that were discovered during the
 * enumeration process.
 */
private void getInternetGatewayInformation(AWSNetworkStateCreationContext context,
        AWSNetworkStateCreationStage next) {
    DescribeInternetGatewaysRequest internetGatewayRequest = new DescribeInternetGatewaysRequest();
    List<String> vpcList = new ArrayList<>(context.vpcs.keySet());
    Filter filter = new Filter(AWS_ATTACHMENT_VPC_FILTER, vpcList);
    internetGatewayRequest.getFilters().add(filter);
    AWSInternetGatewayAsyncHandler asyncHandler = new AWSInternetGatewayAsyncHandler(next,
            context);
    context.amazonEC2Client.describeInternetGatewaysAsync(internetGatewayRequest, asyncHandler);
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:15,代码来源:AWSNetworkStateEnumerationAdapterService.java


示例5: getInternetGateways

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
@Override
public InternetGatewayCollection getInternetGateways(
        DescribeInternetGatewaysRequest request) {

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

    if (result == null) return null;
    return new InternetGatewayCollectionImpl(result);
}
 
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:11,代码来源:VpcImpl.java


示例6: getInternetGateways

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
@Override
public InternetGatewayCollection getInternetGateways(
        DescribeInternetGatewaysRequest request) {

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

    if (result == null) return null;
    return new InternetGatewayCollectionImpl(result);
}
 
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:11,代码来源:EC2Impl.java


示例7: gateways

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
@Override
public CloudGateWays gateways(CloudCredential cloudCredential, Region region, Map<String, String> filters) throws Exception {
    AmazonEC2Client ec2Client = awsClient.createAccess(cloudCredential);

    Map<String, Set<CloudGateWay>> resultCloudGateWayMap = new HashMap<>();
    CloudRegions regions = regions(cloudCredential, region, filters);

    for (Map.Entry<Region, List<AvailabilityZone>> regionListEntry : regions.getCloudRegions().entrySet()) {
        if (region == null || Strings.isNullOrEmpty(region.value()) || regionListEntry.getKey().value().equals(region.value())) {
            ec2Client.setRegion(RegionUtils.getRegion(regionListEntry.getKey().value()));

            DescribeInternetGatewaysRequest describeInternetGatewaysRequest = new DescribeInternetGatewaysRequest();
            DescribeInternetGatewaysResult describeInternetGatewaysResult = ec2Client.describeInternetGateways(describeInternetGatewaysRequest);

            Set<CloudGateWay> gateWays = new HashSet<>();
            for (InternetGateway internetGateway : describeInternetGatewaysResult.getInternetGateways()) {
                CloudGateWay cloudGateWay = new CloudGateWay();
                cloudGateWay.setId(internetGateway.getInternetGatewayId());
                cloudGateWay.setName(internetGateway.getInternetGatewayId());
                List<String> vpcs = new ArrayList<>();
                for (InternetGatewayAttachment internetGatewayAttachment : internetGateway.getAttachments()) {
                    vpcs.add(internetGatewayAttachment.getVpcId());
                }
                Map<String, Object> properties = new HashMap<>();
                properties.put("attachment", vpcs);
                cloudGateWay.setProperties(properties);
                gateWays.add(cloudGateWay);
            }
            for (AvailabilityZone availabilityZone : regionListEntry.getValue()) {
                resultCloudGateWayMap.put(availabilityZone.value(), gateWays);
            }
        }
    }
    return new CloudGateWays(resultCloudGateWayMap);
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:36,代码来源:AwsPlatformResources.java


示例8: describeInternetGateways

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
@Override
public List<AbstractResource<?>> describeInternetGateways(Account account, Region region, DateTime dt, Ec2Filter... filters) {
    AmazonEC2 ec2 = findClient(account, region);

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

    log.debug("start describing internet gateways for account:{} in region:{} via api", account.getId() + "=>" + account.getName(), region);
    DescribeInternetGatewaysResult res = ec2.describeInternetGateways(req);

    return converter.toVpcInternetGateways(res.getInternetGateways(), account.getId(), region, dt);
}
 
开发者ID:veyronfei,项目名称:clouck,代码行数:16,代码来源:Ec2WrapperImpl.java


示例9: getInternetGateway

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
/**
 * Describe internet gateway.
 *
 * @return InternetGateway
 */
protected final InternetGateway getInternetGateway() {
    InternetGateway internetGateway = null;

    DescribeInternetGatewaysRequest req = new DescribeInternetGatewaysRequest();
    DescribeInternetGatewaysResult result = amazonEC2Client.describeInternetGateways(req);
    if (result != null && !result.getInternetGateways().isEmpty()) {
        internetGateway = result.getInternetGateways().get(0);
    }

    return internetGateway;
}
 
开发者ID:treelogic-swe,项目名称:aws-mock,代码行数:17,代码来源:BaseTest.java


示例10: getInternetGateways

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
/**
* Describe internet gateways.
*
* @return List of InternetGateway
*/
protected final List<InternetGateway> getInternetGateways() {
   List<InternetGateway> internetGateways = null;
   DescribeInternetGatewaysRequest req = new DescribeInternetGatewaysRequest();
   DescribeInternetGatewaysResult result = amazonEC2Client.describeInternetGateways(req);
   if (result != null && !result.getInternetGateways().isEmpty()) {
       internetGateways = result.getInternetGateways();
   }

   return internetGateways;
}
 
开发者ID:treelogic-swe,项目名称:aws-mock,代码行数:16,代码来源:BaseTest.java


示例11: describeInternetGateways

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


示例12: load

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
@Override
public boolean load(DescribeInternetGatewaysRequest request) {
    return load(request, null);
}
 
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:5,代码来源:InternetGatewayImpl.java


示例13: getInternetGateways

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
/**
 * Retrieves the InternetGateways collection referenced by this resource.
 */
InternetGatewayCollection getInternetGateways(
        DescribeInternetGatewaysRequest request);
 
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:6,代码来源:Vpc.java


示例14: load

import com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest; //导入依赖的package包/类
/**
 * 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>InternetGateway</code> resource, and any conflicting parameter
 * value set in the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>InternetGatewayIds.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 DescribeInternetGatewaysRequest
 */
boolean load(DescribeInternetGatewaysRequest request);
 
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:22,代码来源:InternetGateway.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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