add webtasks interface
- add webtasks interface code - add webtasks to generated code documentation - add webtasks and fileservertasks to INSTALLED_APPS
This commit is contained in:
parent
24b4bab0b0
commit
57d4b128f5
6 changed files with 100 additions and 0 deletions
|
@ -258,6 +258,8 @@ LOCAL_APPS = (
|
|||
'taskresults',
|
||||
'mysqltasks',
|
||||
'pgsqltasks',
|
||||
'fileservertasks',
|
||||
'webtasks',
|
||||
'domains',
|
||||
'osusers',
|
||||
'managemails',
|
||||
|
|
4
gnuviechadmin/webtasks/__init__.py
Normal file
4
gnuviechadmin/webtasks/__init__.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
"""
|
||||
This module contains :py:mod:`webtasks.tasks`.
|
||||
|
||||
"""
|
80
gnuviechadmin/webtasks/tasks.py
Normal file
80
gnuviechadmin/webtasks/tasks.py
Normal file
|
@ -0,0 +1,80 @@
|
|||
"""
|
||||
This module defines Celery_ tasks to manage website configurations.
|
||||
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
from celery import shared_task
|
||||
|
||||
|
||||
@shared_task
|
||||
def create_web_vhost_config(username, sitename):
|
||||
"""
|
||||
This task creates a virtual host configuration on an nginx web
|
||||
server.
|
||||
|
||||
:param str username: user who owns the site
|
||||
:param str sitename: site name
|
||||
:return: :py:const:`True` if the creation finished successfully
|
||||
:rtype: boolean
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@shared_task
|
||||
def disable_web_vhost(sitename):
|
||||
"""
|
||||
This task disables a virtual host configuration on an nginx web server.
|
||||
|
||||
:param str sitename: site name
|
||||
:return: :py:const:`True` if the virtual host has been disabled
|
||||
:rtype: boolean
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@shared_task
|
||||
def enable_web_vhost(sitename):
|
||||
"""
|
||||
This task enables an existing virtual host configuration on an nginx web
|
||||
server.
|
||||
|
||||
:param str sitename: site name
|
||||
:return: :py:const:`True` if the virtual host has been enabled
|
||||
:rtype: boolean
|
||||
|
||||
"""
|
||||
|
||||
@shared_task
|
||||
def delete_web_vhost_config(sitename):
|
||||
"""
|
||||
This task removes a virtual host configuration on an nginx web server.
|
||||
|
||||
:param str sitename: site name
|
||||
:return: :py:const:`True` if the configuration has been deleted
|
||||
:rtype: boolean
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@shared_task
|
||||
def create_web_php_fpm_pool_config(username):
|
||||
"""
|
||||
This task creates a PHP FPM pool configuration.
|
||||
|
||||
:param str username: user name
|
||||
:return: :py:const:`True` if the creation finished successfully
|
||||
:rtype: boolean
|
||||
|
||||
"""
|
||||
|
||||
@shared_task
|
||||
def delete_web_php_fpm_pool_config(username):
|
||||
"""
|
||||
This task deletes a PHP FPM pool configuration.
|
||||
|
||||
:param str username: user name
|
||||
:return: :py:const:`True` if the pool has been deleted
|
||||
:rtype: boolean
|
||||
|
||||
"""
|
Loading…
Add table
Add a link
Reference in a new issue