ceph/go-ceph

Missing rbd API components: function rbd_list

Opened this issue · 1 comments

image

I saw an API for querying the RBD image list in the Ceph source code, but go-ceph did not provide it.
Would you consider adding this method?
What method should be used to replace the outdated list method tag?

func GetImageNames(ioctx *rados.IOContext) ([]string, error) {
var images []C.rbd_image_spec_t
size := C.size_t(4096)
for {
images = make([]C.rbd_image_spec_t, size)
ret := C.rbd_list2(

The function GetImageNames is based on the rbd_list2 api. It predates the convention of mentioning the C API name in the doc comment. Please try GetImageNames and see if that meets your needs.

What method should be used to replace the outdated list method tag?

I don't know what you mean by this. If you're referring to the CEPH_RB_DEPRECATED flag in the header. You don't need to worry about it as the api we use is rbd_list2. If you mean something else, please clarify the question.

PS. In the future please copy-paste plain text source code (the ceph header snippet) instead of using a screen shot. It makes it easier to view the message in the email notifications and is searchable by future users.