]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
4 | #ifndef CEPH_CLS_USER_OPS_H | |
5 | #define CEPH_CLS_USER_OPS_H | |
6 | ||
7c673cae | 7 | #include "cls_user_types.h" |
7c673cae FG |
8 | |
9 | struct cls_user_set_buckets_op { | |
10 | list<cls_user_bucket_entry> entries; | |
11 | bool add; | |
12 | real_time time; /* op time */ | |
13 | ||
14 | cls_user_set_buckets_op() : add(false) {} | |
15 | ||
16 | void encode(bufferlist& bl) const { | |
17 | ENCODE_START(1, 1, bl); | |
18 | ::encode(entries, bl); | |
19 | ::encode(add, bl); | |
20 | ::encode(time, bl); | |
21 | ENCODE_FINISH(bl); | |
22 | } | |
23 | ||
24 | void decode(bufferlist::iterator& bl) { | |
25 | DECODE_START(1, bl); | |
26 | ::decode(entries, bl); | |
27 | ::decode(add, bl); | |
28 | ::decode(time, bl); | |
29 | DECODE_FINISH(bl); | |
30 | } | |
31 | ||
32 | void dump(Formatter *f) const; | |
33 | static void generate_test_instances(list<cls_user_set_buckets_op*>& ls); | |
34 | }; | |
35 | WRITE_CLASS_ENCODER(cls_user_set_buckets_op) | |
36 | ||
37 | struct cls_user_remove_bucket_op { | |
38 | cls_user_bucket bucket; | |
39 | ||
40 | cls_user_remove_bucket_op() {} | |
41 | ||
42 | void encode(bufferlist& bl) const { | |
43 | ENCODE_START(1, 1, bl); | |
44 | ::encode(bucket, bl); | |
45 | ENCODE_FINISH(bl); | |
46 | } | |
47 | ||
48 | void decode(bufferlist::iterator& bl) { | |
49 | DECODE_START(1, bl); | |
50 | ::decode(bucket, bl); | |
51 | DECODE_FINISH(bl); | |
52 | } | |
53 | ||
54 | void dump(Formatter *f) const; | |
55 | static void generate_test_instances(list<cls_user_remove_bucket_op*>& ls); | |
56 | }; | |
57 | WRITE_CLASS_ENCODER(cls_user_remove_bucket_op) | |
58 | ||
59 | struct cls_user_list_buckets_op { | |
60 | string marker; | |
61 | string end_marker; | |
62 | int max_entries; /* upperbound to returned num of entries | |
63 | might return less than that and still be truncated */ | |
64 | ||
65 | cls_user_list_buckets_op() | |
66 | : max_entries(0) {} | |
67 | ||
68 | void encode(bufferlist& bl) const { | |
69 | ENCODE_START(2, 1, bl); | |
70 | ::encode(marker, bl); | |
71 | ::encode(max_entries, bl); | |
72 | ::encode(end_marker, bl); | |
73 | ENCODE_FINISH(bl); | |
74 | } | |
75 | ||
76 | void decode(bufferlist::iterator& bl) { | |
77 | DECODE_START(2, bl); | |
78 | ::decode(marker, bl); | |
79 | ::decode(max_entries, bl); | |
80 | if (struct_v >= 2) { | |
81 | ::decode(end_marker, bl); | |
82 | } | |
83 | DECODE_FINISH(bl); | |
84 | } | |
85 | ||
86 | void dump(Formatter *f) const; | |
87 | static void generate_test_instances(list<cls_user_list_buckets_op*>& ls); | |
88 | }; | |
89 | WRITE_CLASS_ENCODER(cls_user_list_buckets_op) | |
90 | ||
91 | struct cls_user_list_buckets_ret { | |
92 | list<cls_user_bucket_entry> entries; | |
93 | string marker; | |
94 | bool truncated; | |
95 | ||
96 | cls_user_list_buckets_ret() : truncated(false) {} | |
97 | ||
98 | void encode(bufferlist& bl) const { | |
99 | ENCODE_START(1, 1, bl); | |
100 | ::encode(entries, bl); | |
101 | ::encode(marker, bl); | |
102 | ::encode(truncated, bl); | |
103 | ENCODE_FINISH(bl); | |
104 | } | |
105 | ||
106 | void decode(bufferlist::iterator& bl) { | |
107 | DECODE_START(1, bl); | |
108 | ::decode(entries, bl); | |
109 | ::decode(marker, bl); | |
110 | ::decode(truncated, bl); | |
111 | DECODE_FINISH(bl); | |
112 | } | |
113 | ||
114 | void dump(Formatter *f) const; | |
115 | static void generate_test_instances(list<cls_user_list_buckets_ret*>& ls); | |
116 | }; | |
117 | WRITE_CLASS_ENCODER(cls_user_list_buckets_ret) | |
118 | ||
119 | ||
120 | struct cls_user_get_header_op { | |
121 | cls_user_get_header_op() {} | |
122 | ||
123 | void encode(bufferlist& bl) const { | |
124 | ENCODE_START(1, 1, bl); | |
125 | ENCODE_FINISH(bl); | |
126 | } | |
127 | ||
128 | void decode(bufferlist::iterator& bl) { | |
129 | DECODE_START(1, bl); | |
130 | DECODE_FINISH(bl); | |
131 | } | |
132 | ||
133 | void dump(Formatter *f) const; | |
134 | static void generate_test_instances(list<cls_user_get_header_op*>& ls); | |
135 | }; | |
136 | WRITE_CLASS_ENCODER(cls_user_get_header_op) | |
137 | ||
94b18763 FG |
138 | struct cls_user_reset_stats_op { |
139 | real_time time; | |
140 | cls_user_reset_stats_op() {} | |
141 | ||
142 | void encode(bufferlist& bl) const { | |
143 | ENCODE_START(1, 1, bl); | |
144 | ::encode(time, bl); | |
145 | ENCODE_FINISH(bl); | |
146 | } | |
147 | ||
148 | void decode(bufferlist::iterator& bl) { | |
149 | DECODE_START(1, bl); | |
150 | ::decode(time, bl); | |
151 | DECODE_FINISH(bl); | |
152 | } | |
153 | ||
154 | void dump(Formatter *f) const; | |
155 | static void generate_test_instances(list<cls_user_reset_stats_op*>& ls); | |
156 | }; | |
157 | WRITE_CLASS_ENCODER(cls_user_reset_stats_op); | |
158 | ||
7c673cae FG |
159 | struct cls_user_get_header_ret { |
160 | cls_user_header header; | |
161 | ||
162 | cls_user_get_header_ret() {} | |
163 | ||
164 | void encode(bufferlist& bl) const { | |
165 | ENCODE_START(1, 1, bl); | |
166 | ::encode(header, bl); | |
167 | ENCODE_FINISH(bl); | |
168 | } | |
169 | ||
170 | void decode(bufferlist::iterator& bl) { | |
171 | DECODE_START(1, bl); | |
172 | ::decode(header, bl); | |
173 | DECODE_FINISH(bl); | |
174 | } | |
175 | ||
176 | void dump(Formatter *f) const; | |
177 | static void generate_test_instances(list<cls_user_get_header_ret*>& ls); | |
178 | }; | |
179 | WRITE_CLASS_ENCODER(cls_user_get_header_ret) | |
180 | ||
181 | struct cls_user_complete_stats_sync_op { | |
182 | real_time time; | |
183 | ||
184 | cls_user_complete_stats_sync_op() {} | |
185 | ||
186 | void encode(bufferlist& bl) const { | |
187 | ENCODE_START(1, 1, bl); | |
188 | ::encode(time, bl); | |
189 | ENCODE_FINISH(bl); | |
190 | } | |
191 | ||
192 | void decode(bufferlist::iterator& bl) { | |
193 | DECODE_START(1, bl); | |
194 | ::decode(time, bl); | |
195 | DECODE_FINISH(bl); | |
196 | } | |
197 | ||
198 | void dump(Formatter *f) const; | |
199 | static void generate_test_instances(list<cls_user_complete_stats_sync_op*>& ls); | |
200 | }; | |
201 | WRITE_CLASS_ENCODER(cls_user_complete_stats_sync_op) | |
202 | ||
203 | ||
204 | #endif |