[arvados-dev] Arvados client SDK API ideas

Tim Pierce twp at curoverse.com
Thu Jan 9 12:37:46 EST 2014

These are some ideas I wrote down this morning.  As a software developer, I
think I'd find something like this would make it easier for me to write
code against our webservice API, and to write convenience methods to wrap
around base API calls.

An ArvadosClient object is instantiated to talk to an API server. An
ArvadosClient exposes methods of the form {object}_{method} that implement
the corresponding API endpoints. The arguments to these methods can be
serialized as JSON to generate the request body.


     arv = ArvadosClient.new(:api_host => $host,
             :api_port => $port,
                             :api_token => $api_token)

     successful_jobs = arv.job_list(:where => { :success => true })

     result = arv.link_create(:link_class => :permission,
                           :name => :can_read,
                              :tail_uuid => current_user,
                              :head_uuid => collection_uuid)

The nice thing about this is that (in Ruby, at least) I think we should be
able to implement something like this via method_missing? and allow the API
discovery document to drive the generation of the API.

It would be useful, too, to think a little bit about what sort of interface
the objects returned by API calls should have.

Thoughts welcome, particularly if we think this is (a) obvious, (b)
ridiculous, (c) irrelevant, or some combination of the above :-)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.arvados.org/pipermail/arvados-dev/attachments/20140109/e5231153/attachment.html>

More information about the Arvados-dev mailing list