Package dns :: Module rdataset :: Class Rdataset
[hide private]
[frames] | no frames]

Class Rdataset

source code

object --+    
         |    
   set.Set --+
             |
            Rdataset
Known Subclasses:

A DNS rdataset.

Instance Methods [hide private]
 
__eq__(self, other) source code
 
__init__(self, rdclass, rdtype, covers=0, ttl=0)
Create a new rdataset of the specified class and type.
source code
 
__ne__(self, other) source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
_clone(self)
Make a (shallow) copy of the set.
source code
 
add(self, rd, ttl=None)
Add the specified rdata to the rdataset.
source code
 
intersection_update(self, other)
Update the set, removing any elements from other which are not in both sets.
source code
 
match(self, rdclass, rdtype, covers)
Returns ``True`` if this rdataset matches the specified class, type, and covers.
source code
 
to_text(self, name=None, origin=None, relativize=True, override_rdclass=None, **kw)
Convert the rdataset into DNS master file format.
source code
 
to_wire(self, name, file, compress=None, origin=None, override_rdclass=None, want_shuffle=True)
Convert the rdataset to wire format.
source code
 
union_update(self, other)
Update the set, adding any elements from other which are not already in the set.
source code
 
update(self, other)
Add all rdatas in other to self.
source code
 
update_ttl(self, ttl)
Perform TTL minimization.
source code

Inherited from set.Set: __add__, __and__, __copy__, __delitem__, __getitem__, __iadd__, __iand__, __ior__, __isub__, __iter__, __len__, __or__, __sub__, clear, copy, difference, difference_update, discard, intersection, issubset, issuperset, remove, union

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]
  covers
  rdclass
  rdtype
  ttl

Inherited from set.Set: items

Inherited from object: __class__

Method Details [hide private]

__eq__(self, other)
(Equality operator)

source code 
Overrides: set.Set.__eq__

__init__(self, rdclass, rdtype, covers=0, ttl=0)
(Constructor)

source code 

Create a new rdataset of the specified class and type.

*rdclass*, an ``int``, the rdataclass.

*rdtype*, an ``int``, the rdatatype.

*covers*, an ``int``, the covered rdatatype.

*ttl*, an ``int``, the TTL.

Overrides: object.__init__

__ne__(self, other)

source code 
Overrides: set.Set.__ne__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

_clone(self)

source code 

Make a (shallow) copy of the set.

There is a 'clone protocol' that subclasses of this class should use. To make a copy, first call your super's _clone() method, and use the object returned as the new instance. Then make shallow copies of the attributes defined in the subclass.

This protocol allows us to write the set algorithms that return new instances (e.g. union) once, and keep using them in subclasses.

Overrides: set.Set._clone
(inherited documentation)

add(self, rd, ttl=None)

source code 

Add the specified rdata to the rdataset.

If the optional *ttl* parameter is supplied, then ``self.update_ttl(ttl)`` will be called prior to adding the rdata.

*rd*, a ``dns.rdata.Rdata``, the rdata

*ttl*, an ``int``, the TTL.

Raises ``dns.rdataset.IncompatibleTypes`` if the type and class do not match the type and class of the rdataset.

Raises ``dns.rdataset.DifferingCovers`` if the type is a signature type and the covered type does not match that of the rdataset.

Overrides: set.Set.add

intersection_update(self, other)

source code 

Update the set, removing any elements from other which are not in both sets.

Overrides: set.Set.intersection_update
(inherited documentation)

to_text(self, name=None, origin=None, relativize=True, override_rdclass=None, **kw)

source code 

Convert the rdataset into DNS master file format.

See ``dns.name.Name.choose_relativity`` for more information on how *origin* and *relativize* determine the way names are emitted.

Any additional keyword arguments are passed on to the rdata ``to_text()`` method.

*name*, a ``dns.name.Name``. If name is not ``None``, emit RRs with *name* as the owner name.

*origin*, a ``dns.name.Name`` or ``None``, the origin for relative names.

*relativize*, a ``bool``. If ``True``, names will be relativized to *origin*.

to_wire(self, name, file, compress=None, origin=None, override_rdclass=None, want_shuffle=True)

source code 

Convert the rdataset to wire format.

*name*, a ``dns.name.Name`` is the owner name to use.

*file* is the file where the name is emitted (typically a BytesIO file).

*compress*, a ``dict``, is the compression table to use. If ``None`` (the default), names will not be compressed.

*origin* is a ``dns.name.Name`` or ``None``. If the name is relative and origin is not ``None``, then *origin* will be appended to it.

*override_rdclass*, an ``int``, is used as the class instead of the class of the rdataset. This is useful when rendering rdatasets associated with dynamic updates.

*want_shuffle*, a ``bool``. If ``True``, then the order of the Rdatas within the Rdataset will be shuffled before rendering.

Returns an ``int``, the number of records emitted.

union_update(self, other)

source code 

Update the set, adding any elements from other which are not already in the set.

Overrides: set.Set.union_update
(inherited documentation)

update(self, other)

source code 

Add all rdatas in other to self.

*other*, a ``dns.rdataset.Rdataset``, the rdataset from which to update.

Overrides: set.Set.update

update_ttl(self, ttl)

source code 

Perform TTL minimization.

Set the TTL of the rdataset to be the lesser of the set's current TTL or the specified TTL. If the set contains no rdatas, set the TTL to the specified TTL.

*ttl*, an ``int``.