From 8fd95430fe254d0c745b23a10f86aa2bdd8659ec Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 8 Nov 2016 17:12:26 +0800 Subject: [PATCH] doc: add doc for pybind of rgw Signed-off-by: Kefu Chai --- admin/build-doc | 58 ++++++++---------------- doc/api/index.rst | 6 +++ doc/radosgw/api.rst | 14 ++++++ src/pybind/rgw/{rgw_file.pyx => rgw.pyx} | 0 4 files changed, 39 insertions(+), 39 deletions(-) create mode 100644 doc/radosgw/api.rst rename src/pybind/rgw/{rgw_file.pyx => rgw.pyx} (100%) diff --git a/admin/build-doc b/admin/build-doc index 75b0b25d653..2a0c2cc95e1 100755 --- a/admin/build-doc +++ b/admin/build-doc @@ -72,49 +72,29 @@ mkdir -p $vdir/lib export LD_LIBRARY_PATH="$vdir/lib" export PYTHONPATH=$TOPDIR/src/pybind -ln -sf librados.so.2 $vdir/lib/librados.so -gcc -shared -o $vdir/lib/librados.so.2 -xc /dev/null -BUILD_DOC=1 \ - CFLAGS="-iquote$TOPDIR/src/include" \ - CPPFLAGS="-iquote$TOPDIR/src/include" \ - LDFLAGS="-L$vdir/lib -Wl,--no-as-needed" \ - $vdir/bin/pip install $TOPDIR/src/pybind/rados -nm $vdir/lib/python*/*-packages/rados.so | grep 'U rados_' | \ - awk '{ print "void "$2"(void) {}" }' | \ - gcc -shared -o $vdir/lib/librados.so.2 -xc - - # FIXME(sileht): I dunno how to pass the include-dirs correctly with pip # for build_ext step, it should be: # --global-option=build_ext --global-option="--cython-include-dirs $TOPDIR/src/pybind/rados/" # but that doesn't work, so copying the file in the rbd module directly, that's ok for docs -cp -f $TOPDIR/src/pybind/rados/rados.pxd $TOPDIR/src/pybind/rbd/ -cp -f $TOPDIR/src/pybind/rados/rados.pxd $TOPDIR/src/pybind/cephfs/ - -ln -sf librbd.so.1 $vdir/lib/librbd.so -gcc -shared -o $vdir/lib/librbd.so.1 -xc /dev/null -BUILD_DOC=1 \ - CFLAGS="-iquote$TOPDIR/src/include" \ - CPPFLAGS="-iquote$TOPDIR/src/include" \ - LDFLAGS="-L$vdir/lib -Wl,--no-as-needed" \ - $vdir/bin/pip install $TOPDIR/src/pybind/rbd -nm $vdir/lib/python*/*-packages/rbd.so | grep 'U rbd_' | \ - awk '{ print "void "$2"(void) {}" }' | \ - gcc -shared -o $vdir/lib/librbd.so.1 -xc - - - -ln -sf libcephfs.so.1 $vdir/lib/libcephfs.so -gcc -shared -o $vdir/lib/libcephfs.so.1 -xc /dev/null -BUILD_DOC=1 \ - CFLAGS="-iquote$TOPDIR/src/include" \ - CPPFLAGS="-iquote$TOPDIR/src/include" \ - LDFLAGS="-L$vdir/lib -Wl,--no-as-needed" \ - $vdir/bin/pip install $TOPDIR/src/pybind/cephfs -nm $vdir/lib/python*/*-packages/cephfs.so | grep 'U cephfs_' | \ - awk '{ print "void "$2"(void) {}" }' | \ - gcc -shared -o $vdir/lib/libcephfs.so.1 -xc - - -rm -f $TOPDIR/src/pybind/rbd/rados.pxd $TOPDIR/src/pybind/cephfs/rados.pxd - +for bind in rados rbd cephfs rgw; do + if [ ${bind} != rados ]; then + cp -f $TOPDIR/src/pybind/rados/rados.pxd $TOPDIR/src/pybind/${bind}/ + fi + ln -sf lib${bind}.so.1 $vdir/lib/lib${bind}.so + gcc -shared -o $vdir/lib/lib${bind}.so.1 -xc /dev/null + BUILD_DOC=1 \ + CFLAGS="-iquote$TOPDIR/src/include" \ + CPPFLAGS="-iquote$TOPDIR/src/include" \ + LDFLAGS="-L$vdir/lib -Wl,--no-as-needed" \ + $vdir/bin/pip install $TOPDIR/src/pybind/${bind} + # rgwfile_version(), librgw_create(), rgw_mount() + nm $vdir/lib/python*/*-packages/${bind}.so | grep -E "U (lib)?${bind}" | \ + awk '{ print "void "$2"(void) {}" }' | \ + gcc -shared -o $vdir/lib/lib${bind}.so.1 -xc - + if [ ${bind} != rados ]; then + rm -f $TOPDIR/src/pybind/${bind}/rados.pxd + fi +done $vdir/bin/sphinx-build -a -n -b dirhtml -d doctrees $TOPDIR/doc $TOPDIR/build-doc/output/html $vdir/bin/sphinx-build -a -b man -t man -d doctrees $TOPDIR/doc $TOPDIR/build-doc/output/man diff --git a/doc/api/index.rst b/doc/api/index.rst index 7e65aa7836a..4b62dd6b158 100644 --- a/doc/api/index.rst +++ b/doc/api/index.rst @@ -26,6 +26,12 @@ See `librbdpy`_. .. _librbdpy: ../rbd/librbdpy +Ceph RADOS Gateway APIs +======================= + +See `librgw-py`_. + +.. _librgw-py: ../radosgw/api Calamari APIs ============= diff --git a/doc/radosgw/api.rst b/doc/radosgw/api.rst new file mode 100644 index 00000000000..c01a3e57961 --- /dev/null +++ b/doc/radosgw/api.rst @@ -0,0 +1,14 @@ +=============== +librgw (Python) +=============== + +.. highlight:: python + +The `rgw` python module provides file-like access to rgw. + +API Reference +============= + +.. automodule:: rgw + :members: LibRGWFS, FileHandle + diff --git a/src/pybind/rgw/rgw_file.pyx b/src/pybind/rgw/rgw.pyx similarity index 100% rename from src/pybind/rgw/rgw_file.pyx rename to src/pybind/rgw/rgw.pyx -- 2.39.5