From 4fe42821c4832342a5e7015267dfe60066522d1b Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 22 Aug 2011 13:47:25 +0200 Subject: ovh soapi domainCapabilities: initial commit --- ovh/soapi/domainCapabilities | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 ovh/soapi/domainCapabilities (limited to 'ovh/soapi') diff --git a/ovh/soapi/domainCapabilities b/ovh/soapi/domainCapabilities new file mode 100755 index 00000000..edce3f0d --- /dev/null +++ b/ovh/soapi/domainCapabilities @@ -0,0 +1,24 @@ +#!/usr/bin/python + +from os import environ +import pprint +from SOAPpy import WSDL + +soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.24.wsdl') + +username = environ['KREBS_OVH_USER'] +password = environ['KREBS_OVH_PASS'] + +#login +session = soap.login(username, password, 'de', 0) +print "login successfull" + +#domainCapabilities +result = soap.domainCapabilities(session, 'krebsco.de') +print "domainCapabilities successfull" +pp = pprint.PrettyPrinter(indent=4) +pp.pprint(result) # your code here ... + +#logout +soap.logout(session) +print "logout successfull" -- cgit v1.2.3 From f2e027099e77a0f97287b96df0b95a2a3066d3e8 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 22 Aug 2011 13:52:46 +0200 Subject: ovh soapi domainList: initial commit --- ovh/soapi/domainList | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 ovh/soapi/domainList (limited to 'ovh/soapi') diff --git a/ovh/soapi/domainList b/ovh/soapi/domainList new file mode 100755 index 00000000..3f829ebe --- /dev/null +++ b/ovh/soapi/domainList @@ -0,0 +1,24 @@ +#!/usr/bin/python + +from os import environ +import pprint +from SOAPpy import WSDL + +soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.24.wsdl') + +username = environ['KREBS_OVH_USER'] +password = environ['KREBS_OVH_PASS'] + +#login +session = soap.login(username, password, 'de', 0) +print "login successfull" + +#domainHostList +result = soap.domainList(session) +print "domainList successfull" +pp = pprint.PrettyPrinter(indent=4) +pp.pprint(result) # your code here ... + +#logout +soap.logout(session) +print "logout successfull" -- cgit v1.2.3 From 846d579ca352014ba10f9b51ba66672cfcb90540 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 22 Aug 2011 14:58:14 +0200 Subject: ovh soapi zoneEntryList: initial commit --- ovh/soapi/zoneEntryList | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 ovh/soapi/zoneEntryList (limited to 'ovh/soapi') diff --git a/ovh/soapi/zoneEntryList b/ovh/soapi/zoneEntryList new file mode 100755 index 00000000..7c032462 --- /dev/null +++ b/ovh/soapi/zoneEntryList @@ -0,0 +1,24 @@ +#!/usr/bin/python + +from os import environ +import pprint +from SOAPpy import WSDL + +soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.24.wsdl') + +username = environ['KREBS_OVH_USER'] +password = environ['KREBS_OVH_PASS'] + +#login +session = soap.login(username, password, 'de', 0) +print "login successfull" + +#zoneEntryList +result = soap.zoneEntryList(session, 'krebsco.de') +print "zoneEntryList successfull" +pp = pprint.PrettyPrinter(indent=4) +pp.pprint(result) # your code here ... + +#logout +soap.logout(session) +print "logout successfull" -- cgit v1.2.3 From 7c72e088904ee47d3b10e86770e11b41d5fe70e0 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 22 Aug 2011 14:58:33 +0200 Subject: ovh soapi Makefile: initial commit Unfortunately the latest stable SOAPpy is broken, so we have to resort to the latest stable SOAPpy from SVN^_^ --- ovh/soapi/Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ovh/soapi/Makefile (limited to 'ovh/soapi') diff --git a/ovh/soapi/Makefile b/ovh/soapi/Makefile new file mode 100644 index 00000000..6a4a3a6b --- /dev/null +++ b/ovh/soapi/Makefile @@ -0,0 +1,25 @@ +.PHONY: all install +all: select-target + +exes := $(shell \ + find . -mindepth 1 -maxdepth 1 -type f -executable -exec basename \{\} \;) + +target_exes := $(addprefix ../../bin/,$(exes)) + +install: $(target_exes) + +../../bin/%: % SOAPpy + ln -vsnf ../ovh/soapi/$* $@ + +src: + mkdir $@ + +src/SOAPpy: src + cd $< && \ + svn co https://pywebsvcs.svn.sourceforge.net/svnroot/pywebsvcs/trunk/SOAPpy + +src/SOAPpy/build/lib/SOAPpy: src/SOAPpy + cd $< && python setup.py build + +SOAPpy: src/SOAPpy/build/lib/SOAPpy + ln -snf $< -- cgit v1.2.3 From c0788cf40e57f8ef0f12821239373914e243f879 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 22 Aug 2011 15:20:28 +0200 Subject: ovh soapi zoneEntryList: initial commit --- ovh/soapi/zoneEntryList | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'ovh/soapi') diff --git a/ovh/soapi/zoneEntryList b/ovh/soapi/zoneEntryList index 7c032462..eb9c9c09 100755 --- a/ovh/soapi/zoneEntryList +++ b/ovh/soapi/zoneEntryList @@ -1,8 +1,17 @@ #!/usr/bin/python from os import environ -import pprint from SOAPpy import WSDL +from json import dumps, JSONEncoder + +def default(o): + try: + iterable = iter(o) + except TypeError: + pass + else: + return list(iterable) + return JSONEncoder.default(o) soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.24.wsdl') @@ -16,8 +25,7 @@ print "login successfull" #zoneEntryList result = soap.zoneEntryList(session, 'krebsco.de') print "zoneEntryList successfull" -pp = pprint.PrettyPrinter(indent=4) -pp.pprint(result) # your code here ... +print dumps(result, sort_keys=True, indent=2, default=default) #logout soap.logout(session) -- cgit v1.2.3 From a002b665583bad738e47bef6f93f87d6ab74bfda Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 22 Aug 2011 15:21:13 +0200 Subject: ovh soapi zoneEntry{Add,Del}: initial commit --- ovh/soapi/zoneEntryAdd | 25 +++++++++++++++++++++++++ ovh/soapi/zoneEntryDel | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100755 ovh/soapi/zoneEntryAdd create mode 100755 ovh/soapi/zoneEntryDel (limited to 'ovh/soapi') diff --git a/ovh/soapi/zoneEntryAdd b/ovh/soapi/zoneEntryAdd new file mode 100755 index 00000000..68a0b8e3 --- /dev/null +++ b/ovh/soapi/zoneEntryAdd @@ -0,0 +1,25 @@ +#!/usr/bin/python + +from os import environ +from SOAPpy import WSDL + +soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.24.wsdl') + +username = environ['KREBS_OVH_USER'] +password = environ['KREBS_OVH_PASS'] +domain = argv[2] +subdomain = argv[3] +fieldtype = argv[4] +target = argv[5] + +#login +session = soap.login(username, password, 'de', 0) +print "login successfull" + +#zoneEntryAdd +soap.zoneEntryAdd(session, domain, subdomain, fieldtype, target) +print "zoneEntryAdd successfull" + +#logout +soap.logout(session) +print "logout successfull" diff --git a/ovh/soapi/zoneEntryDel b/ovh/soapi/zoneEntryDel new file mode 100755 index 00000000..d6f19932 --- /dev/null +++ b/ovh/soapi/zoneEntryDel @@ -0,0 +1,25 @@ +#!/usr/bin/python + +from os import environ +from SOAPpy import WSDL + +soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.24.wsdl') + +username = environ['KREBS_OVH_USER'] +password = environ['KREBS_OVH_PASS'] +domain = argv[2] +subdomain = argv[3] +fieldtype = argv[4] +target = argv[5] + +#login +session = soap.login(username, password, 'de', 0) +print "login successfull" + +#zoneEntryDel +soap.zoneEntryDel(session, domain, subdomain, fieldtype, target) +print "zoneEntryDel successfull" + +#logout +soap.logout(session) +print "logout successfull" -- cgit v1.2.3 From 4186e40734ae9cf8ab20437b70d09eeae23399c4 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 22 Aug 2011 15:28:34 +0200 Subject: ovh soapi *List: unify [JSON-] output --- ovh/soapi/domainList | 20 +++++++++++--------- ovh/soapi/zoneEntryList | 6 ------ 2 files changed, 11 insertions(+), 15 deletions(-) (limited to 'ovh/soapi') diff --git a/ovh/soapi/domainList b/ovh/soapi/domainList index 3f829ebe..b089f6a4 100755 --- a/ovh/soapi/domainList +++ b/ovh/soapi/domainList @@ -1,24 +1,26 @@ #!/usr/bin/python from os import environ -import pprint from SOAPpy import WSDL +from json import dumps, JSONEncoder + +def default(o): + try: + iterable = iter(o) + except TypeError: + pass + else: + return list(iterable) + return JSONEncoder.default(o) soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.24.wsdl') username = environ['KREBS_OVH_USER'] password = environ['KREBS_OVH_PASS'] -#login session = soap.login(username, password, 'de', 0) -print "login successfull" -#domainHostList result = soap.domainList(session) -print "domainList successfull" -pp = pprint.PrettyPrinter(indent=4) -pp.pprint(result) # your code here ... +print dumps(result, sort_keys=True, indent=2, default=default) -#logout soap.logout(session) -print "logout successfull" diff --git a/ovh/soapi/zoneEntryList b/ovh/soapi/zoneEntryList index eb9c9c09..00f56958 100755 --- a/ovh/soapi/zoneEntryList +++ b/ovh/soapi/zoneEntryList @@ -18,15 +18,9 @@ soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.24.wsdl') username = environ['KREBS_OVH_USER'] password = environ['KREBS_OVH_PASS'] -#login session = soap.login(username, password, 'de', 0) -print "login successfull" -#zoneEntryList result = soap.zoneEntryList(session, 'krebsco.de') -print "zoneEntryList successfull" print dumps(result, sort_keys=True, indent=2, default=default) -#logout soap.logout(session) -print "logout successfull" -- cgit v1.2.3 From ee2d8ddd94e097106e8ebabd906afc82e4e7c63c Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 22 Aug 2011 16:06:13 +0200 Subject: ovh soapi *: use local wsdl copy --- ovh/soapi/domainCapabilities | 24 +- ovh/soapi/domainList | 4 +- ovh/soapi/soapi-re-1.24.wsdl | 20105 +++++++++++++++++++++++++++++++++++++++++ ovh/soapi/zoneEntryAdd | 24 +- ovh/soapi/zoneEntryDel | 24 +- ovh/soapi/zoneEntryList | 4 +- 6 files changed, 20157 insertions(+), 28 deletions(-) create mode 100644 ovh/soapi/soapi-re-1.24.wsdl (limited to 'ovh/soapi') diff --git a/ovh/soapi/domainCapabilities b/ovh/soapi/domainCapabilities index edce3f0d..dad8311d 100755 --- a/ovh/soapi/domainCapabilities +++ b/ovh/soapi/domainCapabilities @@ -1,24 +1,28 @@ #!/usr/bin/python from os import environ -import pprint +from os.path import dirname, realpath from SOAPpy import WSDL +from json import dumps, JSONEncoder -soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.24.wsdl') +def default(o): + try: + iterable = iter(o) + except TypeError: + pass + else: + return list(iterable) + return JSONEncoder.default(o) + +wsdl = dirname(realpath(__file__)) + '/soapi-re-1.24.wsdl' +soap = WSDL.Proxy(wsdl) username = environ['KREBS_OVH_USER'] password = environ['KREBS_OVH_PASS'] -#login session = soap.login(username, password, 'de', 0) -print "login successfull" -#domainCapabilities result = soap.domainCapabilities(session, 'krebsco.de') -print "domainCapabilities successfull" -pp = pprint.PrettyPrinter(indent=4) -pp.pprint(result) # your code here ... +print dumps(result, sort_keys=True, indent=2, default=default) -#logout soap.logout(session) -print "logout successfull" diff --git a/ovh/soapi/domainList b/ovh/soapi/domainList index b089f6a4..342eec72 100755 --- a/ovh/soapi/domainList +++ b/ovh/soapi/domainList @@ -1,6 +1,7 @@ #!/usr/bin/python from os import environ +from os.path import dirname, realpath from SOAPpy import WSDL from json import dumps, JSONEncoder @@ -13,7 +14,8 @@ def default(o): return list(iterable) return JSONEncoder.default(o) -soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.24.wsdl') +wsdl = dirname(realpath(__file__)) + '/soapi-re-1.24.wsdl' +soap = WSDL.Proxy(wsdl) username = environ['KREBS_OVH_USER'] password = environ['KREBS_OVH_PASS'] diff --git a/ovh/soapi/soapi-re-1.24.wsdl b/ovh/soapi/soapi-re-1.24.wsdl new file mode 100644 index 00000000..c628c564 --- /dev/null +++ b/ovh/soapi/soapi-re-1.24.wsdl @@ -0,0 +1,20105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +