gandi_tool.py - fsij-server-admin.git - FSIJ server administration tools.

FSIJ server administration tools. Git repo user
summary refs log tree commit diff
path: root/gandi_tool.py
blob: 594dd0ad42dbbd5b937f577942734e1b2b24b494 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
url='https://rpc.gandi.net/xmlrpc/'
import xmlrpclib
api = xmlrpclib.ServerProxy(url)
import subprocess
command=['gpg', '--decrypt', '-o', '-', 'api-key-info.asc' ]
p = subprocess.Popen(command, stdout=subprocess.PIPE)
keydata_string = p.communicate()[0]
import json
keydata = json.loads(keydata_string)
apikey = keydata['key']
# validation check: is it 24-char?
version = api.version.info(apikey)
print("API Version: %s", version)
print(api.domain.info(apikey, 'fsij.org'))
print(api.domain.forward.count(apikey, 'fsij.org'))
print(api.domain.forward.list(apikey, 'fsij.org'))
# >>> api.domain.forward.create(apikey, 'mydomain.net', 'admin',
# ... {'destinations': ['stephanie@example.com']})
# {'destinations': ['stephanie@example.com'], 'source': 'admin'}
# 
# >>> api.domain.forward.update(apikey, 'mydomain.net', 'admin', ... {'destinations': ['stephanie@example.com', 'steph@example.com']})
# {'destinations': ['stephanie@example.com', 'steph@example.com'], 'source': 'admin'}
# 
# >>> api.domain.forward.delete(apikey, 'mydomain.net', 'admin')
# True
generated by cgit v1.2.3 (git 2.39.1) at 2025年10月16日 03:08:52 +0000

AltStyle によって変換されたページ (->オリジナル) /