]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/plugins/interfaces.py
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / pybind / mgr / dashboard / plugins / interfaces.py
CommitLineData
11fdf7f2
TL
1# -*- coding: utf-8 -*-
2from __future__ import absolute_import
3
92f5a8d4 4from . import PLUGIN_MANAGER as PM, Interface, Mixin # pylint: disable=cyclic-import
11fdf7f2
TL
5
6
92f5a8d4 7class CanMgr(Mixin):
11fdf7f2
TL
8 from .. import mgr
9 mgr = mgr
10
11
92f5a8d4 12class CanLog(Mixin):
11fdf7f2
TL
13 from .. import logger
14 log = logger
15
16
92f5a8d4
TL
17class CanCherrypy(Mixin):
18 import cherrypy
19 request = cherrypy.request
20 response = cherrypy.response
21
22
23@PM.add_interface
24class Initializable(Interface):
25 @PM.add_abcspec
26 def init(self):
27 """
28 Placeholder for module scope initialization
29 """
30
31
11fdf7f2
TL
32@PM.add_interface
33class Setupable(Interface):
34 @PM.add_abcspec
35 def setup(self):
36 """
37 Placeholder for plugin setup, right after server start.
38 CanMgr.mgr and CanLog.log are initialized by then.
39 """
40 pass
41
42
43@PM.add_interface
44class HasOptions(Interface):
45 @PM.add_abcspec
46 def get_options(self): pass
47
48
49@PM.add_interface
50class HasCommands(Interface):
51 @PM.add_abcspec
52 def register_commands(self): pass
53
54
55@PM.add_interface
56class HasControllers(Interface):
57 @PM.add_abcspec
58 def get_controllers(self): pass
59
60
92f5a8d4
TL
61@PM.add_interface
62class ConfiguresCherryPy(Interface):
63 @PM.add_abcspec
64 def configure_cherrypy(self, config):
65 pass
66
67
68class FilterRequest(object):
11fdf7f2
TL
69 @PM.add_interface
70 class BeforeHandler(Interface):
71 @PM.add_abcspec
72 def filter_request_before_handler(self, request): pass