From: Dimitri Maziuk <dmaziuk@bmrb.wisc.edu>
To: Sage Weil <sage@inktank.com>
Cc: Gregory Farnum <greg@inktank.com>,
"ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: Re: rest mgmt api
Date: Mon, 11 Feb 2013 16:38:42 -0600 [thread overview]
Message-ID: <511972F2.7080304@bmrb.wisc.edu> (raw)
In-Reply-To: <alpine.DEB.2.00.1302111345000.27987@cobra.newdream.net>
[-- Attachment #1: Type: text/plain, Size: 1691 bytes --]
On 02/11/2013 04:00 PM, Sage Weil wrote:
> On Mon, 11 Feb 2013, Gregory Farnum wrote:
...
> That doesn't really help; it means the mon still has to understand the
> CLI grammar.
>
> What we are talking about is the difference between:
>
> [ 'osd', 'down', '123' ]
>
> and
>
> {
> URI: '/osd/down',
> OSD-Id: 123
> }
>
> or however we generically translate the HTTP request into JSON.
I think the setup we have in mind is where the MON reads something like
{"who:"osd", "which":"123", "what":"down", "when":"now"} from a socket
(pipe, whatever),
the CLI reads "osd down 123 now" from the prompt and pushes {"who:"osd",
"which":"123", "what":"down", "when":"now"} into that socket,
the webapp gets whatever: "/osd/down/123/now" or
?who=osd&command=down&id=123&when=now" from whoever impersonates the
browser and pipes {"who:"osd", "which":"123", "what":"down",
"when":"now"} into that same socket,
and all three of them are three completely separate applications that
don't try to do what they don't need to.
> FWIW you could pass the CLI command as JSON, but that's no different than
> encoding vector<string>; it's still a different way to describing the same
> command.
The devil is of course in the details: in (e.g.) python json.loads() the
string and gives you the map you could plug into a lookup table or
something to get right to the function call. My c++ is way rusty, I've
no idea what's available in boost &co -- if you have to roll your own
json parser then you indeed don't care how that vector<string> is encoded.
--
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
next prev parent reply other threads:[~2013-02-11 22:38 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 [this message]
2013-02-11 22:41 ` Gregory Farnum
2013-02-12 0:51 ` Sage Weil
2013-02-06 19:36 ` Dan Mick
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=511972F2.7080304@bmrb.wisc.edu \
--to=dmaziuk@bmrb.wisc.edu \
--cc=ceph-devel@vger.kernel.org \
--cc=greg@inktank.com \
--cc=sage@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.