All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Mick <dan.mick@inktank.com>
To: Joao Eduardo Luis <joao.luis@inktank.com>
Cc: Yehuda Sadeh <yehuda@inktank.com>, Sage Weil <sage@inktank.com>,
	ceph-devel@vger.kernel.org
Subject: Re: rest mgmt api
Date: Wed, 06 Feb 2013 11:36:23 -0800	[thread overview]
Message-ID: <5112B0B7.2040802@inktank.com> (raw)
In-Reply-To: <5112AE17.6080605@inktank.com>


> My take on this is to keep the current behaviour (client issues a
> command and the monitor handles it as it sees fit), but all
> communication should be done in json, either to or from the monitors.
> This would allow us to provide more information on each result, getting
> rid of all the annoying format on the reply messages and simplify a
> great deal of code on the monitor end by removing the silly need of
> returning on either plain-text or json.  We would then let the
> client-side libraries deal with converting it to whichever format the
> user wants (plain-text, xml, w/e).  As for new commands on the monitor
> that are not present on the library, replies to said commands could then
> be presented just in json, or we could come up with a standardized way
> to always convert json into a human-readable format/any other format.
>
> This would however mean to be able to parse json on the monitors (which
> we do not currently do, although we do produce json output).  I can't
> say I have strong feeling for the client->monitor communication to be
> done in json, but for sake of coherency I do think it would be best.

Sage and I talked briefly about this yesterday; my take is that the 
input doesn't do very much mechanical validation at all; most of it is 
semantic and based on partial results (i.e. "you can't ask for that from 
this object" or "that object you want to operate on doesn't exist"), so 
I'm not sure we win much from JSON input.  There are a few places where 
numbers need to be validated but that's about it; the input is not 
complex, it's pretty much just a list of words for the most part.

but there's also no reason to rule it out for future 
perhaps-more-complex command inputs.

I think having the commands be self-describing and table-driven will 
solve a whole lot of ugliness, and one of the self-description vectors 
can be "this parameter should be validated in this standard way".

      parent reply	other threads:[~2013-02-06 19:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 17:25 rest mgmt api Sage Weil
2013-02-06 18:15 ` Yehuda Sadeh
2013-02-06 19:05   ` Wido den Hollander
2013-02-06 19:22   ` Dan Mick
2013-02-06 19:25   ` Joao Eduardo Luis
2013-02-06 19:34     ` Sage Weil
2013-02-06 19:51       ` Dimitri Maziuk
2013-02-06 20:14         ` Sage Weil
2013-02-06 21:19           ` Dan Mick
2013-02-06 22:20           ` Dimitri Maziuk
2013-02-07  1:45             ` Jeff Mitchell
2013-02-11 20:04           ` Gregory Farnum
2013-02-11 22:00             ` Sage Weil
2013-02-11 22:38               ` Dimitri Maziuk
2013-02-11 22:41               ` Gregory Farnum
2013-02-12  0:51                 ` Sage Weil
2013-02-06 19:36     ` Dan Mick [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5112B0B7.2040802@inktank.com \
    --to=dan.mick@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=joao.luis@inktank.com \
    --cc=sage@inktank.com \
    --cc=yehuda@inktank.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.