mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Tweaks to the recent Tool Shed API enhancements, making them more RESTful.
This commit is contained in:
@@ -17,9 +17,9 @@ class CategoriesController( BaseAPIController ):
|
||||
return value_mapper
|
||||
|
||||
@web.expose_api
|
||||
def create_category( self, trans, payload, **kwd ):
|
||||
def create( self, trans, payload, **kwd ):
|
||||
"""
|
||||
POST /api/categories/create_category
|
||||
POST /api/categories
|
||||
Returns a dictionary of information about the created category.
|
||||
|
||||
: param key: the current Galaxy admin user's API key
|
||||
|
||||
@@ -16,9 +16,9 @@ class UsersController( BaseAPIController ):
|
||||
"""RESTful controller for interactions with users in the Tool Shed."""
|
||||
|
||||
@web.expose_api
|
||||
def create_user( self, trans, payload, **kwd ):
|
||||
def create( self, trans, payload, **kwd ):
|
||||
"""
|
||||
POST /api/users/create_user
|
||||
POST /api/users
|
||||
Returns a dictionary of information about the created user.
|
||||
|
||||
: param key: the current Galaxy admin user's API key
|
||||
|
||||
@@ -85,7 +85,6 @@ def app_factory( global_conf, **kwargs ):
|
||||
controller='categories',
|
||||
name_prefix='category_',
|
||||
path_prefix='/api',
|
||||
new={ 'create_category' : 'POST' },
|
||||
parent_resources=dict( member_name='category', collection_name='categories' ) )
|
||||
webapp.mapper.resource( 'repository',
|
||||
'repositories',
|
||||
@@ -112,7 +111,6 @@ def app_factory( global_conf, **kwargs ):
|
||||
controller='users',
|
||||
name_prefix='user_',
|
||||
path_prefix='/api',
|
||||
new={ 'create_user' : 'POST' },
|
||||
parent_resources=dict( member_name='user', collection_name='users' ) )
|
||||
webapp.finalize_config()
|
||||
# Wrap the webapp in some useful middleware
|
||||
|
||||
@@ -39,7 +39,7 @@ def main( options ):
|
||||
if name is not None and description is not None:
|
||||
data = dict( name=name,
|
||||
description=description )
|
||||
url = '%s/api/categories/new/create_category' % to_tool_shed
|
||||
url = '%s/api/categories' % to_tool_shed
|
||||
try:
|
||||
response = submit( url, data, api_key )
|
||||
except Exception, e:
|
||||
|
||||
@@ -42,7 +42,7 @@ def main( options ):
|
||||
data = dict( email=email,
|
||||
password=password,
|
||||
username=username )
|
||||
url = '%s/api/users/new/create_user' % to_tool_shed
|
||||
url = '%s/api/users' % to_tool_shed
|
||||
try:
|
||||
response = submit( url, data, api_key )
|
||||
except Exception, e:
|
||||
|
||||
Reference in New Issue
Block a user