use of com.amazonaws.services.ec2.model.DeleteNatGatewayResult in project photon-model by vmware.
the class AWSNetworkClient method deleteNATGateway.
/**
* 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);
}
Aggregations