Search in sources :

Example 1 with CreateRouteTableRequest

use of com.amazonaws.services.ec2.model.CreateRouteTableRequest in project photon-model by vmware.

the class AWSNetworkClient method createRouteTable.

/**
 * Create a route table
 */
public DeferredResult<String> createRouteTable(String vpcId) {
    CreateRouteTableRequest req = new CreateRouteTableRequest().withVpcId(vpcId);
    String message = "Create AWS Route Table on VPC [" + vpcId + "].";
    AWSDeferredResultAsyncHandler<CreateRouteTableRequest, CreateRouteTableResult> handler = new AWSDeferredResultAsyncHandler<>(this.service, message);
    this.client.createRouteTableAsync(req, handler);
    return handler.toDeferredResult().thenApply(CreateRouteTableResult::getRouteTable).thenApply(RouteTable::getRouteTableId);
}
Also used : RouteTable(com.amazonaws.services.ec2.model.RouteTable) CreateRouteTableResult(com.amazonaws.services.ec2.model.CreateRouteTableResult) CreateRouteTableRequest(com.amazonaws.services.ec2.model.CreateRouteTableRequest)

Aggregations

CreateRouteTableRequest (com.amazonaws.services.ec2.model.CreateRouteTableRequest)1 CreateRouteTableResult (com.amazonaws.services.ec2.model.CreateRouteTableResult)1 RouteTable (com.amazonaws.services.ec2.model.RouteTable)1