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
string
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_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__

Instance Variables [hide private]

Inherited from message.Message: additional, answer, authority, edns, ednsflags, first, flags, fudge, had_tsig, id, index, keyalgorithm, keyname, keyring, mac, multi, options, origin, original_id, other_data, payload, question, request_mac, request_payload, tsig_ctx, tsig_error, xfr

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.

Parameters:
  • zone (A dns.name.Name or string) - The zone which is being updated.
  • rdclass (An int designating the class, or a string whose value is the name of a class.) - The class of the zone; defaults to dns.rdataclass.IN.
  • keyring (dict) - The TSIG keyring to use; defaults to None.
  • keyname (dns.name.Name or string) - The name of the TSIG key to use; defaults to None. The key must be defined in the keyring. 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.
  • keyalgorithm (string) - The TSIG algorithm to use; defaults to dns.tsig.default_algorithm. Constants for TSIG algorithms are defined in dns.tsig, and the currently implemented algorithms are HMAC_MD5, HMAC_SHA1, HMAC_SHA224, HMAC_SHA256, HMAC_SHA384, and HMAC_SHA512.
Overrides: object.__init__

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

source code 

Add records. The first argument is the replace 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:

  • nothing
  • 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.

Parameters:
  • origin - The origin to be appended to any relative names.
  • max_size - The maximum size of the wire format output; default is 0, which means 'the message's request payload, if nonzero, or 65536'.
Returns: string
Raises:
Overrides: message.Message.to_wire