Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #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)
Exemple #4
0
    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)
Exemple #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'])
Exemple #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'])