Package dns :: Module update :: Class Update
[hide private]
[frames] | no frames]

Class Update

source code

     object --+    
              |    
message.Message --+
                  |
                 Update

Instance Methods [hide private]
 
__init__(self, zone, rdclass=1, keyring=None, keyname=None, keyalgorithm=<DNS name HMAC-MD5.SIG-ALG.REG.INT.>)
Initialize a new DNS Update object.
source code
 
_add_rr(self, name, ttl, rd, deleting=None, section=None)
Add a single RR to the update section.
source code
 
_add(self, replace, section, name, *args)
Add records.
source code
 
add(self, name, *args)
Add records.
source code
 
delete(self, name, *args)
Delete records.
source code
 
replace(self, name, *args)
Replace records.
source code
 
present(self, name, *args)
Require that an owner name (and optionally an rdata type, or specific rdataset) exists as a prerequisite to the execution of the update.
source code
 
absent(self, name, rdtype=None)
Require that an owner name (and optionally an rdata type) does not exist as a prerequisite to the execution of the update.
source code
 
to_wire(self, origin=None, max_size=65535)
Return a string containing the update in DNS compressed wire format.
source code

Inherited from message.Message: __eq__, __ne__, __repr__, __str__, find_rrset, get_rrset, is_response, opcode, rcode, section_from_number, section_number, set_opcode, set_rcode, to_text, use_edns, use_tsig, want_dnssec

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, zone, rdclass=1, keyring=None, keyname=None, keyalgorithm=<DNS name HMAC-MD5.SIG-ALG.REG.INT.>)
(Constructor)

source code 

Initialize a new DNS Update object.

See the documentation of the Message class for a complete description of the keyring dictionary.

*zone*, a ``dns.name.Name`` or ``text``, the zone which is being updated.

*rdclass*, an ``int`` or ``text``, the class of the zone.

*keyring*, a ``dict``, the TSIG keyring to use. If a *keyring* is specified but a *keyname* is not, then the key used will be the first key in the *keyring*. Note that the order of keys in a dictionary is not defined, so applications should supply a keyname when a keyring is used, unless they know the keyring contains only one key.

*keyname*, a ``dns.name.Name`` or ``None``, the name of the TSIG key to use; defaults to ``None``. The key must be defined in the keyring.

*keyalgorithm*, a ``dns.name.Name``, the TSIG algorithm to use.

Overrides: object.__init__

_add(self, replace, section, name, *args)

source code 

Add records.

*replace* is the replacement mode. If ``False``, RRs are added to an existing RRset; if ``True``, the RRset is replaced with the specified contents. The second argument is the section to add to. The third argument is always a name. The other arguments can be:

  • rdataset...
  • ttl, rdata...
  • ttl, rdtype, string...

add(self, name, *args)

source code 

Add records.

The first argument is always a name. The other arguments can be:

  • rdataset...
  • ttl, rdata...
  • ttl, rdtype, string...

delete(self, name, *args)

source code 

Delete records.

The first argument is always a name. The other arguments can be:

  • *empty*
  • rdataset...
  • rdata...
  • rdtype, [string...]

replace(self, name, *args)

source code 

Replace records.

The first argument is always a name. The other arguments can be:

  • rdataset...
  • ttl, rdata...
  • ttl, rdtype, string...

Note that if you want to replace the entire node, you should do a delete of the name followed by one or more calls to add.

present(self, name, *args)

source code 

Require that an owner name (and optionally an rdata type, or specific rdataset) exists as a prerequisite to the execution of the update.

The first argument is always a name. The other arguments can be:

  • rdataset...
  • rdata...
  • rdtype, string...

to_wire(self, origin=None, max_size=65535)

source code 

Return a string containing the update in DNS compressed wire format.

*origin*, a ``dns.name.Name`` or ``None``, the origin to be appended to any relative names. If *origin* is ``None``, then the origin of the ``dns.update.Update`` message object is used (i.e. the *zone* parameter passed when the Update object was created).

*max_size*, an ``int``, the maximum size of the wire format output; default is 0, which means "the message's request payload, if nonzero, or 65535".

Returns a ``binary``.

Overrides: message.Message.to_wire