Tsig¶
-
class
dyn.tm.zones.
TSIG
(name, *args, **kwargs)[source]¶ A class representing DynECT TSIG Records
-
__init__
(name, *args, **kwargs)[source]¶ Create a
TSIG
objectParameters: - name – The name of the TSIG key for
TSIG
object - algorithm – Algorithm used for
TSIG
object. Valid options: hmac-sha1, hmac-md5, hmac-sha224,hmac-sha256, hmac-sha384, hmac-sha512 - secret – Secret key used by
TSIG
object
- name – The name of the TSIG key for
-
algorithm
¶ Gets Algorithm of
TSIG
object.
-
name
¶ Gets name of TSIG Key in
TSIG
-
secret
¶ Gets Secret key of
TSIG
object
-
Tsig Examples¶
The following examples highlight how to use the TSIG
class to
get/create TSIG
‘s on the dyn.tm System and how to edit these objects
from within a Python script.
Creating a new Tsig¶
The following example shows how to create a new TSIG
on the dyn.tm
System and how to edit some of the fields using the returned TSIG
object. The easiest way to manipulate TSIG
objects is via a
TSIG
object. This example will show how to create new TSIG
, view
the secret key and the algorithm. Then, change the secret key, and finally Delete the
TSIG
from the system.
>>> from dyn.tm.zones import TSIG
>>> new_Tsig = TSIG('MyKey', secret='C9IzEr7gXLjYRW6EmDCDuA==', algorithm='hmac-md5')
>>> new_Tsig.secret
'C9IzEr7gXLjYRW6EmDCDuA=='
>>> new_Tsig.algorithm
hmac-md5
>>> new_Tsig.secret = 'D9IzEr7gXLjYRW6EmDCDuA=='
>>> new_Tsig.secret
'D9IzEr7gXLjYRW6EmDCDuA=='
>>> new_Tsig.delete()
Getting an Existing TSIG object¶
The following example shows how to get an existing TSIG
from the
dyn.tm System. Similarly to the above examples the easiest way to manipulate
existing TSIG
objects is via a TSIG
object.
>>> from dyn.tm.zones import TSIG
>>> old_Tsig = TSIG('oldkey')
>>> old_Tsig.secret
'C9IzEr7gXLjYRW6EmDCDuA=='
>>> old_Tsig.algorithm
hmac-md5
>>> old_Tsig.secret = 'D9IzEr7gXLjYRW6EmDCDuA=='
>>> old_Tsig.secret
'D9IzEr7gXLjYRW6EmDCDuA=='
>>> old_Tsig.delete()