Tweaks to the recent Tool Shed API enhancements, making them more RESTful.

This commit is contained in:
Greg Von Kuster
2014-05-01 16:44:44 -04:00
parent 2028fb12fd
commit e18a0197d7
5 changed files with 6 additions and 8 deletions
@@ -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
+2 -2
View File
@@ -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
-2
View File
@@ -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:
+1 -1
View File
@@ -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: