1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/60061d1a3696/ changeset: 60061d1a3696 user: jgoecks date: 2012-04-11 17:37:08 summary: Move tools controller from UI controller to an API controller and add show method for tool. affected #: 3 files diff -r 423f4f2910ac90098e799d354a2936513242a21e -r 60061d1a369635facf858766c7a992272b806750 lib/galaxy/web/api/tools.py --- /dev/null +++ b/lib/galaxy/web/api/tools.py @@ -0,0 +1,32 @@ +from galaxy import config, tools, web, util +from galaxy.web.base.controller import BaseController, BaseAPIController + +class ToolsController( BaseAPIController ): + """ + RESTful controller for interactions with tools. + """ + + @web.json + def index( self, trans, **kwds ): + """ + GET /api/tools: returns a list of tools defined by parameters + parameters: + in_panel - if true, tools are returned in panel structure, including sections and labels + trackster - if true, only tools that are compatible with Trackster are returned + """ + + # Read params. + in_panel = util.string_as_bool( kwds.get( 'in_panel', 'True' ) ) + trackster = util.string_as_bool( kwds.get( 'trackster', 'False' ) ) + + # Create return value. + return self.app.toolbox.to_dict( trans, in_panel=in_panel, trackster=trackster ) + + @web.expose_api + def show( self, trans, id, **kwd ): + """ + GET /api/tools/{tool_id} + Returns tool information, including parameters and inputs. + """ + return self.app.toolbox.tools_by_id[ id ].to_dict( trans, all=True ) + \ No newline at end of file diff -r 423f4f2910ac90098e799d354a2936513242a21e -r 60061d1a369635facf858766c7a992272b806750 lib/galaxy/web/buildapp.py --- a/lib/galaxy/web/buildapp.py +++ b/lib/galaxy/web/buildapp.py @@ -129,6 +129,7 @@ webapp.api_mapper.resource( 'request_type', 'request_types', path_prefix='/api' ) webapp.api_mapper.resource( 'role', 'roles', path_prefix='/api' ) webapp.api_mapper.resource_with_deleted( 'quota', 'quotas', path_prefix='/api' ) + webapp.api_mapper.resource( 'tool', 'tools', path_prefix='/api' ) webapp.api_mapper.resource_with_deleted( 'user', 'users', path_prefix='/api' ) webapp.api_mapper.resource( 'workflow', 'workflows', path_prefix='/api' ) webapp.api_mapper.resource_with_deleted( 'history', 'histories', path_prefix='/api' ) diff -r 423f4f2910ac90098e799d354a2936513242a21e -r 60061d1a369635facf858766c7a992272b806750 lib/galaxy/web/controllers/tools.py --- a/lib/galaxy/web/controllers/tools.py +++ /dev/null @@ -1,26 +0,0 @@ -from galaxy import config, tools, web, util -from galaxy.web.base.controller import BaseController, BaseUIController - -class ToolsController( BaseUIController ): - """ - RESTful controller for interactions with tools. Once session-based - authentication can be done with API controllers, this will be moved - to be part of the API. - """ - - @web.json - def index( self, trans, **kwds ): - """ - GET /api/tools: returns a list of tools defined by parameters - parameters: - in_panel - if true, tools are returned in panel structure, including sections and labels - trackster - if true, only tools that are compatible with Trackster are returned - """ - - # Read params. - in_panel = util.string_as_bool( kwds.get( 'in_panel', 'True' ) ) - trackster = util.string_as_bool( kwds.get( 'trackster', 'False' ) ) - - # Create return value. - return self.app.toolbox.to_dict( trans, in_panel=in_panel, trackster=trackster ) - \ No newline at end of file Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.