All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Mick <dan.mick@inktank.com>
To: Sage Weil <sage@inktank.com>
Cc: Dimitri Maziuk <dmaziuk@bmrb.wisc.edu>, ceph-devel@vger.kernel.org
Subject: Re: rest mgmt api
Date: Wed, 06 Feb 2013 13:19:02 -0800	[thread overview]
Message-ID: <5112C8C6.5020402@inktank.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1302061211550.13326@cobra.newdream.net>



On 02/06/2013 12:14 PM, Sage Weil wrote:
> On Wed, 6 Feb 2013, Dimitri Maziuk wrote:
>> On 02/06/2013 01:34 PM, Sage Weil wrote:
>>
>>> I think the one caveat here is that having a single registry for commands
>>> in the monitor means that commands can come in two flavors: vector<string>
>>> (cli) and URL (presumably in json form).  But a single command
>>> dispatch/registry framework will make that distinction pretty simple...
>>
>> Any reason you can't have your CLI json-encode the commands (or,
>> conversely, your cgi/wsgi/php/servlet URL handler decode them into
>> vector<string>) before passing them on to the monitor?
>
> We can, but they won't necessarily look the same, because it is unlikely
> we can make a sane 1:1 translation of the CLI to REST that makes sense,
> and it would be nice to avoid baking knowledge about the individual
> commands into the client side.
>
>   ceph osd pool create <poolname> <numpgs>
>     vs
>   /osd/pool/?op=create&poolname=foo&numpgs=bar
>
> or whatever.  I know next to nothing about REST API design best practices,
> but I'm guessing it doesn't look like a CLI.
>
> sage

Well we could easily package, say, "mon getmap" into a json
vector-of-strings for transmission as the http payload of the PUT
request, *or* encode them as a simple "s1=mon&s2=getmap", but again, the
data format is so simple that I'm not sure it buys much. We definitely
want all the interpretation centralized in the daemons, I think, so this
is just string marshalling however we choose to do it.

  reply	other threads:[~2013-02-06 21:19 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 [this message]
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

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=5112C8C6.5020402@inktank.com \
    --to=dan.mick@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dmaziuk@bmrb.wisc.edu \
    --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.