2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/ddcb4c7e2957/ Changeset: ddcb4c7e2957 User: jmchilton Date: 2014-12-19 14:15:27+00:00 Summary: Replace preferred workflow usage terminology in the API (s/usage/invocation) `GET /api/workflows/<workflow_id>/usage` made sense for read-only operations - but now for instance `POST /api/workflows/<workflow_id>/usage` is the preferred method for invoking workflows and `PUT /api/workflows/<workflow_id>/usage/<usage_id>/steps/<step_id>` can be used to interact with steps while the workflow is running. I think the term is a little awkward in that sense and is incongruous with the rest of Galaxy which uses the terminology "invocations". In a backward compatible way this replaces the usage terminology with invocation terminology (and uses the plural in the route which is more consistent with the rest of the API - `POST /api/histories` for instance). Affected #: 2 files diff -r 815d38c48a5639d47eed92806ef4c196406f58f1 -r ddcb4c7e29574f8605e6a9cd99b039b25300eee9 lib/galaxy/webapps/galaxy/api/workflows.py --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -372,9 +372,9 @@ return item @expose_api - def workflow_request( self, trans, workflow_id, payload, **kwd ): + def invoke( self, trans, workflow_id, payload, **kwd ): """ - POST /api/workflows/{encoded_workflow_id}/usage + POST /api/workflows/{encoded_workflow_id}/invocations Schedule the workflow specified by `workflow_id` to run. """ @@ -398,10 +398,11 @@ return self.encode_all_ids( trans, workflow_invocation.to_dict(), recursive=True ) @expose_api - def workflow_usage(self, trans, workflow_id, **kwd): + def index_invocations(self, trans, workflow_id, **kwd): """ - GET /api/workflows/{workflow_id}/usage - Get the list of the workflow usage + GET /api/workflows/{workflow_id}/invocations + + Get the list of the workflow invocations :param workflow_id: the workflow id (required) :type workflow_id: str @@ -416,53 +417,53 @@ return out @expose_api - def workflow_usage_contents(self, trans, workflow_id, usage_id, **kwd): + def show_invocation(self, trans, workflow_id, invocation_id, **kwd): """ - GET /api/workflows/{workflow_id}/usage/{usage_id} - Get detailed description of workflow usage + GET /api/workflows/{workflow_id}/invocation/{invocation_id} + Get detailed description of workflow invocation - :param workflow_id: the workflow id (required) - :type workflow_id: str + :param workflow_id: the workflow id (required) + :type workflow_id: str - :param usage_id: the usage id (required) - :type usage_id: str + :param invocation_id: the invocation id (required) + :type invocation_id: str :raises: exceptions.MessageException, exceptions.ObjectNotFound """ - decoded_workflow_invocation_id = self.__decode_id( trans, usage_id ) + decoded_workflow_invocation_id = self.__decode_id( trans, invocation_id ) workflow_invocation = self.workflow_manager.get_invocation( trans, decoded_workflow_invocation_id ) if workflow_invocation: return self.__encode_invocation( trans, workflow_invocation ) return None @expose_api - def cancel_workflow_invocation(self, trans, workflow_id, usage_id, **kwd): + def cancel_invocation(self, trans, workflow_id, invocation_id, **kwd): """ - DELETE /api/workflows/{workflow_id}/usage/{usage_id} + DELETE /api/workflows/{workflow_id}/invocation/{invocation_id} Cancel the specified workflow invocation. :param workflow_id: the workflow id (required) :type workflow_id: str - :param usage_id: the usage id (required) - :type usage_id: str + :param invocation_id: the usage id (required) + :type invocation_id: str :raises: exceptions.MessageException, exceptions.ObjectNotFound """ - decoded_workflow_invocation_id = self.__decode_id( trans, usage_id ) + decoded_workflow_invocation_id = self.__decode_id( trans, invocation_id ) workflow_invocation = self.workflow_manager.cancel_invocation( trans, decoded_workflow_invocation_id ) return self.__encode_invocation( trans, workflow_invocation ) @expose_api - def workflow_invocation_step(self, trans, workflow_id, usage_id, step_id, **kwd): + def invocation_step(self, trans, workflow_id, invocation_id, step_id, **kwd): """ - GET /api/workflows/{workflow_id}/usage/{usage_id}/steps/{step_id} + GET /api/workflows/{workflow_id}/invocation/{invocation_id}/steps/{step_id} - :param workflow_id: the workflow id (required) - :type workflow_id: str + :param workflow_id: the workflow id (required) + :type workflow_id: str - :param usage_id: the usage id (required) - :type usage_id: str + :param invocation_id: the invocation id (required) + :type invocation_id: str :param step_id: encoded id of the WorkflowInvocationStep (required) :type step_id: str @@ -480,9 +481,9 @@ return self.__encode_invocation_step( trans, invocation_step ) @expose_api - def workflow_invocation_step_update(self, trans, workflow_id, usage_id, step_id, payload, **kwd): + def update_invocation_step(self, trans, workflow_id, invocation_id, step_id, payload, **kwd): """ - PUT /api/workflows/{workflow_id}/usage/{usage_id}/steps/{step_id} + PUT /api/workflows/{workflow_id}/invocation/{invocation_id}/steps/{step_id} Update state of running workflow step invocation - still very nebulous but this would be for stuff like confirming paused steps can proceed etc.... @@ -491,8 +492,8 @@ :param workflow_id: the workflow id (required) :type workflow_id: str - :param usage_id: the usage id (required) - :type usage_id: str + :param invocation_id: the usage id (required) + :type invocation_id: str :param step_id: encoded id of the WorkflowInvocationStep (required) :type step_id: str diff -r 815d38c48a5639d47eed92806ef4c196406f58f1 -r ddcb4c7e29574f8605e6a9cd99b039b25300eee9 lib/galaxy/webapps/galaxy/buildapp.py --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -227,14 +227,62 @@ webapp.mapper.connect( 'workflow_dict', '/api/workflows/download/{workflow_id}', controller='workflows', action='workflow_dict', conditions=dict( method=['GET'] ) ) # Deprecated in favor of POST /api/workflows with shared_workflow_id in payload. webapp.mapper.connect( 'import_shared_workflow_deprecated', '/api/workflows/import', controller='workflows', action='import_shared_workflow_deprecated', conditions=dict( method=['POST'] ) ) - webapp.mapper.connect( 'workflow_usage', '/api/workflows/{workflow_id}/usage', controller='workflows', action='workflow_usage', conditions=dict(method=['GET'])) - webapp.mapper.connect( 'workflow_usage_contents', '/api/workflows/{workflow_id}/usage/{usage_id}', controller='workflows', action='workflow_usage_contents', conditions=dict(method=['GET'])) - webapp.mapper.connect( 'cancel_workflow_invocation', '/api/workflows/{workflow_id}/usage/{usage_id}', controller='workflows', action='cancel_workflow_invocation', conditions=dict(method=['DELETE'])) - webapp.mapper.connect( 'workflow_invocation_step', '/api/workflows/{workflow_id}/usage/{usage_id}/steps/{step_id}', controller='workflows', action='workflow_invocation_step', conditions=dict(method=['GET'])) - webapp.mapper.connect( 'workflow_invocation_step_update', '/api/workflows/{workflow_id}/usage/{usage_id}/steps/{step_id}', controller='workflows', action='workflow_invocation_step_update', conditions=dict(method=['PUT'])) + # API refers to usages and invocations - these mean the same thing but the + # usage routes should be considered deprecated. + invoke_names = { + "invocations": "", + "usage": "_deprecated", + } + for noun, suffix in invoke_names.iteritems(): + name = "%s%s" % (noun, suffix) + webapp.mapper.connect( + 'list_workflow_%s' % name, + '/api/workflows/{workflow_id}/%s' % noun, + controller='workflows', + action='index_invocations', + conditions=dict(method=['GET']) + ) - webapp.mapper.connect( 'workflow_request', '/api/workflows/{workflow_id}/usage', controller='workflows', action='workflow_request', conditions=dict( method=['POST'] ) ) + webapp.mapper.connect( + 'workflow_%s_contents' % name, + '/api/workflows/{workflow_id}/%s/{invocation_id}' % noun, + controller='workflows', + action='show_invocation', + conditions=dict(method=['GET']) + ) + + webapp.mapper.connect( + 'cancel_workflow_%s' % name, + '/api/workflows/{workflow_id}/%s/{invocation_id}' % noun, + controller='workflows', + action='cancel_invocation', + conditions=dict(method=['DELETE']) + ) + + webapp.mapper.connect( + 'workflow_%s_step' % name, + '/api/workflows/{workflow_id}/%s/{invocation_id}/steps/{step_id}' % noun, + controller='workflows', + action='invocation_step', + conditions=dict(method=['GET']) + ) + + webapp.mapper.connect( + 'workflow_%s_step_update' % name, + '/api/workflows/{workflow_id}/%s/{invocation_id}/steps/{step_id}' % noun, + controller='workflows', + action='update_invocation_step', + conditions=dict(method=['PUT']) + ) + + webapp.mapper.connect( + 'workflow_%s' % name, + '/api/workflows/{workflow_id}/%s' % noun, + controller='workflows', + action='invoke', + conditions=dict( method=['POST'] ) + ) # ============================ # ===== AUTHENTICATE API ===== # ============================ https://bitbucket.org/galaxy/galaxy-central/commits/2aa2f508c508/ Changeset: 2aa2f508c508 User: jmchilton Date: 2015-01-05 20:59:02+00:00 Summary: Merged in jmchilton/galaxy-central-fork-1 (pull request #621) Workflow API: Replace preferred usage terminology in the API (s/usage/invocation) Affected #: 2 files diff -r 03955af117563248e950ec97d151c4a4615eaa58 -r 2aa2f508c50864b3d309d384137e53f5750aed2d lib/galaxy/webapps/galaxy/api/workflows.py --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -372,9 +372,9 @@ return item @expose_api - def workflow_request( self, trans, workflow_id, payload, **kwd ): + def invoke( self, trans, workflow_id, payload, **kwd ): """ - POST /api/workflows/{encoded_workflow_id}/usage + POST /api/workflows/{encoded_workflow_id}/invocations Schedule the workflow specified by `workflow_id` to run. """ @@ -398,10 +398,11 @@ return self.encode_all_ids( trans, workflow_invocation.to_dict(), recursive=True ) @expose_api - def workflow_usage(self, trans, workflow_id, **kwd): + def index_invocations(self, trans, workflow_id, **kwd): """ - GET /api/workflows/{workflow_id}/usage - Get the list of the workflow usage + GET /api/workflows/{workflow_id}/invocations + + Get the list of the workflow invocations :param workflow_id: the workflow id (required) :type workflow_id: str @@ -416,53 +417,53 @@ return out @expose_api - def workflow_usage_contents(self, trans, workflow_id, usage_id, **kwd): + def show_invocation(self, trans, workflow_id, invocation_id, **kwd): """ - GET /api/workflows/{workflow_id}/usage/{usage_id} - Get detailed description of workflow usage + GET /api/workflows/{workflow_id}/invocation/{invocation_id} + Get detailed description of workflow invocation - :param workflow_id: the workflow id (required) - :type workflow_id: str + :param workflow_id: the workflow id (required) + :type workflow_id: str - :param usage_id: the usage id (required) - :type usage_id: str + :param invocation_id: the invocation id (required) + :type invocation_id: str :raises: exceptions.MessageException, exceptions.ObjectNotFound """ - decoded_workflow_invocation_id = self.__decode_id( trans, usage_id ) + decoded_workflow_invocation_id = self.__decode_id( trans, invocation_id ) workflow_invocation = self.workflow_manager.get_invocation( trans, decoded_workflow_invocation_id ) if workflow_invocation: return self.__encode_invocation( trans, workflow_invocation ) return None @expose_api - def cancel_workflow_invocation(self, trans, workflow_id, usage_id, **kwd): + def cancel_invocation(self, trans, workflow_id, invocation_id, **kwd): """ - DELETE /api/workflows/{workflow_id}/usage/{usage_id} + DELETE /api/workflows/{workflow_id}/invocation/{invocation_id} Cancel the specified workflow invocation. :param workflow_id: the workflow id (required) :type workflow_id: str - :param usage_id: the usage id (required) - :type usage_id: str + :param invocation_id: the usage id (required) + :type invocation_id: str :raises: exceptions.MessageException, exceptions.ObjectNotFound """ - decoded_workflow_invocation_id = self.__decode_id( trans, usage_id ) + decoded_workflow_invocation_id = self.__decode_id( trans, invocation_id ) workflow_invocation = self.workflow_manager.cancel_invocation( trans, decoded_workflow_invocation_id ) return self.__encode_invocation( trans, workflow_invocation ) @expose_api - def workflow_invocation_step(self, trans, workflow_id, usage_id, step_id, **kwd): + def invocation_step(self, trans, workflow_id, invocation_id, step_id, **kwd): """ - GET /api/workflows/{workflow_id}/usage/{usage_id}/steps/{step_id} + GET /api/workflows/{workflow_id}/invocation/{invocation_id}/steps/{step_id} - :param workflow_id: the workflow id (required) - :type workflow_id: str + :param workflow_id: the workflow id (required) + :type workflow_id: str - :param usage_id: the usage id (required) - :type usage_id: str + :param invocation_id: the invocation id (required) + :type invocation_id: str :param step_id: encoded id of the WorkflowInvocationStep (required) :type step_id: str @@ -480,9 +481,9 @@ return self.__encode_invocation_step( trans, invocation_step ) @expose_api - def workflow_invocation_step_update(self, trans, workflow_id, usage_id, step_id, payload, **kwd): + def update_invocation_step(self, trans, workflow_id, invocation_id, step_id, payload, **kwd): """ - PUT /api/workflows/{workflow_id}/usage/{usage_id}/steps/{step_id} + PUT /api/workflows/{workflow_id}/invocation/{invocation_id}/steps/{step_id} Update state of running workflow step invocation - still very nebulous but this would be for stuff like confirming paused steps can proceed etc.... @@ -491,8 +492,8 @@ :param workflow_id: the workflow id (required) :type workflow_id: str - :param usage_id: the usage id (required) - :type usage_id: str + :param invocation_id: the usage id (required) + :type invocation_id: str :param step_id: encoded id of the WorkflowInvocationStep (required) :type step_id: str diff -r 03955af117563248e950ec97d151c4a4615eaa58 -r 2aa2f508c50864b3d309d384137e53f5750aed2d lib/galaxy/webapps/galaxy/buildapp.py --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -227,14 +227,62 @@ webapp.mapper.connect( 'workflow_dict', '/api/workflows/download/{workflow_id}', controller='workflows', action='workflow_dict', conditions=dict( method=['GET'] ) ) # Deprecated in favor of POST /api/workflows with shared_workflow_id in payload. webapp.mapper.connect( 'import_shared_workflow_deprecated', '/api/workflows/import', controller='workflows', action='import_shared_workflow_deprecated', conditions=dict( method=['POST'] ) ) - webapp.mapper.connect( 'workflow_usage', '/api/workflows/{workflow_id}/usage', controller='workflows', action='workflow_usage', conditions=dict(method=['GET'])) - webapp.mapper.connect( 'workflow_usage_contents', '/api/workflows/{workflow_id}/usage/{usage_id}', controller='workflows', action='workflow_usage_contents', conditions=dict(method=['GET'])) - webapp.mapper.connect( 'cancel_workflow_invocation', '/api/workflows/{workflow_id}/usage/{usage_id}', controller='workflows', action='cancel_workflow_invocation', conditions=dict(method=['DELETE'])) - webapp.mapper.connect( 'workflow_invocation_step', '/api/workflows/{workflow_id}/usage/{usage_id}/steps/{step_id}', controller='workflows', action='workflow_invocation_step', conditions=dict(method=['GET'])) - webapp.mapper.connect( 'workflow_invocation_step_update', '/api/workflows/{workflow_id}/usage/{usage_id}/steps/{step_id}', controller='workflows', action='workflow_invocation_step_update', conditions=dict(method=['PUT'])) + # API refers to usages and invocations - these mean the same thing but the + # usage routes should be considered deprecated. + invoke_names = { + "invocations": "", + "usage": "_deprecated", + } + for noun, suffix in invoke_names.iteritems(): + name = "%s%s" % (noun, suffix) + webapp.mapper.connect( + 'list_workflow_%s' % name, + '/api/workflows/{workflow_id}/%s' % noun, + controller='workflows', + action='index_invocations', + conditions=dict(method=['GET']) + ) - webapp.mapper.connect( 'workflow_request', '/api/workflows/{workflow_id}/usage', controller='workflows', action='workflow_request', conditions=dict( method=['POST'] ) ) + webapp.mapper.connect( + 'workflow_%s_contents' % name, + '/api/workflows/{workflow_id}/%s/{invocation_id}' % noun, + controller='workflows', + action='show_invocation', + conditions=dict(method=['GET']) + ) + + webapp.mapper.connect( + 'cancel_workflow_%s' % name, + '/api/workflows/{workflow_id}/%s/{invocation_id}' % noun, + controller='workflows', + action='cancel_invocation', + conditions=dict(method=['DELETE']) + ) + + webapp.mapper.connect( + 'workflow_%s_step' % name, + '/api/workflows/{workflow_id}/%s/{invocation_id}/steps/{step_id}' % noun, + controller='workflows', + action='invocation_step', + conditions=dict(method=['GET']) + ) + + webapp.mapper.connect( + 'workflow_%s_step_update' % name, + '/api/workflows/{workflow_id}/%s/{invocation_id}/steps/{step_id}' % noun, + controller='workflows', + action='update_invocation_step', + conditions=dict(method=['PUT']) + ) + + webapp.mapper.connect( + 'workflow_%s' % name, + '/api/workflows/{workflow_id}/%s' % noun, + controller='workflows', + action='invoke', + conditions=dict( method=['POST'] ) + ) # ============================ # ===== AUTHENTICATE API ===== # ============================ 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.