X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fmgr%2FActivePyModule.h;fp=src%2Fceph%2Fsrc%2Fmgr%2FActivePyModule.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=0c2ee12f34e109af1d0a356afcddbcab5f7e127f;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/mgr/ActivePyModule.h b/src/ceph/src/mgr/ActivePyModule.h deleted file mode 100644 index 0c2ee12..0000000 --- a/src/ceph/src/mgr/ActivePyModule.h +++ /dev/null @@ -1,98 +0,0 @@ - -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab -/* - * Ceph - scalable distributed file system - * - * Copyright (C) 2016 John Spray - * - * This is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software - * Foundation. See file COPYING. - */ - - -#pragma once - -// Python.h comes first because otherwise it clobbers ceph's assert -#include "Python.h" - -#include "common/cmdparse.h" -#include "common/LogEntry.h" -#include "common/Mutex.h" -#include "common/Thread.h" -#include "mon/health_check.h" -#include "mgr/Gil.h" - -#include "PyModuleRunner.h" - -#include -#include - - -class ActivePyModule; -class ActivePyModules; - -/** - * A Ceph CLI command description provided from a Python module - */ -class ModuleCommand { -public: - std::string cmdstring; - std::string helpstring; - std::string perm; - ActivePyModule *handler; -}; - -class ActivePyModule : public PyModuleRunner -{ -private: - health_check_map_t health_checks; - - std::vector commands; - - int load_commands(); - - // Optional, URI exposed by plugins that implement serve() - std::string uri; - -public: - ActivePyModule(const std::string &module_name_, - PyObject *pClass_, - const SafeThreadState &my_ts_) - : PyModuleRunner(module_name_, pClass_, my_ts_) - {} - - int load(ActivePyModules *py_modules); - void notify(const std::string ¬ify_type, const std::string ¬ify_id); - void notify_clog(const LogEntry &le); - - const std::vector &get_commands() const - { - return commands; - } - - int handle_command( - const cmdmap_t &cmdmap, - std::stringstream *ds, - std::stringstream *ss); - - void set_health_checks(health_check_map_t&& c) { - health_checks = std::move(c); - } - void get_health_checks(health_check_map_t *checks); - - void set_uri(const std::string &str) - { - uri = str; - } - - std::string get_uri() const - { - return uri; - } -}; - -std::string handle_pyerror(); -