diff options
author | root <root@krebs> | 2011-08-22 23:27:58 +0200 |
---|---|---|
committer | root <root@krebs> | 2011-08-22 23:27:58 +0200 |
commit | b84af6c3d35794f4836d08b47ed7b46ba83ceb02 (patch) | |
tree | 73ef38317b364badabf6dabbf5bb9118f945bfd2 /ovh/soapi/domainCapabilities | |
parent | 4b0a2df306808ef36215009cc0f35db25ae426c6 (diff) | |
parent | 6a0a20ebe261ef6f9c05a3c186bb980e1dd4137a (diff) |
Merge branch 'master' of github.com:/krebscode/painload
Diffstat (limited to 'ovh/soapi/domainCapabilities')
-rwxr-xr-x | ovh/soapi/domainCapabilities | 24 |
1 files changed, 14 insertions, 10 deletions
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" |