Skip to content

rodrigollima/zadmin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zadmin

A simple Python library to provide access to a complex Zimbra Soap interface.

Installation

pip install git+https://github.com/rodrigollima/zadmin.git

Basics

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

Domain

   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')

Account

   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')

List COS

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

Get Backup Query

   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]')

Feature List

  • Domain
    • creation
    • list
  • Account
    • creation
    • rename
  • COS
    • list
  • BackupQuery
    • get

About

Zimbra API management for python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages