From: Ricardo Dias Date: Tue, 27 Mar 2018 12:41:26 +0000 (+0100) Subject: pybind/rbd: add `data_pool_id()` image function X-Git-Tag: v12.2.6~141^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=39c2a806038d52971a7abba3bf38576644ebdf3c;p=ceph.git pybind/rbd: add `data_pool_id()` image function Fixes: http://tracker.ceph.com/issues/23609 Signed-off-by: Ricardo Dias (cherry picked from commit e127ec64b4fe900ec044521b130f7b83afd2161b) --- diff --git a/src/pybind/rbd/rbd.pyx b/src/pybind/rbd/rbd.pyx index 5fd8e63ce503..4829c96bf397 100644 --- a/src/pybind/rbd/rbd.pyx +++ b/src/pybind/rbd/rbd.pyx @@ -233,6 +233,7 @@ cdef extern from "rbd/librbd.h" nogil: int rbd_get_id(rbd_image_t image, char *id, size_t id_len) int rbd_get_block_name_prefix(rbd_image_t image, char *prefix, size_t prefix_len) + int64_t rbd_get_data_pool_id(rbd_image_t image) int rbd_get_parent_info2(rbd_image_t image, char *parent_poolname, size_t ppoolnamelen, char *parent_name, size_t pnamelen, @@ -1553,6 +1554,14 @@ cdef class Image(object): finally: free(prefix) + def data_pool_id(self): + """ + Get the pool id of the pool where the data of this RBD image is stored. + + :returns: int - the pool id + """ + return rbd_get_data_pool_id(self.image) + def parent_info(self): """ Get information about a cloned image's parent (if any)