A programmer friendly interface for iRedAdmin (OSE version)
- Only supports MD5 passwords
- Only supports MySQL
$ virtualenv -p $(which python2.7) venv
$ source venv/bin/activate
(venv)$ python setup.py develop
Before you can start making API calls, you must initialize a connection to the database back end you wish to manage.
To do so simply call the init_db
method with a SQLAlchemy database URL. If you're unclear on how to create one, see: http://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls
Example:
import mailapi
mailapi.domain.get_all_domains() # throws a RuntimeError
mailapi.init_db('mysql://scott:[email protected]:3306/vmail') # Initialize the db connection
mailapi.domain.get_all_domains() # works!
I suggest you look at the test cases in ./tests as they illustrate how this package should be used and the expected outcomes.
Easy...
(venv)$ TEST_DB_CONN_STR='mysql://scott:[email protected]:3306/vmail' python setup.py test
Lol, fork me bro