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)
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)
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)
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)
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'])
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'])