.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "VM::EC2::REST::ami 3pm" .TH VM::EC2::REST::ami 3pm "2016-06-04" "perl v5.22.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME VM::EC2::REST::ami \- Fetch and manipulate Amazon Machine Images" .IX Header "NAME VM::EC2::REST::ami - Fetch and manipulate Amazon Machine Images" .SH "SYNOPSIS" .IX Header "SYNOPSIS" use \s-1VM::EC2 \s0':standard'; .SH "METHODS" .IX Header "METHODS" These are methods that allow you to fetch and manipulate Amazon Machine Images. .PP Implemented: CopyImage CreateImage DeregisterImage DescribeImageAttribute DescribeImages ModifyImageAttribute RegisterImage ResetImageAttribute .PP Unimplemented: (none) .SH "EC2 AMAZON MACHINE IMAGES" .IX Header "EC2 AMAZON MACHINE IMAGES" The methods in this section allow you to query and manipulate Amazon machine images (AMIs). See VM::EC2::Image. .ie n .SS "@i = $ec2\->describe_images(@image_ids)" .el .SS "\f(CW@i\fP = \f(CW$ec2\fP\->describe_images(@image_ids)" .IX Subsection "@i = $ec2->describe_images(@image_ids)" .ie n .SS "@i = $ec2\->describe_images(\-image_id=>\e@id,\-executable_by=>$id, \-owner=>$id, \-filter=>\e%filters)" .el .SS "\f(CW@i\fP = \f(CW$ec2\fP\->describe_images(\-image_id=>\e@id,\-executable_by=>$id, \-owner=>$id, \-filter=>\e%filters)" .IX Subsection "@i = $ec2->describe_images(-image_id=>@id,-executable_by=>$id, -owner=>$id, -filter=>%filters)" Return a series of VM::EC2::Image objects, each describing an \&\s-1AMI.\s0 Optional arguments: .PP .Vb 2 \& \-image_id The id of the image, either a string scalar or an \& arrayref. \& \& \-executable_by Filter by images executable by the indicated user account, or \& one of the aliases "self" or "all". \& \& \-owner Filter by owner account number or one of the aliases "self", \& "aws\-marketplace", "amazon" or "all". \& \& \-filter Tags and other filters to apply .Ve .PP If there are no other arguments, you may omit the \-filter argument name and call \fIdescribe_images()\fR with a single hashref consisting of the search filters you wish to apply. .PP The full list of image filters can be found at: http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference\-query\-DescribeImages.html .ie n .SS "$image = $ec2\->create_image(\-instance_id=>$id,\-name=>$name,%other_args)" .el .SS "\f(CW$image\fP = \f(CW$ec2\fP\->create_image(\-instance_id=>$id,\-name=>$name,%other_args)" .IX Subsection "$image = $ec2->create_image(-instance_id=>$id,-name=>$name,%other_args)" Create an image from an EBS-backed instance and return a VM::EC2::Image object. The instance must be in the \*(L"stopped\*(R" or \&\*(L"running\*(R" state. In the latter case, Amazon will stop the instance, create the image, and then restart it unless the \-no_reboot argument is provided. .PP Arguments: .PP .Vb 8 \& \-instance_id ID of the instance to create an image from. (required) \& \-name Name for the image that will be created. (required) \& \-description Description of the new image. \& \-no_reboot If true, don\*(Aqt reboot the instance. \& \-block_device_mapping \& Block device mapping as a scalar or array ref. See \& run_instances() for the syntax. \& \-block_devices Alias of the above .Ve .ie n .SS "$image = $ec2\->register_image(\-name=>$name,%other_args)" .el .SS "\f(CW$image\fP = \f(CW$ec2\fP\->register_image(\-name=>$name,%other_args)" .IX Subsection "$image = $ec2->register_image(-name=>$name,%other_args)" Register an image, creating an \s-1AMI.\s0 This can be used to create an \s-1AMI\s0 from a S3\-backed instance-store bundle, or to create an \s-1AMI\s0 from a snapshot of an EBS-backed root volume. .PP Required arguments: .PP .Vb 1 \& \-name Name for the image that will be created. .Ve .PP Arguments required for an EBS-backed image: .PP .Vb 7 \& \-root_device_name The root device name, e.g. /dev/sda1 \& \-block_device_mapping The block device mapping strings, including the \& snapshot ID for the root volume. This can \& be either a scalar string or an arrayref. \& See run_instances() for a description of the \& syntax. \& \-block_devices Alias of the above. .Ve .PP Arguments required for an instance-store image: .PP .Vb 1 \& \-image_location Full path to the AMI manifest in Amazon S3 storage. .Ve .PP Common optional arguments: .PP .Vb 7 \& \-description Description of the AMI \& \-architecture Architecture of the image ("i386" or "x86_64") \& \-kernel_id ID of the kernel to use \& \-ramdisk_id ID of the RAM disk to use \& \-virtualization_type Type of virtualization ("paravirtual" or "hvm") \& Default is "paravirtual" \& \-sriov_net_support Set to "simple" to enable enhanced networking for the AMI .Ve .PP While you do not have to specify the kernel \s-1ID,\s0 it is strongly recommended that you do so. Otherwise the kernel will have to be specified for \fIrun_instances()\fR. .PP Note: Immediately after registering the image you can add tags to it and use modify_image_attribute to change launch permissions, etc. .ie n .SS "$result = $ec2\->deregister_image($image_id)" .el .SS "\f(CW$result\fP = \f(CW$ec2\fP\->deregister_image($image_id)" .IX Subsection "$result = $ec2->deregister_image($image_id)" Deletes the registered image and returns true if successful. .ie n .SS "@data = $ec2\->describe_image_attribute($image_id,$attribute)" .el .SS "\f(CW@data\fP = \f(CW$ec2\fP\->describe_image_attribute($image_id,$attribute)" .IX Subsection "@data = $ec2->describe_image_attribute($image_id,$attribute)" This method returns image attributes. Only one attribute can be retrieved at a time. The following is the list of attributes that can be retrieved: .PP .Vb 7 \& description \-\- scalar \& kernel \-\- scalar \& ramdisk \-\- scalar \& launchPermission \-\- list of scalar \& productCodes \-\- array \& blockDeviceMapping \-\- list of hashref \& sriovNetSupport \-\- scalar .Ve .PP All of these values can be retrieved more conveniently from the VM::EC2::Image object returned from \fIdescribe_images()\fR, so there is no attempt to parse the results of this call into Perl objects. In particular, 'blockDeviceMapping' is returned as a raw hashrefs (there also seems to be an \s-1AWS\s0 bug that causes fetching this attribute to return an AuthFailure error). .PP Please see the VM::EC2::Image \fIlaunchPermissions()\fR and \&\fIblockDeviceMapping()\fR methods for more convenient ways to get this data. .ie n .SS "$boolean = $ec2\->modify_image_attribute($image_id,\-$attribute_name=>$value)" .el .SS "\f(CW$boolean\fP = \f(CW$ec2\fP\->modify_image_attribute($image_id,\-$attribute_name=>$value)" .IX Subsection "$boolean = $ec2->modify_image_attribute($image_id,-$attribute_name=>$value)" This method changes image attributes. The first argument is the image \&\s-1ID,\s0 and this is followed by the attribute name and the value to change it to. .PP The following is the list of attributes that can be set: .PP .Vb 7 \& \-launch_add_user \-\- scalar or arrayref of UserIds to grant launch permissions to \& \-launch_add_group \-\- scalar or arrayref of Groups to remove launch permissions from \& (only currently valid value is "all") \& \-launch_remove_user \-\- scalar or arrayref of UserIds to remove from launch permissions \& \-launch_remove_group \-\- scalar or arrayref of Groups to remove from launch permissions \& \-product_code \-\- scalar or array of product codes to add \& \-description \-\- scalar new description .Ve .PP You can abbreviate the launch permission arguments to \-add_user, \&\-add_group, \-remove_user, \-remove_group, etc. .PP Only one attribute can be changed in a single request. .PP For example: .PP .Vb 1 \& $ec2\->modify_image_attribute(\*(Aqami\-12345\*(Aq,\-product_code=>[\*(Aqabcde\*(Aq,\*(Aqghijk\*(Aq]); .Ve .PP The result code is true if the attribute was successfully modified, false otherwise. In the latter case, \f(CW$ec2\fR\->\fIerror()\fR will provide the error message. .PP To make an image public, specify \-launch_add_group=>'all': .PP .Vb 1 \& $ec2\->modify_image_attribute(\*(Aqi\-12345\*(Aq,\-launch_add_group=>\*(Aqall\*(Aq); .Ve .PP Also see VM::EC2::Image for shortcut methods. For example: .PP .Vb 1 \& $image\->add_authorized_users(1234567,999991); .Ve .ie n .SS "$boolean = $ec2\->reset_image_attribute($image_id,$attribute_name)" .el .SS "\f(CW$boolean\fP = \f(CW$ec2\fP\->reset_image_attribute($image_id,$attribute_name)" .IX Subsection "$boolean = $ec2->reset_image_attribute($image_id,$attribute_name)" This method resets an attribute of the given snapshot to its default value. The valid attributes are: .PP .Vb 1 \& launchPermission .Ve .ie n .SS "$image = $ec2\->copy_image(\-source_region => $src, \-source_image_id => $id, \-name => $name, \-description => $desc, \-client_token => $token)" .el .SS "\f(CW$image\fP = \f(CW$ec2\fP\->copy_image(\-source_region => \f(CW$src\fP, \-source_image_id => \f(CW$id\fP, \-name => \f(CW$name\fP, \-description => \f(CW$desc\fP, \-client_token => \f(CW$token\fP)" .IX Subsection "$image = $ec2->copy_image(-source_region => $src, -source_image_id => $id, -name => $name, -description => $desc, -client_token => $token)" Initiates the copy of an \s-1AMI\s0 from the specified source region to the region in which the \s-1API\s0 call is executed. .PP Required arguments: .PP .Vb 2 \& \-source_region \-\- The ID of the AWS region that contains the AMI to be \& copied (source). \& \& \-source_image_id \-\- The ID of the Amazon EC2 AMI to copy. .Ve .PP Optional arguments: .PP .Vb 1 \& \-name \-\- The name of the new EC2 AMI in the destination region. \& \& \-description \-\- A description of the new AMI in the destination region. \& \& \-client_token \-\- Unique, case\-sensitive identifier you provide to ensure \& idempotency of the request. .Ve .PP Returns a VM::EC2::Image object on success; .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1VM::EC2\s0 .SH "AUTHOR" .IX Header "AUTHOR" Lincoln Stein . .PP Copyright (c) 2011 Ontario Institute for Cancer Research .PP This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the \s-1GPL \s0(either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to \s-1LICENSE\s0 for the full license text. In addition, please see \s-1DISCLAIMER\s0.txt for disclaimers of warranty.