mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Add api method to reload a tool's configuration.
This commit is contained in:
@@ -3,6 +3,7 @@ import urllib
|
||||
from galaxy import exceptions
|
||||
from galaxy import web, util
|
||||
from galaxy.web import _future_expose_api_anonymous
|
||||
from galaxy.web import _future_expose_api
|
||||
from galaxy.web.base.controller import BaseAPIController
|
||||
from galaxy.web.base.controller import UsesVisualizationMixin
|
||||
from galaxy.web.base.controller import UsesHistoryMixin
|
||||
@@ -12,6 +13,8 @@ from galaxy.visualization.data_providers.genome import *
|
||||
|
||||
from galaxy.managers.collections_util import dictify_dataset_collection_instance
|
||||
|
||||
import galaxy.queue_worker
|
||||
|
||||
import logging
|
||||
log = logging.getLogger( __name__ )
|
||||
|
||||
@@ -58,6 +61,18 @@ class ToolsController( BaseAPIController, UsesVisualizationMixin, UsesHistoryMix
|
||||
tool = self._get_tool( id )
|
||||
return tool.to_dict( trans, io_details=io_details, link_details=link_details )
|
||||
|
||||
@_future_expose_api
|
||||
@web.require_admin
|
||||
def reload( self, trans, tool_id, **kwd ):
|
||||
"""
|
||||
GET /api/tools/{tool_id}/reload
|
||||
Reload specified tool.
|
||||
"""
|
||||
toolbox = trans.app.toolbox
|
||||
galaxy.queue_worker.send_control_task( trans, 'reload_tool', noop_self=True, kwargs={ 'tool_id': tool_id } )
|
||||
message, status = trans.app.toolbox.reload_tool_by_id( tool_id )
|
||||
return { status: message }
|
||||
|
||||
@_future_expose_api_anonymous
|
||||
def citations( self, trans, id, **kwds ):
|
||||
tool = self._get_tool( id )
|
||||
|
||||
@@ -179,6 +179,7 @@ def populate_api_routes( webapp, app ):
|
||||
webapp.mapper.resource( 'ftp_file', 'ftp_files', path_prefix='/api' )
|
||||
webapp.mapper.resource( 'group', 'groups', path_prefix='/api' )
|
||||
webapp.mapper.resource_with_deleted( 'quota', 'quotas', path_prefix='/api' )
|
||||
webapp.mapper.connect( '/api/tools/{id:.+?}/reload', action='reload', controller="tools" )
|
||||
webapp.mapper.connect( '/api/tools/{id:.+?}/citations', action='citations', controller="tools" )
|
||||
webapp.mapper.connect( '/api/tools/{id:.+?}/download', action='download', controller="tools" )
|
||||
webapp.mapper.connect( '/api/tools/{id:.+?}', action='show', controller="tools" )
|
||||
|
||||
Reference in New Issue
Block a user