Ejemplo n.º 1
0
"""
Propose: Describe application url
Author: 'yac'
Date:
"""

from app import Application
from _session import Session

session = Session()
app_ = Application()

session.expire_after = int(app_.conf['global']['session_expired_after'])

log = app_.init_logger('APP')


@app_.route('/host/<host_key>')
def host_cotroller(host_key, **params):
    try:

        if host_key == 'modules':
            return {"result": {"local_host": True, "net_policy_server": True}, "success": True}

        return {'host': 'ok', 'host_key': session.session}
    except StandardError:
        log.exception('Error in host_cotroller')
        return {'success': False, 'errorMessage': 'server_error'}

@app_.route('/netpolicy/<netpolicy_key>')