Skip to content

Commit

Permalink
Merge remote-tracking branch 'gh/next'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sage Weil committed Jul 28, 2013
2 parents a46f60a + 12c1f11 commit ee18322
Show file tree
Hide file tree
Showing 69 changed files with 1,151 additions and 912 deletions.
5 changes: 0 additions & 5 deletions COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ Copyright:
Copyright (C) 2004-2006 Sage Weil <[email protected]>
License: GPL2

Files: src/common/fiemap.cc
Copyright:
Copyright (C) 2010 Canonical
License: GPL2

Files: src/mount/canonicalize.c
Copyright: Copyright (C) 1993 Rick Sladkey <[email protected]>
License: LGPL2 or later
Expand Down
7 changes: 7 additions & 0 deletions PendingReleaseNotes
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ v0.67
in order to accomodate the new write back throttle system. upstart
now sets the fd limit to 32k. sysvinit will set it to 32k by default
(still overrideable via max_open_files).

* The 'ceph pg <pgid> ...' commands (like 'ceph pg <pgid> query') are
deprecated in favor of 'ceph tell <pgid> ...'. This makes the
distinction between 'ceph pg <command> <pgid>' and 'ceph pg <pgid>
<command>' less awkward by making it clearer that the 'tell'
commands are talking to the OSD serving the placement group, not the
monitor.
1 change: 1 addition & 0 deletions ceph.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ Requires: librados2 = %{version}-%{release}
Requires: librbd1 = %{version}-%{release}
Requires: libcephfs1 = %{version}-%{release}
Requires: python-flask
Requires: python-requests
%if 0%{defined suse_version}
%py_requires
%endif
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ Description: Ceph test and benchmarking tools.
Package: python-ceph
Architecture: linux-any
Section: python
Depends: librados2, librbd1, python-flask, ${misc:Depends}, ${python:Depends}
Depends: librados2, librbd1, python-flask, ${misc:Depends}, ${python:Depends}, python-requests
X-Python-Version: >= 2.6
Description: Python libraries for the Ceph distributed filesystem
Ceph is a distributed storage and network file system designed to provide
Expand Down
5 changes: 0 additions & 5 deletions debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ Copyright:
Copyright (C) 2004-2006 Sage Weil <[email protected]>
License: GPL2

Files: src/common/fiemap.cc
Copyright:
Copyright (C) 2010 Canonical
License: GPL2

Files: src/mount/canonicalize.c
Copyright: Copyright (C) 1993 Rick Sladkey <[email protected]>
License: LGPL2 or later
Expand Down
75 changes: 46 additions & 29 deletions doc/man/8/ceph-rest-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Synopsis
========

| **ceph-rest-api** [ -c *conffile* ] [ -n *name* ... ]
| **ceph-rest-api** [ -c *conffile* ] [--cluster *clustername* ] [ -n *name* ] [-i *id* ]

Description
Expand All @@ -21,7 +21,7 @@ command-line tool through an HTTP-accessible interface.
Options
=======

.. option:: -c/--conf *conffile*
.. option:: -c/--conf conffile

names the ceph.conf file to use for configuration. If -c is not
specified, the default depends on the state of the --cluster option
Expand All @@ -35,38 +35,49 @@ Options

so you can also pass this option in the environment as CEPH_CONF.

.. option:: --cluster *clustername*
.. option:: --cluster clustername

set *clustername* for use in the $cluster metavariable, for
locating the ceph.conf file. The default is 'ceph'.
You can also pass this option in the environment as
CEPH_CLUSTER_NAME.

.. option:: -n/--name *name*
.. option:: -n/--name name

specifies the client 'name', which is used to find the
client-specific configuration options in the config file, and
also is the name used for authentication when connecting
to the cluster (the entity name appearing in ceph auth list output,
for example). The default is 'client.restapi'. You can also
pass this option in the environment as CEPH_NAME.
for example). The default is 'client.restapi'.

.. option:: -i/--id id

