A simple Python library to provide access to a complex Zimbra Soap interface.
pip install git+https://github.com/rodrigollima/zadmin.git
For all request you need an Auth token instance
from zadmin.auth import Auth
auth = Auth('https://zimbrahost.tld:7071/service/admin/soap', '[email protected]', 'secretpassword')
auth.token
from zadmin.auth import Auth
from zadmin.domain import Domain
## Create
auth = Auth('https://zimbrahost.tld:7071/service/admin/soap', '[email protected]', 'secretpassword')
domain = Domain(auth)
d = domain.create(hostname='newhost.tld')
## Get domain id
domain = Domain(auth)
d = domain.get(hostname='newhost.tld')
## List all
auth = Auth('https://zimbrahost.tld:7071/service/admin/soap', '[email protected]', 'secretpassword')
domain = Domain(auth)
d = domain.list()
## Get account quantity by Class of Service
domain = Domain(auth)
q = domain.count_accounts_by_class_of_service('newhost.tld')
from zadmin.auth import Auth
from zadmin.account import Account
## Get All accounts by domain hostname
auth = Auth('https://zimbrahost.tld:7071/service/admin/soap', '[email protected]', 'secretpassword')
account = Account(auth)
a = account.get_all_accounts(hostname='zimbrahost.tld')
## Create account
auth = Auth('https://zimbrahost.tld:7071/service/admin/soap', '[email protected]', 'secretpassword')
account = Account(auth)
a = account.create(account='[email protected]', password='fdas@#F555AFSD',zimbraCosId='8e97e282-8aa0-4ac4-96fb-7e2e7620c0a4')
## Rename account
auth = Auth('https://zimbrahost.tld:7071/service/admin/soap', '[email protected]', 'secretpassword')
account = Account(auth)
a = account.rename(id='bcd33ca4-ab26-48cd-ba0e-a6f68011b4bc', account='[email protected]')
## Update account
auth = Auth('https://zimbrahost.tld:7071/service/admin/soap', '[email protected]', 'secretpassword')
account = Account(auth)
a = account.update(id='bcd33ca4-ab26-48cd-ba0e-a6f68011b4bc', zimbraCosId='8e97e282-8aa0-4ac4-96fb-7e2e7620c0a4')
from zadmin.auth import Auth
from zadmin.cos import Cos
auth = Auth('https://zimbrahost.tld:7071/service/admin/soap', '[email protected]', 'secretpassword')
cos = Cos(auth)
c = cos.list()
from zadmin.auth import Auth
from zadmin.backup import BackupQuery
auth = Auth('https://zimbrahost.tld:7071/service/admin/soap', '[email protected]', 'secretpassword')
backup = BackupQuery(auth)
b = backup.get(account='[email protected]')
Domain
- creation
- list
Account
- creation
- rename
COS
- list
BackupQuery
- get