
org.jclouds.aws.ec2.services.AMIAsyncClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jclouds-aws Show documentation
Show all versions of jclouds-aws Show documentation
jclouds Core components to access Amazon AWS
The newest version!
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC.
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.jclouds.aws.ec2.services;
import static org.jclouds.aws.ec2.reference.EC2Parameters.ACTION;
import static org.jclouds.aws.ec2.reference.EC2Parameters.VERSION;
import java.util.Map;
import java.util.Set;
import com.google.common.util.concurrent.ListenableFuture;
import javax.annotation.Nullable;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import org.jclouds.aws.ec2.EC2AsyncClient;
import org.jclouds.aws.ec2.binders.BindProductCodesToIndexedFormParams;
import org.jclouds.aws.ec2.binders.BindUserGroupsToIndexedFormParams;
import org.jclouds.aws.ec2.binders.BindUserIdsToIndexedFormParams;
import org.jclouds.aws.ec2.domain.Image;
import org.jclouds.aws.ec2.domain.Permission;
import org.jclouds.aws.ec2.domain.Image.EbsBlockDevice;
import org.jclouds.aws.ec2.options.CreateImageOptions;
import org.jclouds.aws.ec2.options.DescribeImagesOptions;
import org.jclouds.aws.ec2.options.RegisterImageBackedByEbsOptions;
import org.jclouds.aws.ec2.options.RegisterImageOptions;
import org.jclouds.aws.ec2.xml.BlockDeviceMappingHandler;
import org.jclouds.aws.ec2.xml.DescribeImagesResponseHandler;
import org.jclouds.aws.ec2.xml.ImageIdHandler;
import org.jclouds.aws.ec2.xml.PermissionHandler;
import org.jclouds.aws.ec2.xml.ProductCodesHandler;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.aws.functions.RegionToEndpoint;
import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.EndpointParam;
import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.FormParams;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.VirtualHost;
import org.jclouds.rest.annotations.XMLResponseParser;
import org.jclouds.rest.functions.ReturnEmptySetOnNotFoundOr404;
/**
* Provides access to AMI Services.
*
*
* @author Adrian Cole
*/
@RequestFilters(FormSigner.class)
@FormParams(keys = VERSION, values = EC2AsyncClient.VERSION)
@VirtualHost
public interface AMIAsyncClient {
/**
* @see AMIClient#describeImagesInRegion
*/
@POST
@Path("/")
@FormParams(keys = ACTION, values = "DescribeImages")
@XMLResponseParser(DescribeImagesResponseHandler.class)
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
ListenableFuture> describeImagesInRegion(
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region, DescribeImagesOptions... options);
/**
* @see AMIClient#createImageInRegion
*/
@POST
@Path("/")
@FormParams(keys = ACTION, values = "CreateImage")
@XMLResponseParser(ImageIdHandler.class)
ListenableFuture createImageInRegion(@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
@FormParam("Name") String name, @FormParam("InstanceId") String instanceId, CreateImageOptions... options);
/**
* @see AMIClient#deregisterImageInRegion
*/
@POST
@Path("/")
@FormParams(keys = ACTION, values = "DeregisterImage")
ListenableFuture deregisterImageInRegion(@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
@FormParam("ImageId") String imageId);
/**
* @see AMIClient#registerImageFromManifestInRegion
*/
@POST
@Path("/")
@FormParams(keys = ACTION, values = "RegisterImage")
@XMLResponseParser(ImageIdHandler.class)
ListenableFuture registerImageFromManifestInRegion(
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
@FormParam("Name") String imageName, @FormParam("ImageLocation") String pathToManifest,
RegisterImageOptions... options);
/**
* @see AMIClient#registerUnixImageBackedByEbsInRegion
*/
@POST
@Path("/")
@FormParams(keys = { ACTION, "RootDeviceName", "BlockDeviceMapping.0.DeviceName" }, values = { "RegisterImage",
"/dev/sda1", "/dev/sda1" })
@XMLResponseParser(ImageIdHandler.class)
ListenableFuture registerUnixImageBackedByEbsInRegion(
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
@FormParam("Name") String imageName,
@FormParam("BlockDeviceMapping.0.Ebs.SnapshotId") String ebsSnapshotId,
RegisterImageBackedByEbsOptions... options);
/**
* @see AMIClient#resetLaunchPermissionsOnImageInRegion
*/
@POST
@Path("/")
@FormParams(keys = { ACTION, "Attribute" }, values = { "ResetImageAttribute", "launchPermission" })
ListenableFuture resetLaunchPermissionsOnImageInRegion(
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
@FormParam("ImageId") String imageId);
/**
* @see AMIClient#addLaunchPermissionsToImageInRegion
*/
@POST
@Path("/")
@FormParams(keys = { ACTION, "OperationType", "Attribute" }, values = { "ModifyImageAttribute", "add",
"launchPermission" })
ListenableFuture addLaunchPermissionsToImageInRegion(
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
@BinderParam(BindUserIdsToIndexedFormParams.class) Iterable userIds,
@BinderParam(BindUserGroupsToIndexedFormParams.class) Iterable userGroups,
@FormParam("ImageId") String imageId);
/**
* @see AMIClient#removeLaunchPermissionsToImageInRegion
*/
@POST
@Path("/")
@FormParams(keys = { ACTION, "OperationType", "Attribute" }, values = { "ModifyImageAttribute", "remove",
"launchPermission" })
ListenableFuture removeLaunchPermissionsFromImageInRegion(
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
@BinderParam(BindUserIdsToIndexedFormParams.class) Iterable userIds,
@BinderParam(BindUserGroupsToIndexedFormParams.class) Iterable userGroups,
@FormParam("ImageId") String imageId);
/**
* @see AMIClient#getLaunchPermissionForImageInRegion
*/
@POST
@Path("/")
@FormParams(keys = { ACTION, "Attribute" }, values = { "DescribeImageAttribute", "launchPermission" })
@XMLResponseParser(PermissionHandler.class)
ListenableFuture getLaunchPermissionForImageInRegion(
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
@FormParam("ImageId") String imageId);
/**
* @see AMIClient#getProductCodesForImageInRegion
*/
@POST
@Path("/")
@FormParams(keys = { ACTION, "Attribute" }, values = { "DescribeImageAttribute", "productCodes" })
@XMLResponseParser(ProductCodesHandler.class)
ListenableFuture> getProductCodesForImageInRegion(
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
@FormParam("ImageId") String imageId);
/**
* @see AMIClient#getBlockDeviceMappingsForImageInRegion
*/
@POST
@Path("/")
@FormParams(keys = { ACTION, "Attribute" }, values = { "DescribeImageAttribute", "blockDeviceMapping" })
@XMLResponseParser(BlockDeviceMappingHandler.class)
ListenableFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy