Example #1
0
File: api.py Project: Acruxx/LISA
    def enable(self, request, **kwargs):
        self.method_check(request, allowed=['get'])
        self.is_authenticated(request)
        self.throttle_check(request)

        status = PluginManagerSingleton.get().enablePlugin(plugin_pk=kwargs['pk'])
        self.log_throttled_access(request)
        LisaFactorySingleton.get().SchedReload()
        LisaFactorySingleton.get().LisaReload()
        return self.create_response(request, status, HttpAccepted)
Example #2
0
File: api.py Project: Acruxx/LISA
    def install(self, request, **kwargs):
        self.method_check(request, allowed=['post','get'])
        self.is_authenticated(request)
        self.throttle_check(request)
        plugin_name = kwargs['plugin_name']
        status = PluginManagerSingleton.get().installPlugin(plugin_name=plugin_name)

        self.log_throttled_access(request)
        LisaFactorySingleton.get().SchedReload()
        LisaFactorySingleton.get().LisaReload()
        return self.create_response(request, status, HttpCreated)
Example #3
0
File: api.py Project: Acruxx/LISA
    def engine_reload(self, request, **kwargs):
        self.method_check(request, allowed=['get'])
        self.is_authenticated(request)
        self.throttle_check(request)

        from tastypie.http import HttpAccepted, HttpNotModified

        try:
            LisaFactorySingleton.get().LisaReload()
        except:
            log.err()
            return self.create_response(request, { 'status' : 'failure' }, HttpNotModified)
        self.log_throttled_access(request)
        return self.create_response(request, { 'status': 'success', 'log': "L.I.S.A Engine reloaded"}, HttpAccepted)
Example #4
0
 def __init__(self):
     """
     Set the basic variables.
     """
     self.lisa = LisaFactorySingleton.get()
     self.configuration_lisa = configuration
     self.mongo = MongoClient(host=self.configuration_lisa['database']['server'],
                         port=self.configuration_lisa['database']['port'])