Return-Path: X-Original-To: apmail-aurora-dev-archive@minotaur.apache.org Delivered-To: apmail-aurora-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7C9BD10175 for ; Thu, 27 Mar 2014 19:35:02 +0000 (UTC) Received: (qmail 74412 invoked by uid 500); 27 Mar 2014 19:35:01 -0000 Delivered-To: apmail-aurora-dev-archive@aurora.apache.org Received: (qmail 74348 invoked by uid 500); 27 Mar 2014 19:35:00 -0000 Mailing-List: contact dev-help@aurora.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aurora.incubator.apache.org Delivered-To: mailing list dev@aurora.incubator.apache.org Received: (qmail 74334 invoked by uid 99); 27 Mar 2014 19:34:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2014 19:34:58 +0000 X-ASF-Spam-Status: No, hits=-1998.3 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE,RP_MATCHES_RCVD,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 27 Mar 2014 19:34:56 +0000 Received: (qmail 73376 invoked by uid 99); 27 Mar 2014 19:34:33 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2014 19:34:33 +0000 Received: from localhost (HELO mail-pb0-f48.google.com) (127.0.0.1) (smtp-auth username wfarner, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2014 19:34:33 +0000 Received: by mail-pb0-f48.google.com with SMTP id md12so3928311pbc.35 for ; Thu, 27 Mar 2014 12:34:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=CV+4+sZ5IuP3goLmBXdb97YmZbO5UfaxzJKbrJlTOCk=; b=ObbYMNSJX6BTE5+/33W0cnR2DQ7Sba31PCBJH48MwpUWoRnTRSEs3tPyG2umt8rqUw JQxGNKMsz6W2jzQFw0M4ji4acqg9Zf0687jjIhe70d4vMD/MT9STE0DkvqrEpbF9OE5p F1JDIaUN37zoZq98lO3/4Q2yVkDPrUeSIp69F9tuZToaw1IKO7bxFY7z/x6Os6egpD9Z fAI+lXivH3oaPiQ1ksZXFfXa4YT0XNeX/udKRrDXpVC1uuj/IcBBR0+LI1wnETQTRm6M E62Ce6UyqeawvZOFfO8sbFquFtSqNez4bSby+Ewylp9BxN9j74YCO32rLJi6b5nQ0SWD Vgmw== X-Gm-Message-State: ALoCoQkPpFHzgo43cIAdhR+vb/qxK2qig27Ha03ANxfIV2x7xK4IOF1qdmOk3S7yeGYDWOeQb3e3 MIME-Version: 1.0 X-Received: by 10.68.228.138 with SMTP id si10mr3762909pbc.13.1395948872704; Thu, 27 Mar 2014 12:34:32 -0700 (PDT) Received: by 10.68.58.161 with HTTP; Thu, 27 Mar 2014 12:34:32 -0700 (PDT) Date: Thu, 27 Mar 2014 12:34:32 -0700 Message-ID: Subject: Re: Aurora Client over HTTP/JSON From: Bill Farner To: "dev@aurora.incubator.apache.org" Cc: smadan@paypal.com Content-Type: multipart/alternative; boundary=047d7b2e54ceaebb4404f59bacdf X-Virus-Checked: Checked by ClamAV on apache.org --047d7b2e54ceaebb4404f59bacdf Content-Type: text/plain; charset=ISO-8859-1 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,{}]' [1,"getRoleSummary",2,0,{"0":{"rec":{"1":{"i32":1},"3":{"rec":{"17":{"rec":{"1":{"set":["rec",1,{"1":{"str":"mesos"},"2":{"i32":40},"3":{"i32":20}}]}}}}},"4":{"rec":{"1":{"i32":3}}},"5":{"rec":{"1":{"str":"local"},"2":{"i32":3}}}}}}] 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! -=Bill [1] https://github.com/apache/incubator-aurora/blob/master/src/main/thrift/org/apache/aurora/gen/api.thrift#L496-531 [2] https://github.com/apache/incubator-aurora/blob/master/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerAPIServlet.java [3] http://people.apache.org/~thejas/thrift-0.9/javadoc/org/apache/thrift/protocol/TProtocolFactory.html --047d7b2e54ceaebb4404f59bacdf--