A Python package to interact with Ploi API.
Ploi is an awesome server management tool that lets you manage an Ubuntu server to host PHP applications with great flexibility. If you want to programatically interact with Ploi using Python, then this package will let you consume their API the easy way.
Install from PyPi:
pip install ploi
or clone this repo and run:
python setup.py install
from ploi.ploi import Ploi
ApiToken = '#############' # Your Ploi API Token
p = Ploi(ApiToken)
p.list_servers()
p.get_server(serverId)
p.list_sites(serverId)
data = {
'root_domain': 'example.com',
'web_directory': '/example/', # Slashes are compulsory
}
p.create_site(serverId, data=data)
p.show_site(serverId, siteId)
p.delete_site(serverId, siteId)
p.list_databases(serverId)
data = {
'name': 'dbname',
'user': 'dbuser',
'password': 'dbpassword'
}
p.create_database(serverId, data=data)
p.show_database(serverId, databaseId)
p.delete_database(serverId, databaseId)
More methods will be supported in future versions as this is just a starting point.