specifies the client 'id', which will form the clientname
as 'client.<id>' if clientname is not set. If -n/-name is
set, that takes precedence.

Also, global Ceph options are supported.


Configuration parameters
========================

Supported configuration parameters include:

* **restapi client name** the 'clientname' used for auth and ceph.conf
* **restapi keyring** the keyring file holding the key for 'clientname'
* **restapi public addr** ip:port to listen on (default 0.0.0.0:5000)
* **keyring** the keyring file holding the key for 'clientname'
* **public addr** ip:port to listen on (default 0.0.0.0:5000)
* **log file** (usual Ceph default)
* **restapi base url** the base URL to answer requests on (default /api/v0.1)
* **restapi log level** critical, error, warning, info, debug
* **restapi log file** (default /var/local/ceph/<clientname>.log)
* **restapi log level** critical, error, warning, info, debug (default warning)

Configuration parameters are searched in the standard order:
first in the section named '<clientname>', then 'client', then 'global'.

A server will run on **restapi public addr** if the ceph-rest-api
executed directly; otherwise, configuration is specified by the
enclosing WSGI web server.
<clientname> is either supplied by -n/--name, "client.<id>" where
<id> is supplied by -i/--id, or 'client.restapi' if neither option
is present.

A single-threaded server will run on **public addr** if the ceph-rest-api
executed directly; otherwise, configuration is specified by the enclosing
WSGI web server.

Commands
========
Expand All @@ -92,7 +103,9 @@ with a small description of each command, is provided when the requested
path is incomplete/partially matching. Requesting / will redirect to
the value of **restapi base url**, and that path will give a full list
of all known commands. The command set is very similar to the commands
supported by the **ceph** tool.
supported by the **ceph** tool. One notable exception is that the
``ceph pg <pgid> <command>`` style of commands is supported here
as ``tell/<pgid>/command?args``.

Deployment as WSGI application
==============================
Expand All @@ -101,18 +114,22 @@ When deploying as WSGI application (say, with Apache/mod_wsgi,
or nginx/uwsgi, or gunicorn, etc.), use the ``ceph_rest_api.py`` module
(``ceph-rest-api`` is a thin layer around this module). The standalone web
server is of course not used, so address/port configuration is done in
the WSGI server. Also, configuration switches are not passed; rather,
environment variables are used:

* CEPH_CONF holds -c/--conf
* CEPH_CLUSTER_NAME holds --cluster
* CEPH_NAME holds -n/--name

Any errors reading configuration or connecting to the cluster cause
ImportError to be raised with a descriptive message on import; see
your WSGI server documentation for how to see those messages in case
of problem.

the WSGI server. Use a python .wsgi module or the equivalent to call
``app = generate_app(conf, cluster, clientname, clientid, args)`` where:

* conf is as -c/--conf above
* cluster is as --cluster above
* clientname, -n/--name
* clientid, -i/--id, and
* args are any other generic Ceph arguments

When app is returned, it will have attributes 'ceph_addr' and 'ceph_port'
set to what the address and port are in the Ceph configuration;
those may be used for the server, or ignored.

Any errors reading configuration or connecting to the cluster cause an
exception to be raised; see your WSGI server documentation for how to
see those messages in case of problem.

Availability
============
Expand Down
21 changes: 19 additions & 2 deletions man/ceph-authtool.8
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,33 @@ will create a new keyring, overwriting any existing keyringfile
.UNINDENT
.INDENT 0.0
.TP
.B \-\-gen\-key
.B \-g, \-\-gen\-key
will generate a new secret key for the specified entityname
.UNINDENT
.INDENT 0.0
.TP
.B \-\-add\-key
.B \-a, \-\-add\-key
will add an encoded key to the keyring
.UNINDENT
.INDENT 0.0
.TP
.B \-u, \-\-set\-uid
sets the auid (authenticated user id) for the specified entityname
.UNINDENT
.INDENT 0.0
.TP
.B \-\-gen\-print\-key
will generate and print a new secret key without adding it to the keyringfile

