Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ceph#22 from rjfd/wip-oa-mgr-controllers
mgr/dashboard_v2: Refactoring and support for controller decorator to make development faster
- Loading branch information
Showing
9 changed files
with
410 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import | ||
|
||
import cherrypy | ||
|
||
from ..tools import ApiController, AuthRequired, RESTController | ||
|
||
|
||
@ApiController('ping') | ||
@AuthRequired() | ||
class Ping(object): | ||
@cherrypy.expose | ||
def default(self, *args): | ||
return "pong" | ||
|
||
|
||
@ApiController('echo1') | ||
class EchoArgs(RESTController): | ||
@RESTController.args_from_json | ||
def create(self, msg): | ||
return {'echo': msg} | ||
|
||
|
||
@ApiController('echo2') | ||
class Echo(RESTController): | ||
def create(self, data): | ||
return {'echo': data['msg']} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.