Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / pybind / mgr / restful / api / __init__.py
1 from pecan import expose
2 from pecan.rest import RestController
3
4 from config import Config
5 from crush import Crush
6 from doc import Doc
7 from mon import Mon
8 from osd import Osd
9 from pool import Pool
10 from request import Request
11 from server import Server
12
13
14 class Root(RestController):
15     config = Config()
16     crush = Crush()
17     doc = Doc()
18     mon = Mon()
19     osd = Osd()
20     pool = Pool()
21     request = Request()
22     server = Server()
23
24     @expose(template='json')
25     def get(self, **kwargs):
26         """
27         Show the basic information for the REST API
28         This includes values like api version or auth method
29         """
30         return {
31             'api_version': 1,
32             'auth':
33                 'Use "ceph restful create-key <key>" to create a key pair, '
34                 'pass it as HTTP Basic auth to authenticate',
35             'doc': 'See /doc endpoint',
36             'info': "Ceph Manager RESTful API server",
37         }