NOTE: will work without a given keyringfile
.UNINDENT
.INDENT 0.0
.TP
.B \-\-import\-keyring
will import the content of a given keyring into the keyringfile
.UNINDENT
.INDENT 0.0
.TP
.B \-\-cap subsystem capability
will set the capability for given subsystem
.UNINDENT
Expand Down
76 changes: 48 additions & 28 deletions man/ceph-rest-api.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "CEPH-REST-API" "8" "July 12, 2013" "dev" "Ceph"
.TH "CEPH-REST-API" "8" "July 26, 2013" "dev" "Ceph"
.SH NAME
ceph-rest-api \- ceph RESTlike administration server
.
Expand Down Expand Up @@ -32,7 +32,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.
.SH SYNOPSIS
.nf
\fBceph\-rest\-api\fP [ \-c \fIconffile\fP ] [ \-n \fIname\fP ... ]
\fBceph\-rest\-api\fP [ \-c \fIconffile\fP ] [\-\-cluster \fIclustername\fP ] [ \-n \fIname\fP ] [\-i \fIid\fP ]
.fi
.sp
.SH DESCRIPTION
Expand All @@ -44,7 +44,7 @@ command\-line tool through an HTTP\-accessible interface.
.SH OPTIONS
.INDENT 0.0
.TP
.B \-c/\-\-conf *conffile*
.B \-c/\-\-conf conffile
names the ceph.conf file to use for configuration. If \-c is not
specified, the default depends on the state of the \-\-cluster option
(default \(aqceph\(aq; see below). The configuration file is searched
Expand All @@ -64,43 +64,54 @@ so you can also pass this option in the environment as CEPH_CONF.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-cluster *clustername*
.B \-\-cluster clustername
set \fIclustername\fP for use in the $cluster metavariable, for
locating the ceph.conf file. The default is \(aqceph\(aq.
You can also pass this option in the environment as
CEPH_CLUSTER_NAME.
.UNINDENT
.INDENT 0.0
.TP
.B \-n/\-\-name *name*
.B \-n/\-\-name name
specifies the client \(aqname\(aq, which is used to find the
client\-specific configuration options in the config file, and
also is the name used for authentication when connecting
to the cluster (the entity name appearing in ceph auth list output,
for example). The default is \(aqclient.restapi\(aq. You can also
pass this option in the environment as CEPH_NAME.
for example). The default is \(aqclient.restapi\(aq.
.UNINDENT
.INDENT 0.0
.TP
.B \-i/\-\-id id
specifies the client \(aqid\(aq, which will form the clientname
as \(aqclient.<id>\(aq if clientname is not set. If \-n/\-name is
set, that takes precedence.
.sp
Also, global Ceph options are supported.
.UNINDENT
.SH CONFIGURATION PARAMETERS
.sp
Supported configuration parameters include:
.INDENT 0.0
.IP \(bu 2
\fBrestapi client name\fP the \(aqclientname\(aq used for auth and ceph.conf
\fBkeyring\fP the keyring file holding the key for \(aqclientname\(aq
.IP \(bu 2
\fBrestapi keyring\fP the keyring file holding the key for \(aqclientname\(aq
\fBpublic addr\fP ip:port to listen on (default 0.0.0.0:5000)
.IP \(bu 2
\fBrestapi public addr\fP ip:port to listen on (default 0.0.0.0:5000)
\fBlog file\fP (usual Ceph default)
.IP \(bu 2
\fBrestapi base url\fP the base URL to answer requests on (default /api/v0.1)
.IP \(bu 2
\fBrestapi log level\fP critical, error, warning, info, debug
.IP \(bu 2
\fBrestapi log file\fP (default /var/local/ceph/<clientname>.log)
\fBrestapi log level\fP critical, error, warning, info, debug (default warning)
.UNINDENT
.sp
A server will run on \fBrestapi public addr\fP if the ceph\-rest\-api
executed directly; otherwise, configuration is specified by the
enclosing WSGI web server.
Configuration parameters are searched in the standard order:
first in the section named \(aq<clientname>\(aq, then \(aqclient\(aq, then \(aqglobal\(aq.
.sp
<clientname> is either supplied by \-n/\-\-name, "client.<id>" where
<id> is supplied by \-i/\-\-id, or \(aqclient.restapi\(aq if neither option
is present.
.sp
A single\-threaded server will run on \fBpublic addr\fP if the ceph\-rest\-api
executed directly; otherwise, configuration is specified by the enclosing
WSGI web server.
.SH COMMANDS
.sp
Commands are submitted with HTTP GET requests (for commands that
Expand All @@ -122,28 +133,37 @@ with a small description of each command, is provided when the requested
path is incomplete/partially matching. Requesting / will redirect to
the value of \fBrestapi base url\fP, and that path will give a full list
of all known commands. The command set is very similar to the commands
supported by the \fBceph\fP tool.
supported by the \fBceph\fP tool. One notable exception is that the
\fBceph pg <pgid> <command>\fP style of commands is supported here
as \fBtell/<pgid>/command?args\fP.
.SH DEPLOYMENT AS WSGI APPLICATION
.sp
When deploying as WSGI application (say, with Apache/mod_wsgi,
or nginx/uwsgi, or gunicorn, etc.), use the \fBceph_rest_api.py\fP module
(\fBceph\-rest\-api\fP is a thin layer around this module). The standalone web
server is of course not used, so address/port configuration is done in
the WSGI server. Also, configuration switches are not passed; rather,
environment variables are used:
the WSGI server. Use a python .wsgi module or the equivalent to call
\fBapp = generate_app(conf, cluster, clientname, clientid, args)\fP where:
.INDENT 0.0
.IP \(bu 2
CEPH_CONF holds \-c/\-\-conf
conf is as \-c/\-\-conf above
.IP \(bu 2
cluster is as \-\-cluster above
.IP \(bu 2
CEPH_CLUSTER_NAME holds \-\-cluster
clientname, \-n/\-\-name
.IP \(bu 2
CEPH_NAME holds \-n/\-\-name
clientid, \-i/\-\-id, and
.IP \(bu 2
args are any other generic Ceph arguments
.UNINDENT
.sp
Any errors reading configuration or connecting to the cluster cause
ImportError to be raised with a descriptive message on import; see
your WSGI server documentation for how to see those messages in case
of problem.
When app is returned, it will have attributes \(aqceph_addr\(aq and \(aqceph_port\(aq
set to what the address and port are in the Ceph configuration;
those may be used for the server, or ignored.
.sp
Any errors reading configuration or connecting to the cluster cause an
exception to be raised; see your WSGI server documentation for how to
see those messages in case of problem.
.SH AVAILABILITY
.sp
\fBceph\-rest\-api\fP is part of the Ceph distributed file system. Please refer to the Ceph documentation at
Expand Down
1 change: 1 addition & 0 deletions qa/fs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/test_o_trunc
3 changes: 1 addition & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ ceph_radosacl_SOURCES = radosacl.cc
ceph_radosacl_LDADD = librados.la $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS) $(EXTRALIBS)
bin_DEBUGPROGRAMS += ceph_scratchtool ceph_scratchtoolpp ceph_radosacl

rbd_SOURCES = rbd.cc common/fiemap.cc common/secret.c common/TextTable.cc common/util.cc
rbd_SOURCES = rbd.cc common/secret.c common/TextTable.cc common/util.cc
rbd_CXXFLAGS = ${AM_CXXFLAGS}
rbd_LDADD = librbd.la librados.la $(LIBGLOBAL_LDA) -lkeyutils
if LINUX
Expand Down Expand Up @@ -1895,7 +1895,6 @@ noinst_HEADERS = \
include/encoding.h\
include/err.h\
include/error.h\
include/fiemap.h\
include/filepath.h\
include/frag.h\
include/hash.h\
Expand Down
Loading

0 comments on commit ee18322

Please sign in to comment.