aurora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Farner <>
Subject Re: Aurora Client over HTTP/JSON
Date Thu, 27 Mar 2014 19:34:32 GMT
Hi Smarth!

This is out of scope of AURORA-20.  That ticket tracks creating a
guide for new developers on the client.  However, i'm not opposed to
the feature you propose.

The client currently speaks HTTP/JSON.  If you invoke ./gradlew run,
you might notice these API calls when you view some of the pages on
the scheduler web interface.  Chrome developer tools makes it easy to
convert these calls into curl commands.  Here's one stripped down:

$ curl 'http://localhost:8081/api' --data-binary '[1,"getRoleSummary",1,0,{}]'

This is invoking methods on the thrift API [1], and results are
encoded using TJSONProtocol (configured in SchedulerAPIServlet [2]).
You'll notice from the output above that TJSONProtocol encodes fields
with their numeric field IDs, as specified in api.thrift.  This is a
fundamental characteristic of IDLs like thrift and protobuf - field
IDs rather than names are transmitted over the wire.  Obviously, this
is somewhat at odds with the traditional HTTP/JSON approach.

I see three obvious paths forward, some of which might not suit your needs:

- use a part of our client as a python API from your tooling

- use thrift-compiled code in your tooling

- augment the scheduler to have separate endpoints that expose fields
by name rather than numeric ID.  there may be prior art for this, but
otherwise would look something like SchedulerAPIServlet along with a
different TProtocolFactory [3].

Hope that helps!  Cheers!



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message