<div dir="ltr">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.<div>
<br></div><div>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.</div>
<div><br></div><div>examples:</div><div><br></div><div><div><font face="courier new, monospace" size="1"> arv = ArvadosClient.new(:api_host => $host,</font></div><div><font face="courier new, monospace" size="1"> <span class="" style="white-space:pre"> </span> <span class="" style="white-space:pre"> </span> :api_port => $port,</font></div>
<div><font face="courier new, monospace" size="1"> :api_token => $api_token)</font></div><div><font face="courier new, monospace" size="1"><br></font></div><div><font face="courier new, monospace" size="1"> successful_jobs = arv.job_list(:where => { :success => true })</font></div>
<div><font face="courier new, monospace" size="1"><br></font></div><div><font face="courier new, monospace" size="1"> result = arv.link_create(:link_class => :permission,</font></div><div><font face="courier new, monospace" size="1"> <span class="" style="white-space:pre"> </span> :name => :can_read,</font></div>
<div><font face="courier new, monospace" size="1"> :tail_uuid => current_user,</font></div><div><font face="courier new, monospace" size="1"> :head_uuid => collection_uuid)</font></div>
</div><div><br></div><div>The nice thing about this is that (in Ruby, at least) I think we should be able to implement something like this via <font face="courier new, monospace">method_missing?</font><font face="arial, helvetica, sans-serif"> and allow the API discovery document to drive the generation of the API.</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div>It would be useful, too, to think a little bit about what sort of interface the objects returned by API calls should have.</div><div><br></div><div>Thoughts welcome, particularly if we think this is (a) obvious, (b) ridiculous, (c) irrelevant, or some combination of the above :-)</div>
<div><br></div><div>--t.</div></div>