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

项目:cmn-project    文件:CreateRouteTableTask.java   
@Override
public void execute(Context context) throws Exception {
    logger.info("create route table, routeTable={}", resource.id);
    resource.remoteRouteTable = AWS.vpc.ec2.createRouteTable(new CreateRouteTableRequest().withVpcId(resource.vpc.remoteVPC.getVpcId())).getRouteTable();

    if (resource.internetGateway != null) {
        AWS.vpc.ec2.createRoute(new CreateRouteRequest()
            .withRouteTableId(resource.remoteRouteTable.getRouteTableId())
            .withGatewayId(resource.internetGateway.remoteInternetGatewayId)
            .withDestinationCidrBlock("0.0.0.0/0"));
    } else {
        AWS.vpc.ec2.createRoute(new CreateRouteRequest()
            .withRouteTableId(resource.remoteRouteTable.getRouteTableId())
            .withNatGatewayId(resource.nat.remoteNATGateway.getNatGatewayId())
            .withDestinationCidrBlock("0.0.0.0/0"));
    }

    EC2TagHelper tagHelper = new EC2TagHelper(context.env);

    AWS.ec2.createTags(new CreateTagsRequest()
        .withResources(resource.remoteRouteTable.getRouteTableId())
        .withTags(tagHelper.env(), tagHelper.name(resource.id), tagHelper.resourceId(resource.id)));
}
项目:photon-model    文件:AWSNetworkClient.java   
/**
 * 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);
}
项目:aws-sdk-java-resources    文件:VpcImpl.java   
@Override
public RouteTable createRouteTable(CreateRouteTableRequest request,
        ResultCapture<CreateRouteTableResult> extractor) {

    ActionResult result = resource.performAction("CreateRouteTable",
            request, extractor);

    if (result == null) return null;
    return new RouteTableImpl(result.getResource());
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public RouteTable createRouteTable(CreateRouteTableRequest request,
        ResultCapture<CreateRouteTableResult> extractor) {

    ActionResult result = service.performAction("CreateRouteTable", request,
            extractor);

    if (result == null) return null;
    return new RouteTableImpl(result.getResource());
}
项目:aws-mock    文件:BaseTest.java   
/**
 * Create route table.
 *
 * @param vpcId the vpc id
 * @return RouteTable
 */
protected final RouteTable createRouteTable(final String vpcId) {
    RouteTable routeTable = null;

    CreateRouteTableRequest req = new CreateRouteTableRequest();
    req.setVpcId(vpcId);
    CreateRouteTableResult result = amazonEC2Client.createRouteTable(req);

    if (result != null) {
        routeTable = result.getRouteTable();
    }

    return routeTable;
}
项目:elasticsearch_my    文件:AmazonEC2Mock.java   
@Override
public CreateRouteTableResult createRouteTable(CreateRouteTableRequest createRouteTableRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException("Not supported in mock");
}
项目:aws-sdk-java-resources    文件:VpcImpl.java   
@Override
public RouteTable createRouteTable(CreateRouteTableRequest request) {
    return createRouteTable(request, null);
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public RouteTable createRouteTable(CreateRouteTableRequest request) {
    return createRouteTable(request, null);
}
项目:aws-sdk-java-resources    文件:Vpc.java   
/**
 * Performs the <code>CreateRouteTable</code> action.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Vpc</code> resource, and any conflicting parameter value set in the
 * request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>VpcId</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The <code>RouteTable</code> resource object associated with the
 *         result of this action.
 * @see CreateRouteTableRequest
 */
RouteTable createRouteTable(CreateRouteTableRequest request);
项目:aws-sdk-java-resources    文件:Vpc.java   
/**
 * Performs the <code>CreateRouteTable</code> action and use a ResultCapture
 * to retrieve the low-level client response.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Vpc</code> resource, and any conflicting parameter value set in the
 * request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>VpcId</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The <code>RouteTable</code> resource object associated with the
 *         result of this action.
 * @see CreateRouteTableRequest
 */
RouteTable createRouteTable(CreateRouteTableRequest request,
        ResultCapture<CreateRouteTableResult> extractor);
项目:aws-sdk-java-resources    文件:EC2.java   
/**
 * Performs the <code>CreateRouteTable</code> action.
 *
 * <p>
 *
 * @return The <code>RouteTable</code> resource object associated with the
 *         result of this action.
 * @see CreateRouteTableRequest
 */
com.amazonaws.resources.ec2.RouteTable createRouteTable(
        CreateRouteTableRequest request);
项目:aws-sdk-java-resources    文件:EC2.java   
/**
 * Performs the <code>CreateRouteTable</code> action and use a ResultCapture
 * to retrieve the low-level client response.
 *
 * <p>
 *
 * @return The <code>RouteTable</code> resource object associated with the
 *         result of this action.
 * @see CreateRouteTableRequest
 */
com.amazonaws.resources.ec2.RouteTable createRouteTable(
        CreateRouteTableRequest request,
        ResultCapture<CreateRouteTableResult> extractor);