]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/plugins/interfaces.py
import 15.2.9
[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 8 from .. import mgr
9f95a23c 9 mgr = mgr # type: ignore
11fdf7f2
TL
10
11
92f5a8d4
TL
12class CanCherrypy(Mixin):
13 import cherrypy
14 request = cherrypy.request
15 response = cherrypy.response
16
17
18@PM.add_interface
19class Initializable(Interface):
20 @PM.add_abcspec
21 def init(self):
22 """
23 Placeholder for module scope initialization
24 """
25
26
11fdf7f2
TL
27@PM.add_interface
28class Setupable(Interface):
29 @PM.add_abcspec
30 def setup(self):
31 """
32 Placeholder for plugin setup, right after server start.
9f95a23c 33 CanMgr.mgr is initialized by then.
11fdf7f2 34 """
11fdf7f2
TL
35
36
37@PM.add_interface
38class HasOptions(Interface):
39 @PM.add_abcspec
9f95a23c
TL
40 def get_options(self):
41 pass
11fdf7f2
TL
42
43
44@PM.add_interface
45class HasCommands(Interface):
46 @PM.add_abcspec
9f95a23c
TL
47 def register_commands(self):
48 pass
11fdf7f2
TL
49
50
51@PM.add_interface
52class HasControllers(Interface):
53 @PM.add_abcspec
9f95a23c
TL
54 def get_controllers(self):
55 pass
11fdf7f2
TL
56
57
92f5a8d4
TL
58@PM.add_interface
59class ConfiguresCherryPy(Interface):
60 @PM.add_abcspec
61 def configure_cherrypy(self, config):
62 pass
63
64
65class FilterRequest(object):
11fdf7f2
TL
66 @PM.add_interface
67 class BeforeHandler(Interface):
68 @PM.add_abcspec
9f95a23c
TL
69 def filter_request_before_handler(self, request):
70 pass
adb31ebb
TL
71
72
73@PM.add_interface
74class ConfigNotify(Interface):
75 @PM.add_abcspec
76 def config_notify(self):
77 """
78 This method is called whenever a option of this mgr module has
79 been modified.
80 """