Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BD77A108AA for ; Mon, 28 Oct 2013 06:06:49 +0000 (UTC) Received: (qmail 19101 invoked by uid 500); 28 Oct 2013 06:06:43 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 19072 invoked by uid 500); 28 Oct 2013 06:06:42 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 18922 invoked by uid 99); 28 Oct 2013 06:06:36 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Oct 2013 06:06:36 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id AAA911D37A5; Mon, 28 Oct 2013 06:06:33 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============7608337581358628323==" MIME-Version: 1.0 Subject: Re: Review Request 14889: Expose as much type information to commands.xml as well as to the generated python clasesss for Marvin From: "Prasanna Santhanam" To: "Marcus Sorensen" , "Prasanna Santhanam" Cc: "Ryan Dietrich" , "cloudstack" Date: Mon, 28 Oct 2013 06:06:33 -0000 Message-ID: <20131028060633.7400.64932@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Prasanna Santhanam" X-ReviewGroup: cloudstack X-ReviewRequest-URL: https://reviews.apache.org/r/14889/ X-Sender: "Prasanna Santhanam" References: <20131023213840.3694.81789@reviews.apache.org> In-Reply-To: <20131023213840.3694.81789@reviews.apache.org> Reply-To: "Prasanna Santhanam" --===============7608337581358628323== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/14889/#review27593 ----------------------------------------------------------- One last thing - if you change the ApiXmlDocWriter to include type information, you might want to include that in the API discovery plugin as well. Many of the downstream tools (cloudmonkey/marvin) use the listApis call to sync against the management server's exposed API set. - Prasanna Santhanam On Oct. 23, 2013, 9:38 p.m., Ryan Dietrich wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/14889/ > ----------------------------------------------------------- > > (Updated Oct. 23, 2013, 9:38 p.m.) > > > Review request for cloudstack, Marcus Sorensen and Prasanna Santhanam. > > > Repository: cloudstack-git > > > Description > ------- > > I have a requirement for some work I am doing to "fail early". The existing marvin cloudstackAPI classes give me both the "legal" and "required" elements for each API call as well as the response attributes. However, they do not tell me the types of each value. I've gone ahead and exposed that type information to python and to commands.xml as well. I decided to try and expose things so we're being as descriptive as possible. It's a little deflating how the Request/Response annotations aren't equal (Requests can expose "strings" as "uuid's", allowing me to auto generate regex's for validation). Responses however, simply fall back to the specific java type, (Integer, Long, String, Boolean). > > I believe cloudmonkey could take advantage of this, by stopping invalid parameters from being sent to Cloudstack in the first place (client side validation is good, right?) > I also think the UI could use this as part of their validation routines, if they're using commands.xml as part of their build process. > > > Diffs > ----- > > server/src/com/cloud/api/doc/ApiXmlDocWriter.java c3c0cab > server/src/com/cloud/api/doc/Argument.java 29c361e > tools/marvin/marvin/codegenerator.py 96729f6 > > Diff: https://reviews.apache.org/r/14889/diff/ > > > Testing > ------- > > mvn clean > mvn > cd tools/apidoc > mvn > inspect target/commands.xml > cd ../tools/marvin > mvn > inspect python classes > > > Thanks, > > Ryan Dietrich > > --===============7608337581358628323==--