Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / librbd / api / Image.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #ifndef LIBRBD_API_IMAGE_H
5 #define LIBRBD_API_IMAGE_H
6
7 #include "librbd/Types.h"
8 #include <map>
9 #include <set>
10 #include <string>
11
12 namespace librados { struct IoCtx; }
13
14 namespace librbd {
15
16 struct ImageCtx;
17
18 namespace api {
19
20 template <typename ImageCtxT = librbd::ImageCtx>
21 struct Image {
22   typedef std::pair<int64_t, std::string> PoolSpec;
23   typedef std::set<std::string> ImageIds;
24   typedef std::map<PoolSpec, ImageIds> PoolImageIds;
25   typedef std::map<std::string, std::string> ImageNameToIds;
26
27   static int list_images(librados::IoCtx& io_ctx,
28                          ImageNameToIds *images);
29
30   static int list_children(ImageCtxT *ictx, const ParentSpec &parent_spec,
31                            PoolImageIds *pool_image_ids);
32
33 };
34
35 } // namespace api
36 } // namespace librbd
37
38 extern template class librbd::api::Image<librbd::ImageCtx>;
39
40 #endif // LIBRBD_API_IMAGE_H