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: v13.1.0~337^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e127ec64b4fe900ec044521b130f7b83afd2161b;p=ceph.git pybind/rbd: add `data_pool_id()` image function Fixes: http://tracker.ceph.com/issues/23609 Signed-off-by: Ricardo Dias --- diff --git a/src/pybind/rbd/rbd.pyx b/src/pybind/rbd/rbd.pyx index ce120fae2307..669b45d0e1b4 100644 --- a/src/pybind/rbd/rbd.pyx +++ b/src/pybind/rbd/rbd.pyx @@ -291,6 +291,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, @@ -1995,6 +1996,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)