当前位置: 首页>>代码示例>>Java>>正文


Java DeleteNatGatewayRequest类代码示例

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


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

示例1: deleteNATGateway

import com.amazonaws.services.ec2.model.DeleteNatGatewayRequest; //导入依赖的package包/类
/**
 * Delete a NAT Gateway
 * It waits for the NAT gateway to get into the Deleted state before returning.
 */
public DeferredResult<Void> deleteNATGateway(String natGatewayId, TaskManager taskManager,
        long taskExpirationMicros) {
    DeleteNatGatewayRequest req = new DeleteNatGatewayRequest()
            .withNatGatewayId(natGatewayId);

    String message = "Delete AWS NAT Gateway with id [" + natGatewayId + "].";

    AWSDeferredResultAsyncHandler<DeleteNatGatewayRequest, DeleteNatGatewayResult> handler = new
            AWSDeferredResultAsyncHandler<>(this.service, message);
    this.client.deleteNatGatewayAsync(req, handler);
    return handler.toDeferredResult()
            .thenCompose(ignore -> waitForNatGatewayState(natGatewayId,
                    taskManager, taskExpirationMicros, AWSTaskStatusChecker.AWS_DELETED_NAME))
            .thenApply(ignore -> null);

}
 
开发者ID:vmware,项目名称:photon-model,代码行数:21,代码来源:AWSNetworkClient.java

示例2: deleteNATGateway

import com.amazonaws.services.ec2.model.DeleteNatGatewayRequest; //导入依赖的package包/类
public void deleteNATGateway(String gatewayId) {
    logger.info("delete nat gateway, natGatewayId={}", gatewayId);
    AWS.vpc.ec2.deleteNatGateway(new DeleteNatGatewayRequest().withNatGatewayId(gatewayId));

    while (true) {
        Threads.sleepRoughly(Duration.ofSeconds(30));
        NatGateway gateway = AWS.vpc.describeNATGateway(gatewayId);
        String state = gateway.getState();
        if ("deleting".equals(state)) continue;
        if ("deleted".equals(state)) {
            break;
        } else {
            throw new Error("failed to delete nat gateway, gatewayId=" + gatewayId + ", state=" + state);
        }
    }
}
 
开发者ID:neowu,项目名称:cmn-project,代码行数:17,代码来源:EC2VPC.java

示例3: deleteNatGateway

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


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