ceph_argparse.py: validate(): better comment, check for unparsed args

Signed-off-by: Dan Mick <dan.mick@inktank.com>
ceph.in: Move descsort to ceph_argparse.py

Signed-off-by: Dan Mick <dan.mick@inktank.com>
ceph_argparse.py: CephObjectname didn't need a non-default valid()

Signed-off-by: Dan Mick <dan.mick@inktank.com>
ceph_argparse.py: change valid() conventions, accept tuple/list args

valid() used to either return False or raise an exception on various
sorts of invalid behavior; this was confusing and unnecessary.  Make
it simply raise exceptions, and adjust callers to cope.

Also, allow validate_one() to accept either a simple string argument
or a tuple/list argument representing "name=val" (for REST API support).
Invalid conditions now include name mismatch with name of arg in
descriptor.  If no value is given, assume value is the same as name.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Add first cut of REST API daemon/config file.

To run: python ./api; starts HTTP server on port 0.0.0.0:5000

Signed-off-by: Dan Mick <dan.mick@inktank.com>
MonCommands: add new fields: modulename, perms, availability

To help optimize the REST API, we need to know whether the commands
are read (GET) or write (PUT/POST).  However, we also could use that
same info for permission/caps checking.  Add modulename/perms as
the required caps for each command to drive both needs.

The availability field is to control whether a command is displayed/
advertised through the CLI or REST interfaces; some commands aren't
really useful for REST, and we may want to invent REST-only commands;
also, this gives us a way to deprecate commands quickly and leave the
code, should that be desirable.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
MonCap: add parse_permstr() to interpret MonCommands req_perm fields

Signed-off-by: Dan Mick <dan.mick@inktank.com>