On 02/06/2013 02:14 PM, Sage Weil wrote: > On Wed, 6 Feb 2013, Dimitri Maziuk wrote: >> 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. (Last I looked "?op=create&poolname=foo" was the Old Busted CGI, The New Shiny Hotness(tm) was supposed to look like "/create/foo" -- and I never understood how the optional parameters are supposed to work. But that's beside the point.) To me you sounded like you the piece that actually does the work (daemon?) should understand both (and have a built-in httpd on top). What I meant is it should know just one and let the UI modules do the translation. -- Dimitri Maziuk Programmer/sysadmin BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
Attachment:
signature.asc
Description: OpenPGP digital signature