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