def _list_records(self, rtype=None, name=None, content=None):
        """List all records for the hosted zone."""
        records = []
        paginator = RecordSetPaginator(self.r53_client, self.domain_id)
        for record in paginator.all_record_sets():
            if rtype is not None and record['Type'] != rtype:
                continue
            if name is not None and record['Name'] != self._fqdn_name(name):
                continue
            if record.get('AliasTarget', None) is not None:
                record_content = [record['AliasTarget'].get('DNSName', None)]
            if record.get('ResourceRecords', None) is not None:
                record_content = [self._format_content(record['Type'], value['Value']) for value
                                  in record['ResourceRecords']]
            if content is not None and content not in record_content:
                continue
            LOGGER.debug('record: %s', record)
            records.append({
                'type': record['Type'],
                'name': self._full_name(record['Name']),
                'ttl': record.get('TTL', None),
                'content': record_content[0] if len(record_content) == 1 else record_content,
            })
        LOGGER.debug('list_records: %s', records)
        return records
def _list_records ( self , rtype = None , name = None , content = None ) : records = [ ] paginator = RecordSetPaginator ( self . r53_client , self . domain_id ) for record in paginator . all_record_sets ( ) : if rtype is not None and record [ 'Type' ] != rtype : continue if name is not None and record [ 'Name' ] != self . _fqdn_name ( name ) : continue if record . get ( 'AliasTarget' , None ) is not None : record_content = [ record [ 'AliasTarget' ] . get ( 'DNSName' , None ) ] if record . get ( 'ResourceRecords' , None ) is not None : record_content = [ self . _format_content ( record [ 'Type' ] , value [ 'Value' ] ) for value in record [ 'ResourceRecords' ] ] if content is not None and content not in record_content : continue LOGGER . debug ( 'record: %s' , record ) records . append ( { 'type' : record [ 'Type' ] , 'name' : self . _full_name ( record [ 'Name' ] ) , 'ttl' : record . get ( 'TTL' , None ) , 'content' : record_content [ 0 ] if len ( record_content ) == 1 else record_content , } ) LOGGER . debug ( 'list_records: %s' , records ) return records
List all records for the hosted zone.