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(-) 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 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(-) 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 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +