Amazon Elastic Compute Cloud

2019/08/23 - Amazon Elastic Compute Cloud - 2 new api methods

Changes  This release of EC2 VM Import Export adds support for exporting Amazon Machine Image(AMI)s to a VM file

ExportImage (new) Link ¶

Exports an Amazon Machine Image (AMI) to a VM file. For more information, see Exporting a VM Directory from an Amazon Machine Image (AMI) in the VM Import/Export User Guide .

See also: AWS API Documentation

Request Syntax

client.export_image(
    ClientToken='string',
    Description='string',
    DiskImageFormat='VMDK'|'RAW'|'VHD',
    DryRun=True|False,
    ImageId='string',
    S3ExportLocation={
        'S3Bucket': 'string',
        'S3Prefix': 'string'
    },
    RoleName='string'
)
type ClientToken

string

param ClientToken

Token to enable idempotency for export image requests.

This field is autopopulated if not provided.

type Description

string

param Description

A description of the image being exported. The maximum length is 255 bytes.

type DiskImageFormat

string

param DiskImageFormat

[REQUIRED]

The disk image format.

type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

type ImageId

string

param ImageId

[REQUIRED]

The ID of the image.

type S3ExportLocation

dict

param S3ExportLocation

[REQUIRED]

Information about the destination S3 bucket. The bucket must exist and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com.

  • S3Bucket (string) -- [REQUIRED]

    The destination S3 bucket.

  • S3Prefix (string) --

    The prefix (logical hierarchy) in the bucket.

type RoleName

string

param RoleName

The name of the role that grants VM Import/Export permission to export images to your S3 bucket. If this parameter is not specified, the default role is named 'vmimport'.

rtype

dict

returns

Response Syntax

{
    'Description': 'string',
    'DiskImageFormat': 'VMDK'|'RAW'|'VHD',
    'ExportImageTaskId': 'string',
    'ImageId': 'string',
    'RoleName': 'string',
    'Progress': 'string',
    'S3ExportLocation': {
        'S3Bucket': 'string',
        'S3Prefix': 'string'
    },
    'Status': 'string',
    'StatusMessage': 'string'
}

Response Structure

  • (dict) --

    • Description (string) --

      A description of the image being exported.

    • DiskImageFormat (string) --

      The disk image format for the exported image.

    • ExportImageTaskId (string) --

      The ID of the export image task.

    • ImageId (string) --

      The ID of the image.

    • RoleName (string) --

      The name of the role that grants VM Import/Export permission to export images to your S3 bucket.

    • Progress (string) --

      The percent complete of the export image task.

    • S3ExportLocation (dict) --

      Information about the destination S3 bucket.

      • S3Bucket (string) --

        The destination S3 bucket.

      • S3Prefix (string) --

        The prefix (logical hierarchy) in the bucket.

    • Status (string) --

      The status of the export image task. The possible values are active , completed , deleting , and deleted .

    • StatusMessage (string) --

      The status message for the export image task.

DescribeExportImageTasks (new) Link ¶

Describes the specified export image tasks or all your export image tasks.

See also: AWS API Documentation

Request Syntax

client.describe_export_image_tasks(
    DryRun=True|False,
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    ExportImageTaskIds=[
        'string',
    ],
    MaxResults=123,
    NextToken='string'
)
type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

type Filters

list

param Filters

Filter tasks using the task-state filter and one of the following values: active , completed , deleting , or deleted .

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:

    • DescribeAvailabilityZones

    • DescribeImages

    • DescribeInstances

    • DescribeKeyPairs

    • DescribeSecurityGroups

    • DescribeSnapshots

    • DescribeSubnets

    • DescribeTags

    • DescribeVolumes

    • DescribeVpcs

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      The filter values. Filter values are case-sensitive.

      • (string) --

type ExportImageTaskIds

list

param ExportImageTaskIds

The IDs of the export image tasks.

  • (string) --

type MaxResults

integer

param MaxResults

The maximum number of results to return in a single call.

type NextToken

string

param NextToken

A token that indicates the next page of results.

rtype

dict

returns

Response Syntax

{
    'ExportImageTasks': [
        {
            'Description': 'string',
            'ExportImageTaskId': 'string',
            'ImageId': 'string',
            'Progress': 'string',
            'S3ExportLocation': {
                'S3Bucket': 'string',
                'S3Prefix': 'string'
            },
            'Status': 'string',
            'StatusMessage': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ExportImageTasks (list) --

      Information about the export image tasks.

      • (dict) --

        Describes an export image task.

        • Description (string) --

          A description of the image being exported.

        • ExportImageTaskId (string) --

          The ID of the export image task.

        • ImageId (string) --

          The ID of the image.

        • Progress (string) --

          The percent complete of the export image task.

        • S3ExportLocation (dict) --

          Information about the destination S3 bucket.

          • S3Bucket (string) --

            The destination S3 bucket.

          • S3Prefix (string) --

            The prefix (logical hierarchy) in the bucket.

        • Status (string) --

          The status of the export image task. The possible values are active , completed , deleting , and deleted .

        • StatusMessage (string) --

          The status message for the export image task.

    • NextToken (string) --

      The token to use to get the next page of results. This value is null when there are no more results to return.