diff options
Diffstat (limited to 'boto/ec2/image.py')
-rw-r--r-- | boto/ec2/image.py | 61 |
1 files changed, 37 insertions, 24 deletions
diff --git a/boto/ec2/image.py b/boto/ec2/image.py index f00e55ab..0d42b487 100644 --- a/boto/ec2/image.py +++ b/boto/ec2/image.py @@ -15,7 +15,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -31,12 +31,12 @@ class ProductCodes(list): def endElement(self, name, value, connection): if name == 'productCode': self.append(value) - + class Image(TaggedEC2Object): """ Represents an EC2 Image """ - + def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None @@ -94,7 +94,7 @@ class Image(TaggedEC2Object): else: raise Exception( 'Unexpected value of isPublic %s for image %s'%( - value, + value, self.id ) ) @@ -151,7 +151,7 @@ class Image(TaggedEC2Object): raise ValueError('%s is not a valid Image ID' % self.id) return self.state - def run(self, min_count=1, max_count=1, key_name=None, + def run(self, min_count=1, max_count=1, key_name=None, security_groups=None, user_data=None, addressing_type=None, instance_type='m1.small', placement=None, kernel_id=None, ramdisk_id=None, @@ -166,46 +166,46 @@ class Image(TaggedEC2Object): """ Runs this instance. - + :type min_count: int :param min_count: The minimum number of instances to start - + :type max_count: int :param max_count: The maximum number of instances to start - + :type key_name: string :param key_name: The name of the keypair to run this instance with. - - :type security_groups: + + :type security_groups: :param security_groups: - - :type user_data: + + :type user_data: :param user_data: - - :type addressing_type: + + :type addressing_type: :param daddressing_type: - + :type instance_type: string :param instance_type: The type of instance to run. Current choices are: m1.small | m1.large | m1.xlarge | c1.medium | c1.xlarge | m2.xlarge | m2.2xlarge | m2.4xlarge | cc1.4xlarge - + :type placement: string :param placement: The availability zone in which to launch the instances :type kernel_id: string :param kernel_id: The ID of the kernel with which to launch the instances - + :type ramdisk_id: string :param ramdisk_id: The ID of the RAM disk with which to launch the instances - + :type monitoring_enabled: bool :param monitoring_enabled: Enable CloudWatch monitoring on the instance. - + :type subnet_id: string :param subnet_id: The subnet ID within which to launch the instances for VPC. - + :type private_ip_address: string :param private_ip_address: If you're using VPC, you can optionally use this parameter to assign the instance a @@ -236,7 +236,7 @@ class Image(TaggedEC2Object): :param additional_info: Specifies additional information to make available to the instance(s) - :type security_group_ids: + :type security_group_ids: :param security_group_ids: :type instance_profile_name: string @@ -244,7 +244,7 @@ class Image(TaggedEC2Object): :type instance_profile_arn: string :param instance_profile_arn: The ARN of an IAM instance profile to use. - + :type tenancy: string :param tenancy: The tenancy of the instance you want to launch. An instance with a tenancy of 'dedicated' runs on @@ -266,9 +266,9 @@ class Image(TaggedEC2Object): monitoring_enabled, subnet_id, block_device_map, disable_api_termination, instance_initiated_shutdown_behavior, - private_ip_address, placement_group, + private_ip_address, placement_group, security_group_ids=security_group_ids, - additional_info=additional_info, + additional_info=additional_info, instance_profile_name=instance_profile_name, instance_profile_arn=instance_profile_arn, tenancy=tenancy) @@ -348,3 +348,16 @@ class ImageAttribute: self.ramdisk = value else: setattr(self, name, value) + + +class CopyImage(object): + def __init__(self, parent=None): + self._parent = parent + self.image_id = None + + def startElement(self, name, attrs, connection): + pass + + def endElement(self, name, value, connection): + if name == 'imageId': + self.image_id = value |