Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Commit

Permalink
adds the Noop Command
Browse files Browse the repository at this point in the history
Signed-off-by: Jochen Maes <[email protected]>
  • Loading branch information
sejo committed Feb 15, 2014
1 parent eedf389 commit fcceaf0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
46 changes: 27 additions & 19 deletions pyatomiadns/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,22 @@ def AddDnsRecords(self, zone, records):
response = self.request("AddDnsRecords", data)
return self.process_response(response)

def AddZone(self, zonename, zonettl, mname, rname, refresh, retry, expire, minimum, nameservers, nameservergroup):
"""Add a zone to the Atomia DNS master database.
def Noop(self):
"""Noop command used to authenticate
"""
arguments = []
data = json.dumps(arguments)
response = self.request("Noop", data)
return self.process_response(response)

def GetZone(self, zone):
"""GetZone returns the complete zone info with all records
:param zonename: `str` the name of the zone
:param zonettl: `int` the ttl of the SOA-record and the NS-records
:param mname: `str` the SOA mname field
:param rname: `str` the SOA rname field
:param refresh: `int` the SOA refresh field
:param retry: `int` the SOA retry field
:param expire: `int` the SOA expire field
:param minimum: `int` the SOA minimum field
:param nameservers: `str` a string of the hostnames of the nameservers for the zone comma separated within brackets (["dns1.example.org","dns2.example.org"])
:param nameservergroup: `str` the nameserver group that should host the zone
:param zone: `str` zone (example.org, sejo-it.be,...)
"""
arguments = [zonename,zonettl,mname,rname,refresh,retry,expire,minimum,nameservers,nameservergroup,]
arguments = [zone,]
data = json.dumps(arguments)
response = self.request("AddZone", data)
response = self.request("GetZone", data)
return self.process_response(response)

def DeleteDnsRecords(self, zone, records):
Expand Down Expand Up @@ -212,14 +211,23 @@ def AddAccount(self, email, password_soap):
response = self.request("AddAccount", data)
return self.process_response(response)

def GetZone(self, zone):
"""GetZone returns the complete zone info with all records
def AddZone(self, zonename, zonettl, mname, rname, refresh, retry, expire, minimum, nameservers, nameservergroup):
"""Add a zone to the Atomia DNS master database.
:param zone: `str` zone (example.org, sejo-it.be,...)
:param zonename: `str` the name of the zone
:param zonettl: `int` the ttl of the SOA-record and the NS-records
:param mname: `str` the SOA mname field
:param rname: `str` the SOA rname field
:param refresh: `int` the SOA refresh field
:param retry: `int` the SOA retry field
:param expire: `int` the SOA expire field
:param minimum: `int` the SOA minimum field
:param nameservers: `str` a string of the hostnames of the nameservers for the zone comma separated within brackets (["dns1.example.org","dns2.example.org"])
:param nameservergroup: `str` the nameserver group that should host the zone
"""
arguments = [zone,]
arguments = [zonename,zonettl,mname,rname,refresh,retry,expire,minimum,nameservers,nameservergroup,]
data = json.dumps(arguments)
response = self.request("GetZone", data)
response = self.request("AddZone", data)
return self.process_response(response)

def AddNameserver(self, nameserver, nameservergroup):
Expand Down
5 changes: 4 additions & 1 deletion pyatomiadns/client_builder/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,7 @@ DeleteAccount:
- "email"
docstring: 'Removes a soap account
:param email: `str` email off the account'
:param email: `str` email off the account'

Noop:
docstring: "Noop command used to authenticate"

0 comments on commit fcceaf0

Please sign in to comment.