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

项目:photon-model    文件:AWSNetworkClient.java   
/**
 * Creates the VPC and returns the VPC id
 */
public String createVPC(String subnetCidr) {
    CreateVpcRequest req = new CreateVpcRequest().withCidrBlock(subnetCidr);
    CreateVpcResult vpc = this.client.createVpc(req);

    return vpc.getVpc().getVpcId();
}
项目:cmn-project    文件:EC2VPC.java   
public Vpc createVPC() throws InterruptedException {
    logger.info("create VPC");
    String vpcId = ec2.createVpc(new CreateVpcRequest().withCidrBlock("10.0.0.0/16")).getVpc().getVpcId();

    while (true) {
        Threads.sleepRoughly(Duration.ofSeconds(20));
        DescribeVpcsResult result = ec2.describeVpcs(new DescribeVpcsRequest().withVpcIds(vpcId));
        Vpc remoteVPC = result.getVpcs().get(0);
        if ("available".equals(remoteVPC.getState())) {
            enableVPCDNS(vpcId);
            return remoteVPC;
        }
    }
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public Vpc createVpc(CreateVpcRequest request,
        ResultCapture<CreateVpcResult> extractor) {

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

    if (result == null) return null;
    return new VpcImpl(result.getResource());
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public Vpc createVpc(String cidrBlock, ResultCapture<CreateVpcResult>
        extractor) {

    CreateVpcRequest request = new CreateVpcRequest()
        .withCidrBlock(cidrBlock);
    return createVpc(request, extractor);
}
项目:aws-mock    文件:BaseTest.java   
/**
 * Create VPC.
 *
 * @param cidrBlock the cidr block
 * @param instanceTenancy the instance tenancy
 * @return New vpc
 */
protected final Vpc createVpc(final String cidrBlock, final String instanceTenancy) {
    CreateVpcRequest req = new CreateVpcRequest();
    req.setCidrBlock(cidrBlock);
    req.setInstanceTenancy(instanceTenancy);
    CreateVpcResult result = amazonEC2Client.createVpc(req);
    return result.getVpc();
}
项目:elasticsearch_my    文件:AmazonEC2Mock.java   
@Override
public CreateVpcResult createVpc(CreateVpcRequest createVpcRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException("Not supported in mock");
}
项目:photon-model    文件:TestAWSSetupUtils.java   
/**
 * Creates a VPC and returns the VPC id.
 */
public static String createVPC(AmazonEC2AsyncClient client, String subnetCidr) {
    return client.createVpc(new CreateVpcRequest().withCidrBlock(subnetCidr)).getVpc().getVpcId();
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public Vpc createVpc(CreateVpcRequest request) {
    return createVpc(request, null);
}
项目:aws-sdk-java-resources    文件:EC2.java   
/**
 * Performs the <code>CreateVpc</code> action.
 *
 * <p>
 *
 * @return The <code>Vpc</code> resource object associated with the result
 *         of this action.
 * @see CreateVpcRequest
 */
com.amazonaws.resources.ec2.Vpc createVpc(CreateVpcRequest request);
项目:aws-sdk-java-resources    文件:EC2.java   
/**
 * Performs the <code>CreateVpc</code> action and use a ResultCapture to
 * retrieve the low-level client response.
 *
 * <p>
 *
 * @return The <code>Vpc</code> resource object associated with the result
 *         of this action.
 * @see CreateVpcRequest
 */
com.amazonaws.resources.ec2.Vpc createVpc(CreateVpcRequest request,
        ResultCapture<CreateVpcResult> extractor);