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

项目:photon-model    文件:AWSNetworkClient.java   
/**
 * Add a 0.0.0.0/0 route to NAT gateway on an existing route table
 */
public DeferredResult<Void> addRouteToNatGateway(String routeTableId, String natGatewayId) {
    CreateRouteRequest req = new CreateRouteRequest()
            .withNatGatewayId(natGatewayId)
            .withDestinationCidrBlock(ROUTE_DEST_ALL)
            .withRouteTableId(routeTableId);

    String message = "Create AWS Route to NAT Gateway [" + natGatewayId + "] for Internet "
            + "traffic on route table [" + routeTableId + "].";

    AWSDeferredResultAsyncHandler<CreateRouteRequest, CreateRouteResult> handler = new
            AWSDeferredResultAsyncHandler<>(this.service, message);
    this.client.createRouteAsync(req, handler);
    return handler.toDeferredResult()
            .thenAccept(ignore -> { });
}
项目:aws-mock    文件:BaseTest.java   
/**
 * Create route with gateway and route table.
 *
 * @param routeTableId the route table id
 * @param gatewayId the gateway id
 * @param destinationCidrBlock the destination cidr block
 * @return true if Created Route
 */
protected final boolean createRoute(final String routeTableId, final String gatewayId, final String destinationCidrBlock) {

    CreateRouteRequest req = new CreateRouteRequest();
    req.setDestinationCidrBlock(destinationCidrBlock);
    req.setGatewayId(gatewayId);
    req.setRouteTableId(routeTableId);
    CreateRouteResult result = amazonEC2Client.createRoute(req);

    if (result != null) {
        return true;
    }

    return false;
}
项目:elasticsearch_my    文件:AmazonEC2Mock.java   
@Override
public CreateRouteResult createRoute(CreateRouteRequest createRouteRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException("Not supported in mock");
}