summaryrefslogtreecommitdiffstats
path: root/ovh/soapi/domainCapabilities
diff options
context:
space:
mode:
authortv <tv@xso>2011-08-22 16:06:13 +0200
committertv <tv@xso>2011-08-22 16:07:20 +0200
commit44a3b4f5cec7c77c906d913116701c7ec4b8bc6c (patch)
tree25d0b48c972447f22588a9f57f2afd621f95e334 /ovh/soapi/domainCapabilities
parente036c795201a3eea50ec6d966ef4118c173f5189 (diff)
ovh soapi *: use local wsdl copy
Diffstat (limited to 'ovh/soapi/domainCapabilities')
-rwxr-xr-xovh/soapi/domainCapabilities24
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"