]>
git.proxmox.com Git - ceph.git/blob - ceph/src/tools/rbd/Schedule.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_RBD_SCHEDULE_H
5 #define CEPH_RBD_SCHEDULE_H
7 #include "json_spirit/json_spirit.h"
13 #include <boost/program_options.hpp>
15 namespace ceph
{ class Formatter
; }
19 void add_level_spec_options(
20 boost::program_options::options_description
*options
, bool allow_image
=true);
21 int get_level_spec_args(const boost::program_options::variables_map
&vm
,
22 std::map
<std::string
, std::string
> *args
);
23 void add_schedule_options(
24 boost::program_options::options_description
*positional
);
25 int get_schedule_args(const boost::program_options::variables_map
&vm
,
26 bool mandatory
, std::map
<std::string
, std::string
> *args
);
33 int parse(json_spirit::mValue
&schedule_val
);
34 void dump(ceph::Formatter
*f
);
36 friend std::ostream
& operator<<(std::ostream
& os
, Schedule
&s
);
40 std::list
<std::pair
<std::string
, std::string
>> items
;
43 std::ostream
& operator<<(std::ostream
& os
, Schedule
&s
);
47 ScheduleList(bool allow_images
=true) : allow_images(allow_images
) {
50 int parse(const std::string
&list
);
51 Schedule
*find(const std::string
&name
);
52 void dump(ceph::Formatter
*f
);
54 friend std::ostream
& operator<<(std::ostream
& os
, ScheduleList
&l
);
58 std::map
<std::string
, Schedule
> schedules
;
61 std::ostream
& operator<<(std::ostream
& os
, ScheduleList
&l
);
65 #endif // CEPH_RBD_SCHEDULE_H