Ejemplo n.º 1
0
Archivo: api.py Proyecto: 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)
Ejemplo n.º 2
0
Archivo: api.py Proyecto: 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)
Ejemplo n.º 3
0
    def uninstall(self, request, **kwargs):
        self.method_check(request, allowed=['get'])
        self.is_authenticated(request)
        self.throttle_check(request)

        status = PluginManagerSingleton.get().uninstallPlugin(
            plugin_pk=kwargs['pk'])
        self.log_throttled_access(request)
        LisaFactorySingleton.get().SchedReload()
        LisaFactorySingleton.get().LisaReload()
        return self.create_response(request, status, HttpAccepted)
Ejemplo n.º 4
0
Archivo: api.py Proyecto: 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)
Ejemplo n.º 5
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'])
Ejemplo n.º 6
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'])