def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.state = None self.cidr_block = None self.available_ip_address_count = 0 self.availability_zone = None
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.dns_name = None self.public_dns_name = None self.private_dns_name = None self.state = None self.state_code = None self.key_name = None self.shutdown_state = None self.previous_state = None self.instance_type = None self.instance_class = None self.launch_time = None self.image_id = None self.placement = None self.kernel = None self.ramdisk = None self.product_codes = ProductCodes() self.ami_launch_index = None self.monitored = False self.instance_class = None self.spot_instance_request_id = None self.subnet_id = None self.vpc_id = None self.private_ip_address = None self.ip_address = None self.requester_id = None self._in_monitoring_element = False self.persistent = False self.root_device_name = None self.root_device_type = None self.block_device_mapping = None self.state_reason = None self.group_name = None
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.type = None self.state = None self.ip_address = None self.bgp_asn = None
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.type = None self.state = None self.availability_zone = None self.attachments = []
def __init__(self, connection=None, owner_id=None, name=None, description=None, id=None): TaggedEC2Object.__init__(self, connection) self.id = id self.owner_id = owner_id self.name = name self.description = description self.rules = []
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.create_time = None self.status = None self.size = None self.snapshot_id = None self.attach_data = None self.zone = None
def __init__(self, connection=None, owner_id=None, name=None, description=None, id=None): TaggedEC2Object.__init__(self, connection) self.id = id self.owner_id = owner_id self.name = name self.description = description self.vpc_id = None self.rules = IPPermissionsList() self.rules_egress = IPPermissionsList()
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.vpc_id = None self.state = None self.cidr_block = None self.available_ip_address_count = 0 self.availability_zone = None self.rules = IPPermissionsList()
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.volume_id = None self.status = None self.progress = None self.start_time = None self.owner_id = None self.volume_size = None self.description = None
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.state = None self.customer_gateway_configuration = None self.type = None self.customer_gateway_id = None self.vpn_gateway_id = None self.tunnels = [] self.options = None self.static_routes = []
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.create_time = None self.status = None self.size = None self.snapshot_id = None self.attach_data = None self.zone = None self.tier_type = None self.tier_name = None self.tier_replication = None self.size_in_bytes = None self.description = None
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.subnet_id = None self.vpc_id = None self.availability_zone = None self.description = None self.owner_id = None self.requester_managed = False self.status = None self.mac_address = None self.private_ip_address = None self.source_dest_check = None self.groups = [] self.attachment = None
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.price = None self.type = None self.state = None self.fault = None self.valid_from = None self.valid_until = None self.launch_group = None self.product_description = None self.availability_zone_group = None self.create_time = None self.launch_specification = None self.instance_id = None
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == 'dhcpConfigurationSet': self.options = DhcpConfigSet() return self.options
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == 'monitoring': self._in_monitoring_element = True elif name == 'blockDeviceMapping': self.block_device_mapping = BlockDeviceMapping() return self.block_device_mapping elif name == 'productCodes': return self.product_codes elif name == 'stateReason': self.state_reason = SubParse('stateReason') return self.state_reason elif name == 'groupSet': self.groups = ResultSet([('item', Group)]) return self.groups elif name == "eventsSet": self.eventsSet = SubParse('eventsSet') return self.eventsSet elif name == 'networkInterfaceSet': self.interfaces = ResultSet([('item', NetworkInterface)]) elif name == 'iamInstanceProfile': self.instance_profile = SubParse('iamInstanceProfile') return self.instance_profile return None
def test_remove_tag_empty_value(self): self.set_http_response(status_code=200) taggedEC2Object = TaggedEC2Object(self.service_connection) taggedEC2Object.id = "i-abcd1234" taggedEC2Object.tags["key1"] = "value1" taggedEC2Object.tags["key2"] = "value2" taggedEC2Object.remove_tag("key1", "") self.assert_request_parameters( { 'ResourceId.1': 'i-abcd1234', 'Action': 'DeleteTags', 'Tag.1.Key': 'key1', 'Tag.1.Value': '' }, ignore_params_values=[ 'AWSAccessKeyId', 'SignatureMethod', 'SignatureVersion', 'Timestamp', 'Version' ]) self.assertEqual(taggedEC2Object.tags, { "key1": "value1", "key2": "value2" })
def test_add_tags(self): self.set_http_response(status_code=200) taggedEC2Object = TaggedEC2Object(self.service_connection) taggedEC2Object.id = "i-abcd1234" taggedEC2Object.tags["already_present_key"] = "already_present_value" taggedEC2Object.add_tags({"key1": "value1", "key2": "value2"}) self.assert_request_parameters( { 'ResourceId.1': 'i-abcd1234', 'Action': 'CreateTags', 'Tag.1.Key': 'key1', 'Tag.1.Value': 'value1', 'Tag.2.Key': 'key2', 'Tag.2.Value': 'value2' }, ignore_params_values=[ 'AWSAccessKeyId', 'SignatureMethod', 'SignatureVersion', 'Timestamp', 'Version' ]) self.assertEqual( taggedEC2Object.tags, { "already_present_key": "already_present_value", "key1": "value1", "key2": "value2" })
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == 'item': att = Attachment() self.attachments.append(att) return att
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == 'ipPermissions': return self.rules else: return None
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.dns_name = None self.public_dns_name = None self.private_dns_name = None self.key_name = None self.instance_type = None self.launch_time = None self.image_id = None self.kernel = None self.ramdisk = None self.product_codes = ProductCodes() self.ami_launch_index = None self.monitored = False self.monitoring_state = None self.spot_instance_request_id = None self.subnet_id = None self.vpc_id = None self.private_ip_address = None self.ip_address = None self.requester_id = None self._in_monitoring_element = False self.persistent = False self.root_device_name = None self.root_device_type = None self.block_device_mapping = None self.state_reason = None self.group_name = None self.client_token = None self.eventsSet = None self.groups = [] self.platform = None self.interfaces = [] self.hypervisor = None self.virtualization_type = None self.architecture = None self.instance_profile = None self._previous_state = None self._state = InstanceState() self._placement = InstancePlacement() self.image_description = None self.description = None self.high_availability = None self.remote_console = None
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == 'item': self.rules.append(IPPermissions(self)) return self.rules[-1] else: return None
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.location = None self.state = None self.ownerId = None self.owner_alias = None self.is_public = False self.architecture = None self.platform = None self.type = None self.kernel_id = None self.ramdisk_id = None self.name = None self.description = None self.product_codes = ProductCodes() self.block_device_mapping = None self.root_device_type = None self.root_device_name = None
def __init__(self, connection=None): """ Represents a VPC. :ivar id: The unique ID of the VPC. :ivar dhcp_options_id: The ID of the set of DHCP options you've associated with the VPC (or default if the default options are associated with the VPC). :ivar state: The current state of the VPC. :ivar cidr_block: The CIDR block for the VPC. :ivar is_default: Indicates whether the VPC is the default VPC. :ivar instance_tenancy: The allowed tenancy of instances launched into the VPC. """ TaggedEC2Object.__init__(self, connection) self.id = None self.dhcp_options_id = None self.state = None self.cidr_block = None self.is_default = None self.instance_tenancy = None
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == 'blockDeviceMapping': self.block_device_mapping = BlockDeviceMapping() return self.block_device_mapping elif name == 'productCodes': return self.product_codes else: return None
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == 'attachmentSet': self.attach_data = AttachmentSet() return self.attach_data elif name == 'tagSet': self.tags = boto.resultset.ResultSet([('item', Tag)]) return self.tags else: return None
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == 'groupSet': self.groups = ResultSet([('item', Group)]) return self.groups elif name == 'attachment': self.attachment = Attachment() return self.attachment else: return None
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == 'launchSpecification': self.launch_specification = LaunchSpecification(connection) return self.launch_specification elif name == 'fault': self.fault = SpotInstanceStateFault() return self.fault else: return None
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == 'attachmentSet': self.attach_data = AttachmentSet() return self.attach_data elif name == 'tagSet': self.tags = ResultSet([('item', Tag)]) return self.tags else: return None
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == "attachmentSet": self.attach_data = AttachmentSet() return self.attach_data elif name == "tagSet": self.tags = ResultSet([("item", Tag)]) return self.tags else: return None
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.location = None self.state = None self.ownerId = None # for backwards compatibility self.owner_id = None self.owner_alias = None self.is_public = False self.architecture = None self.platform = None self.type = None self.kernel_id = None self.ramdisk_id = None self.name = None self.description = None self.product_codes = ProductCodes() self.block_device_mapping = None self.root_device_type = None self.root_device_name = None self.virtualization_type = None self.hypervisor = None self.instance_lifecycle = None
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == 'monitoring': self._in_monitoring_element = True elif name == 'blockDeviceMapping': self.block_device_mapping = BlockDeviceMapping() return self.block_device_mapping elif name == 'productCodes': return self.product_codes elif name == 'stateReason': self.state_reason = StateReason() return self.state_reason return None
def startElement(self, name, attrs, connection): retval = TaggedEC2Object.startElement(self, name, attrs, connection) if retval is not None: return retval if name == "monitoring": self._in_monitoring_element = True elif name == "blockDeviceMapping": self.block_device_mapping = BlockDeviceMapping() return self.block_device_mapping elif name == "productCodes": return self.product_codes elif name == "stateReason": self.state_reason = StateReason() return self.state_reason elif name == "groupSet": self.groups = ResultSet([("item", Group)]) return self.groups return None
def test_tag_resource_raises_error(self): """ Tests that when add_tags fails tag_resource raises the right error. """ ctx = self.get_mock_ctx('test_tag_resource_raises_error') current_ctx.set(ctx=ctx) resource = AwsBaseNode('root', [], resource_states=[]) ctx.node.properties['name'] = 'root' test_resource = TaggedEC2Object() tags = [] with mock.patch( 'boto.ec2.ec2object.TaggedEC2Object.add_tags') \ as mock_add_tags: mock_add_tags.side_effect = EC2ResponseError( mock.Mock(return_value={'status': 404}), 'error') ex = self.assertRaises( NonRecoverableError, resource._tag_resource, test_resource, tags) self.assertIn( 'unable to tag resource name', ex.message)
def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.options = None