dnspython  1.16.0
About: dnspython is a DNS toolkit (for Python 2.x) that supports almost all record types.
  Fossies Dox: dnspython-1.16.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

dns.node.Node Class Reference
Inheritance diagram for dns.node.Node:
[legend]
Collaboration diagram for dns.node.Node:
[legend]

Public Member Functions

def __init__ (self)
 
def to_text (self, name, **kw)
 
def __repr__ (self)
 
def __eq__ (self, other)
 
def __ne__ (self, other)
 
def __len__ (self)
 
def __iter__ (self)
 
def find_rdataset (self, rdclass, rdtype, covers=dns.rdatatype.NONE, create=False)
 
def get_rdataset (self, rdclass, rdtype, covers=dns.rdatatype.NONE, create=False)
 
def delete_rdataset (self, rdclass, rdtype, covers=dns.rdatatype.NONE)
 
def replace_rdataset (self, replacement)
 

Public Attributes

 rdatasets
 

Static Private Attributes

list __slots__ = ['rdatasets']
 

Detailed Description

A Node is a set of rdatasets.

Definition at line 27 of file node.py.

Constructor & Destructor Documentation

◆ __init__()

def dns.node.Node.__init__ (   self)

Definition at line 33 of file node.py.

Member Function Documentation

◆ __eq__()

def dns.node.Node.__eq__ (   self,
  other 
)

◆ __iter__()

def dns.node.Node.__iter__ (   self)

Definition at line 76 of file node.py.

References dns.node.Node.rdatasets.

◆ __len__()

def dns.node.Node.__len__ (   self)

Definition at line 73 of file node.py.

References dns.node.Node.rdatasets.

◆ __ne__()

def dns.node.Node.__ne__ (   self,
  other 
)

◆ __repr__()

def dns.node.Node.__repr__ (   self)

Definition at line 55 of file node.py.

◆ delete_rdataset()

def dns.node.Node.delete_rdataset (   self,
  rdclass,
  rdtype,
  covers = dns.rdatatype.NONE 
)
Delete the rdataset matching the specified properties in the
current node.

If a matching rdataset does not exist, it is not an error.

*rdclass*, an ``int``, the class of the rdataset.

*rdtype*, an ``int``, the type of the rdataset.

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

Definition at line 146 of file node.py.

References dns.node.Node.get_rdataset(), and dns.node.Node.rdatasets.

Referenced by dns.node.Node.replace_rdataset().

◆ find_rdataset()

def dns.node.Node.find_rdataset (   self,
  rdclass,
  rdtype,
  covers = dns.rdatatype.NONE,
  create = False 
)
Find an rdataset matching the specified properties in the
current node.

*rdclass*, an ``int``, the class of the rdataset.

*rdtype*, an ``int``, the type of the rdataset.

*covers*, an ``int``, the covered type.  Usually this value is
dns.rdatatype.NONE, but if the rdtype is dns.rdatatype.SIG or
dns.rdatatype.RRSIG, then the covers value will be the rdata
type the SIG/RRSIG covers.  The library treats the SIG and RRSIG
types as if they were a family of
types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA).  This makes RRSIGs much
easier to work with than if RRSIGs covering different rdata
types were aggregated into a single RRSIG rdataset.

*create*, a ``bool``.  If True, create the rdataset if it is not found.

Raises ``KeyError`` if an rdataset of the desired type and class does
not exist and *create* is not ``True``.

Returns a ``dns.rdataset.Rdataset``.

Definition at line 79 of file node.py.

References dns.node.Node.rdatasets.

Referenced by dns.node.Node.get_rdataset(), and dns.zone.Zone.get_rdataset().

◆ get_rdataset()

def dns.node.Node.get_rdataset (   self,
  rdclass,
  rdtype,
  covers = dns.rdatatype.NONE,
  create = False 
)
Get an rdataset matching the specified properties in the
current node.

None is returned if an rdataset of the specified type and
class does not exist and *create* is not ``True``.

*rdclass*, an ``int``, the class of the rdataset.

*rdtype*, an ``int``, the type of the rdataset.

*covers*, an ``int``, the covered type.  Usually this value is
dns.rdatatype.NONE, but if the rdtype is dns.rdatatype.SIG or
dns.rdatatype.RRSIG, then the covers value will be the rdata
type the SIG/RRSIG covers.  The library treats the SIG and RRSIG
types as if they were a family of
types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA).  This makes RRSIGs much
easier to work with than if RRSIGs covering different rdata
types were aggregated into a single RRSIG rdataset.

*create*, a ``bool``.  If True, create the rdataset if it is not found.

Returns a ``dns.rdataset.Rdataset`` or ``None``.

Definition at line 114 of file node.py.

References dns.node.Node.find_rdataset().

Referenced by dns.zone.Zone.check_origin(), and dns.node.Node.delete_rdataset().

◆ replace_rdataset()

def dns.node.Node.replace_rdataset (   self,
  replacement 
)
Replace an rdataset.

It is not an error if there is no rdataset matching *replacement*.

Ownership of the *replacement* object is transferred to the node;
in other words, this method does not store a copy of *replacement*
at the node, it stores *replacement* itself.

*replacement*, a ``dns.rdataset.Rdataset``.

Raises ``ValueError`` if *replacement* is not a
``dns.rdataset.Rdataset``.

Definition at line 163 of file node.py.

References dns.node.Node.delete_rdataset(), and dns.node.Node.rdatasets.

◆ to_text()

def dns.node.Node.to_text (   self,
  name,
**  kw 
)
Convert a node to text format.

Each rdataset at the node is printed.  Any keyword arguments
to this method are passed on to the rdataset's to_text() method.

*name*, a ``dns.name.Name`` or ``text``, the owner name of the rdatasets.

Returns a ``text``.

Definition at line 37 of file node.py.

References dns.node.Node.rdatasets.

Referenced by dns.rrset.RRset.__str__(), dns.rdataset.Rdataset.__str__(), dns.rdata.Rdata.__str__(), and dns.rdata.Rdata.validate().

Member Data Documentation

◆ __slots__

list dns.node.Node.__slots__ = ['rdatasets']
staticprivate

Definition at line 31 of file node.py.

◆ rdatasets


The documentation for this class was generated from the following file: