labpack/platforms/aws/ec2.py
def assign_address(self, ip_address, instance_id):
        
        '''
            a method to assign (or reassign) an elastic ip to an instance on AWS
            
        :param ip_address: string with elastic ipv4 address on ec2  
        :param instance_id: string with aws id for running instance
        :return: dictioanry with response metadata fields
        '''
        
        title = '%s.assign_address' % self.__class__.__name__

    # validate inputs
        input_fields = {
            'ip_address': ip_address,
            'instance_id': instance_id
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)

    # report query
        self.iam.printer('Assigning elastic ip address %s to instance %s.' % (ip_address, instance_id))

    # discover details associated with instance id
        try:
            response = self.connection.associate_address(
                InstanceId=instance_id,
                PublicIp=ip_address
            )
        except:
            raise AWSConnectionError(title)

        return response

            a method to assign (or reassign) an elastic ip to an instance on AWS
            
        :param ip_address: string with elastic ipv4 address on ec2  
        :param instance_id: string with aws id for running instance
        :return: dictioanry with response metadata fields
        
a method to assign (or reassign) an elastic ip to an instance on AWS
a method to assign ( or reassign ) an elastic ip to an instance on AWS
def assign_address(self, ip_address, instance_id):
        title = '%s.assign_address' % self.__class__.__name__
        input_fields = {
            'ip_address': ip_address,
            'instance_id': instance_id
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)
        self.iam.printer('Assigning elastic ip address %s to instance %s.' % (ip_address, instance_id))
        try:
            response = self.connection.associate_address(
                InstanceId=instance_id,
                PublicIp=ip_address
            )
        except:
            raise AWSConnectionError(title)
        return response
def assign_address ( self , ip_address , instance_id ) : title = '%s.assign_address' % self . __class__ . __name__ input_fields = { 'ip_address' : ip_address , 'instance_id' : instance_id } for key , value in input_fields . items ( ) : object_title = '%s(%s=%s)' % ( title , key , str ( value ) ) self . fields . validate ( value , '.%s' % key , object_title ) self . iam . printer ( 'Assigning elastic ip address %s to instance %s.' % ( ip_address , instance_id ) ) try : response = self . connection . associate_address ( InstanceId = instance_id , PublicIp = ip_address ) except : raise AWSConnectionError ( title ) return response
a method to assign (or reassign) an elastic ip to an instance on AWS
a method to assign ( or reassign ) an elastic ip to an instance on AWS
'''
            a method to assign (or reassign) an elastic ip to an instance on AWS
            
        :param ip_address: string with elastic ipv4 address on ec2  
        :param instance_id: string with aws id for running instance
        :return: dictioanry with response metadata fields
        ''' # validate inputs # report query # discover details associated with instance id
dictioanry with response metadata fields
dictioanry with response metadata fields
self
ip_address
string with elastic ipv4 address on ec2
string with elastic ipv4 address on ec2
instance_id
string with aws id for running instance
string with aws id for running instance