]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
7c673cae FG |
4 | #ifndef CEPH_CLS_RGW_OPS_H |
5 | #define CEPH_CLS_RGW_OPS_H | |
6 | ||
7c673cae FG |
7 | #include "cls/rgw/cls_rgw_types.h" |
8 | ||
9 | struct rgw_cls_tag_timeout_op | |
10 | { | |
11 | uint64_t tag_timeout; | |
12 | ||
13 | rgw_cls_tag_timeout_op() : tag_timeout(0) {} | |
14 | ||
15 | void encode(bufferlist &bl) const { | |
16 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 17 | encode(tag_timeout, bl); |
7c673cae FG |
18 | ENCODE_FINISH(bl); |
19 | } | |
11fdf7f2 | 20 | void decode(bufferlist::const_iterator &bl) { |
7c673cae | 21 | DECODE_START(1, bl); |
11fdf7f2 | 22 | decode(tag_timeout, bl); |
7c673cae FG |
23 | DECODE_FINISH(bl); |
24 | } | |
25 | void dump(Formatter *f) const; | |
26 | static void generate_test_instances(list<rgw_cls_tag_timeout_op*>& ls); | |
27 | }; | |
28 | WRITE_CLASS_ENCODER(rgw_cls_tag_timeout_op) | |
29 | ||
30 | struct rgw_cls_obj_prepare_op | |
31 | { | |
32 | RGWModifyOp op; | |
33 | cls_rgw_obj_key key; | |
34 | string tag; | |
35 | string locator; | |
36 | bool log_op; | |
37 | uint16_t bilog_flags; | |
31f18b77 | 38 | rgw_zone_set zones_trace; |
7c673cae FG |
39 | |
40 | rgw_cls_obj_prepare_op() : op(CLS_RGW_OP_UNKNOWN), log_op(false), bilog_flags(0) {} | |
41 | ||
42 | void encode(bufferlist &bl) const { | |
31f18b77 | 43 | ENCODE_START(7, 5, bl); |
7c673cae | 44 | uint8_t c = (uint8_t)op; |
11fdf7f2 TL |
45 | encode(c, bl); |
46 | encode(tag, bl); | |
47 | encode(locator, bl); | |
48 | encode(log_op, bl); | |
49 | encode(key, bl); | |
50 | encode(bilog_flags, bl); | |
51 | encode(zones_trace, bl); | |
7c673cae FG |
52 | ENCODE_FINISH(bl); |
53 | } | |
11fdf7f2 | 54 | void decode(bufferlist::const_iterator &bl) { |
31f18b77 | 55 | DECODE_START_LEGACY_COMPAT_LEN(7, 3, 3, bl); |
7c673cae | 56 | uint8_t c; |
11fdf7f2 | 57 | decode(c, bl); |
7c673cae FG |
58 | op = (RGWModifyOp)c; |
59 | if (struct_v < 5) { | |
11fdf7f2 | 60 | decode(key.name, bl); |
7c673cae | 61 | } |
11fdf7f2 | 62 | decode(tag, bl); |
7c673cae | 63 | if (struct_v >= 2) { |
11fdf7f2 | 64 | decode(locator, bl); |
7c673cae FG |
65 | } |
66 | if (struct_v >= 4) { | |
11fdf7f2 | 67 | decode(log_op, bl); |
7c673cae FG |
68 | } |
69 | if (struct_v >= 5) { | |
11fdf7f2 | 70 | decode(key, bl); |
7c673cae FG |
71 | } |
72 | if (struct_v >= 6) { | |
11fdf7f2 | 73 | decode(bilog_flags, bl); |
7c673cae | 74 | } |
31f18b77 | 75 | if (struct_v >= 7) { |
11fdf7f2 | 76 | decode(zones_trace, bl); |
31f18b77 | 77 | } |
7c673cae FG |
78 | DECODE_FINISH(bl); |
79 | } | |
80 | void dump(Formatter *f) const; | |
81 | static void generate_test_instances(list<rgw_cls_obj_prepare_op*>& o); | |
82 | }; | |
83 | WRITE_CLASS_ENCODER(rgw_cls_obj_prepare_op) | |
84 | ||
85 | struct rgw_cls_obj_complete_op | |
86 | { | |
87 | RGWModifyOp op; | |
88 | cls_rgw_obj_key key; | |
89 | string locator; | |
90 | rgw_bucket_entry_ver ver; | |
11fdf7f2 | 91 | rgw_bucket_dir_entry_meta meta; |
7c673cae FG |
92 | string tag; |
93 | bool log_op; | |
94 | uint16_t bilog_flags; | |
95 | ||
96 | list<cls_rgw_obj_key> remove_objs; | |
31f18b77 | 97 | rgw_zone_set zones_trace; |
7c673cae FG |
98 | |
99 | rgw_cls_obj_complete_op() : op(CLS_RGW_OP_ADD), log_op(false), bilog_flags(0) {} | |
100 | ||
101 | void encode(bufferlist &bl) const { | |
31f18b77 | 102 | ENCODE_START(9, 7, bl); |
7c673cae | 103 | uint8_t c = (uint8_t)op; |
11fdf7f2 TL |
104 | encode(c, bl); |
105 | encode(ver.epoch, bl); | |
106 | encode(meta, bl); | |
107 | encode(tag, bl); | |
108 | encode(locator, bl); | |
109 | encode(remove_objs, bl); | |
110 | encode(ver, bl); | |
111 | encode(log_op, bl); | |
112 | encode(key, bl); | |
113 | encode(bilog_flags, bl); | |
114 | encode(zones_trace, bl); | |
7c673cae FG |
115 | ENCODE_FINISH(bl); |
116 | } | |
11fdf7f2 | 117 | void decode(bufferlist::const_iterator &bl) { |
31f18b77 | 118 | DECODE_START_LEGACY_COMPAT_LEN(9, 3, 3, bl); |
7c673cae | 119 | uint8_t c; |
11fdf7f2 | 120 | decode(c, bl); |
7c673cae FG |
121 | op = (RGWModifyOp)c; |
122 | if (struct_v < 7) { | |
11fdf7f2 | 123 | decode(key.name, bl); |
7c673cae | 124 | } |
11fdf7f2 TL |
125 | decode(ver.epoch, bl); |
126 | decode(meta, bl); | |
127 | decode(tag, bl); | |
7c673cae | 128 | if (struct_v >= 2) { |
11fdf7f2 | 129 | decode(locator, bl); |
7c673cae FG |
130 | } |
131 | if (struct_v >= 4 && struct_v < 7) { | |
132 | list<string> old_remove_objs; | |
11fdf7f2 | 133 | decode(old_remove_objs, bl); |
7c673cae FG |
134 | |
135 | for (list<string>::iterator iter = old_remove_objs.begin(); | |
136 | iter != old_remove_objs.end(); ++iter) { | |
137 | cls_rgw_obj_key k; | |
138 | k.name = *iter; | |
139 | remove_objs.push_back(k); | |
140 | } | |
141 | } else { | |
11fdf7f2 | 142 | decode(remove_objs, bl); |
7c673cae FG |
143 | } |
144 | if (struct_v >= 5) { | |
11fdf7f2 | 145 | decode(ver, bl); |
7c673cae FG |
146 | } else { |
147 | ver.pool = -1; | |
148 | } | |
149 | if (struct_v >= 6) { | |
11fdf7f2 | 150 | decode(log_op, bl); |
7c673cae FG |
151 | } |
152 | if (struct_v >= 7) { | |
11fdf7f2 | 153 | decode(key, bl); |
7c673cae FG |
154 | } |
155 | if (struct_v >= 8) { | |
11fdf7f2 | 156 | decode(bilog_flags, bl); |
7c673cae | 157 | } |
31f18b77 | 158 | if (struct_v >= 9) { |
11fdf7f2 | 159 | decode(zones_trace, bl); |
31f18b77 | 160 | } |
7c673cae FG |
161 | DECODE_FINISH(bl); |
162 | } | |
163 | void dump(Formatter *f) const; | |
164 | static void generate_test_instances(list<rgw_cls_obj_complete_op*>& o); | |
165 | }; | |
166 | WRITE_CLASS_ENCODER(rgw_cls_obj_complete_op) | |
167 | ||
168 | struct rgw_cls_link_olh_op { | |
169 | cls_rgw_obj_key key; | |
170 | string olh_tag; | |
171 | bool delete_marker; | |
172 | string op_tag; | |
11fdf7f2 | 173 | rgw_bucket_dir_entry_meta meta; |
7c673cae FG |
174 | uint64_t olh_epoch; |
175 | bool log_op; | |
176 | uint16_t bilog_flags; | |
177 | real_time unmod_since; /* only create delete marker if newer then this */ | |
178 | bool high_precision_time; | |
31f18b77 | 179 | rgw_zone_set zones_trace; |
7c673cae FG |
180 | |
181 | rgw_cls_link_olh_op() : delete_marker(false), olh_epoch(0), log_op(false), bilog_flags(0), high_precision_time(false) {} | |
182 | ||
183 | void encode(bufferlist& bl) const { | |
31f18b77 | 184 | ENCODE_START(5, 1, bl); |
11fdf7f2 TL |
185 | encode(key, bl); |
186 | encode(olh_tag, bl); | |
187 | encode(delete_marker, bl); | |
188 | encode(op_tag, bl); | |
189 | encode(meta, bl); | |
190 | encode(olh_epoch, bl); | |
191 | encode(log_op, bl); | |
192 | encode(bilog_flags, bl); | |
7c673cae | 193 | uint64_t t = ceph::real_clock::to_time_t(unmod_since); |
11fdf7f2 TL |
194 | encode(t, bl); |
195 | encode(unmod_since, bl); | |
196 | encode(high_precision_time, bl); | |
197 | encode(zones_trace, bl); | |
7c673cae FG |
198 | ENCODE_FINISH(bl); |
199 | } | |
200 | ||
11fdf7f2 | 201 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 | 202 | DECODE_START(5, bl); |
11fdf7f2 TL |
203 | decode(key, bl); |
204 | decode(olh_tag, bl); | |
205 | decode(delete_marker, bl); | |
206 | decode(op_tag, bl); | |
207 | decode(meta, bl); | |
208 | decode(olh_epoch, bl); | |
209 | decode(log_op, bl); | |
210 | decode(bilog_flags, bl); | |
7c673cae FG |
211 | if (struct_v == 2) { |
212 | uint64_t t; | |
11fdf7f2 | 213 | decode(t, bl); |
7c673cae FG |
214 | unmod_since = ceph::real_clock::from_time_t(static_cast<time_t>(t)); |
215 | } | |
216 | if (struct_v >= 3) { | |
31f18b77 | 217 | uint64_t t; |
11fdf7f2 TL |
218 | decode(t, bl); |
219 | decode(unmod_since, bl); | |
7c673cae FG |
220 | } |
221 | if (struct_v >= 4) { | |
11fdf7f2 | 222 | decode(high_precision_time, bl); |
7c673cae | 223 | } |
31f18b77 | 224 | if (struct_v >= 5) { |
11fdf7f2 | 225 | decode(zones_trace, bl); |
31f18b77 | 226 | } |
7c673cae FG |
227 | DECODE_FINISH(bl); |
228 | } | |
229 | ||
230 | static void generate_test_instances(list<rgw_cls_link_olh_op *>& o); | |
231 | void dump(Formatter *f) const; | |
232 | }; | |
233 | WRITE_CLASS_ENCODER(rgw_cls_link_olh_op) | |
234 | ||
235 | struct rgw_cls_unlink_instance_op { | |
236 | cls_rgw_obj_key key; | |
237 | string op_tag; | |
238 | uint64_t olh_epoch; | |
239 | bool log_op; | |
240 | uint16_t bilog_flags; | |
241 | string olh_tag; | |
31f18b77 | 242 | rgw_zone_set zones_trace; |
7c673cae FG |
243 | |
244 | rgw_cls_unlink_instance_op() : olh_epoch(0), log_op(false), bilog_flags(0) {} | |
245 | ||
246 | void encode(bufferlist& bl) const { | |
31f18b77 | 247 | ENCODE_START(3, 1, bl); |
11fdf7f2 TL |
248 | encode(key, bl); |
249 | encode(op_tag, bl); | |
250 | encode(olh_epoch, bl); | |
251 | encode(log_op, bl); | |
252 | encode(bilog_flags, bl); | |
253 | encode(olh_tag, bl); | |
254 | encode(zones_trace, bl); | |
7c673cae FG |
255 | ENCODE_FINISH(bl); |
256 | } | |
257 | ||
11fdf7f2 | 258 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 | 259 | DECODE_START(3, bl); |
11fdf7f2 TL |
260 | decode(key, bl); |
261 | decode(op_tag, bl); | |
262 | decode(olh_epoch, bl); | |
263 | decode(log_op, bl); | |
264 | decode(bilog_flags, bl); | |
7c673cae | 265 | if (struct_v >= 2) { |
11fdf7f2 | 266 | decode(olh_tag, bl); |
7c673cae | 267 | } |
31f18b77 | 268 | if (struct_v >= 3) { |
11fdf7f2 | 269 | decode(zones_trace, bl); |
31f18b77 | 270 | } |
7c673cae FG |
271 | DECODE_FINISH(bl); |
272 | } | |
273 | ||
274 | static void generate_test_instances(list<rgw_cls_unlink_instance_op *>& o); | |
275 | void dump(Formatter *f) const; | |
276 | }; | |
277 | WRITE_CLASS_ENCODER(rgw_cls_unlink_instance_op) | |
278 | ||
279 | struct rgw_cls_read_olh_log_op | |
280 | { | |
281 | cls_rgw_obj_key olh; | |
282 | uint64_t ver_marker; | |
283 | string olh_tag; | |
284 | ||
285 | rgw_cls_read_olh_log_op() : ver_marker(0) {} | |
286 | ||
287 | void encode(bufferlist &bl) const { | |
288 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
289 | encode(olh, bl); |
290 | encode(ver_marker, bl); | |
291 | encode(olh_tag, bl); | |
7c673cae FG |
292 | ENCODE_FINISH(bl); |
293 | } | |
11fdf7f2 | 294 | void decode(bufferlist::const_iterator &bl) { |
7c673cae | 295 | DECODE_START(1, bl); |
11fdf7f2 TL |
296 | decode(olh, bl); |
297 | decode(ver_marker, bl); | |
298 | decode(olh_tag, bl); | |
7c673cae FG |
299 | DECODE_FINISH(bl); |
300 | } | |
301 | static void generate_test_instances(list<rgw_cls_read_olh_log_op *>& o); | |
302 | void dump(Formatter *f) const; | |
303 | }; | |
304 | WRITE_CLASS_ENCODER(rgw_cls_read_olh_log_op) | |
305 | ||
306 | ||
307 | struct rgw_cls_read_olh_log_ret | |
308 | { | |
11fdf7f2 | 309 | map<uint64_t, vector<rgw_bucket_olh_log_entry> > log; |
7c673cae FG |
310 | bool is_truncated; |
311 | ||
312 | rgw_cls_read_olh_log_ret() : is_truncated(false) {} | |
313 | ||
314 | void encode(bufferlist &bl) const { | |
315 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
316 | encode(log, bl); |
317 | encode(is_truncated, bl); | |
7c673cae FG |
318 | ENCODE_FINISH(bl); |
319 | } | |
11fdf7f2 | 320 | void decode(bufferlist::const_iterator &bl) { |
7c673cae | 321 | DECODE_START(1, bl); |
11fdf7f2 TL |
322 | decode(log, bl); |
323 | decode(is_truncated, bl); | |
7c673cae FG |
324 | DECODE_FINISH(bl); |
325 | } | |
326 | static void generate_test_instances(list<rgw_cls_read_olh_log_ret *>& o); | |
327 | void dump(Formatter *f) const; | |
328 | }; | |
329 | WRITE_CLASS_ENCODER(rgw_cls_read_olh_log_ret) | |
330 | ||
331 | struct rgw_cls_trim_olh_log_op | |
332 | { | |
333 | cls_rgw_obj_key olh; | |
334 | uint64_t ver; | |
335 | string olh_tag; | |
336 | ||
337 | rgw_cls_trim_olh_log_op() : ver(0) {} | |
338 | ||
339 | void encode(bufferlist &bl) const { | |
340 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
341 | encode(olh, bl); |
342 | encode(ver, bl); | |
343 | encode(olh_tag, bl); | |
7c673cae FG |
344 | ENCODE_FINISH(bl); |
345 | } | |
11fdf7f2 | 346 | void decode(bufferlist::const_iterator &bl) { |
7c673cae | 347 | DECODE_START(1, bl); |
11fdf7f2 TL |
348 | decode(olh, bl); |
349 | decode(ver, bl); | |
350 | decode(olh_tag, bl); | |
7c673cae FG |
351 | DECODE_FINISH(bl); |
352 | } | |
353 | static void generate_test_instances(list<rgw_cls_trim_olh_log_op *>& o); | |
354 | void dump(Formatter *f) const; | |
355 | }; | |
356 | WRITE_CLASS_ENCODER(rgw_cls_trim_olh_log_op) | |
357 | ||
358 | struct rgw_cls_bucket_clear_olh_op { | |
359 | cls_rgw_obj_key key; | |
360 | string olh_tag; | |
361 | ||
362 | rgw_cls_bucket_clear_olh_op() {} | |
363 | ||
364 | void encode(bufferlist& bl) const { | |
365 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
366 | encode(key, bl); |
367 | encode(olh_tag, bl); | |
7c673cae FG |
368 | ENCODE_FINISH(bl); |
369 | } | |
370 | ||
11fdf7f2 | 371 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 372 | DECODE_START(1, bl); |
11fdf7f2 TL |
373 | decode(key, bl); |
374 | decode(olh_tag, bl); | |
7c673cae FG |
375 | DECODE_FINISH(bl); |
376 | } | |
377 | ||
378 | static void generate_test_instances(list<rgw_cls_bucket_clear_olh_op *>& o); | |
379 | void dump(Formatter *f) const; | |
380 | }; | |
381 | WRITE_CLASS_ENCODER(rgw_cls_bucket_clear_olh_op) | |
382 | ||
383 | struct rgw_cls_list_op | |
384 | { | |
385 | cls_rgw_obj_key start_obj; | |
386 | uint32_t num_entries; | |
387 | string filter_prefix; | |
388 | bool list_versions; | |
9f95a23c | 389 | string delimiter; |
7c673cae FG |
390 | |
391 | rgw_cls_list_op() : num_entries(0), list_versions(false) {} | |
392 | ||
393 | void encode(bufferlist &bl) const { | |
9f95a23c | 394 | ENCODE_START(6, 4, bl); |
11fdf7f2 TL |
395 | encode(num_entries, bl); |
396 | encode(filter_prefix, bl); | |
397 | encode(start_obj, bl); | |
398 | encode(list_versions, bl); | |
9f95a23c | 399 | encode(delimiter, bl); |
7c673cae FG |
400 | ENCODE_FINISH(bl); |
401 | } | |
11fdf7f2 | 402 | void decode(bufferlist::const_iterator &bl) { |
9f95a23c | 403 | DECODE_START_LEGACY_COMPAT_LEN(6, 2, 2, bl); |
7c673cae | 404 | if (struct_v < 4) { |
11fdf7f2 | 405 | decode(start_obj.name, bl); |
7c673cae | 406 | } |
11fdf7f2 | 407 | decode(num_entries, bl); |
9f95a23c | 408 | if (struct_v >= 3) { |
11fdf7f2 | 409 | decode(filter_prefix, bl); |
9f95a23c TL |
410 | } |
411 | if (struct_v >= 4) { | |
11fdf7f2 | 412 | decode(start_obj, bl); |
9f95a23c TL |
413 | } |
414 | if (struct_v >= 5) { | |
11fdf7f2 | 415 | decode(list_versions, bl); |
9f95a23c TL |
416 | } |
417 | if (struct_v >= 6) { | |
418 | decode(delimiter, bl); | |
419 | } | |
7c673cae FG |
420 | DECODE_FINISH(bl); |
421 | } | |
422 | void dump(Formatter *f) const; | |
423 | static void generate_test_instances(list<rgw_cls_list_op*>& o); | |
424 | }; | |
425 | WRITE_CLASS_ENCODER(rgw_cls_list_op) | |
426 | ||
1adf2230 | 427 | struct rgw_cls_list_ret { |
7c673cae FG |
428 | rgw_bucket_dir dir; |
429 | bool is_truncated; | |
430 | ||
9f95a23c TL |
431 | // cls_filtered is not transmitted; it is assumed true for versions |
432 | // on/after 3 and false for prior versions; this allows the rgw | |
433 | // layer to know when an older osd (cls) does not do the filtering | |
434 | bool cls_filtered; | |
435 | ||
436 | rgw_cls_list_ret() : | |
437 | is_truncated(false), | |
438 | cls_filtered(true) | |
439 | {} | |
7c673cae FG |
440 | |
441 | void encode(bufferlist &bl) const { | |
9f95a23c | 442 | ENCODE_START(3, 2, bl); |
11fdf7f2 TL |
443 | encode(dir, bl); |
444 | encode(is_truncated, bl); | |
7c673cae FG |
445 | ENCODE_FINISH(bl); |
446 | } | |
11fdf7f2 | 447 | void decode(bufferlist::const_iterator &bl) { |
9f95a23c | 448 | DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl); |
11fdf7f2 TL |
449 | decode(dir, bl); |
450 | decode(is_truncated, bl); | |
9f95a23c | 451 | cls_filtered = struct_v >= 3; |
7c673cae FG |
452 | DECODE_FINISH(bl); |
453 | } | |
454 | void dump(Formatter *f) const; | |
455 | static void generate_test_instances(list<rgw_cls_list_ret*>& o); | |
456 | }; | |
457 | WRITE_CLASS_ENCODER(rgw_cls_list_ret) | |
458 | ||
459 | struct rgw_cls_check_index_ret | |
460 | { | |
461 | rgw_bucket_dir_header existing_header; | |
462 | rgw_bucket_dir_header calculated_header; | |
463 | ||
464 | rgw_cls_check_index_ret() {} | |
465 | ||
466 | void encode(bufferlist &bl) const { | |
467 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
468 | encode(existing_header, bl); |
469 | encode(calculated_header, bl); | |
7c673cae FG |
470 | ENCODE_FINISH(bl); |
471 | } | |
11fdf7f2 | 472 | void decode(bufferlist::const_iterator &bl) { |
7c673cae | 473 | DECODE_START(1, bl); |
11fdf7f2 TL |
474 | decode(existing_header, bl); |
475 | decode(calculated_header, bl); | |
7c673cae FG |
476 | DECODE_FINISH(bl); |
477 | } | |
478 | void dump(Formatter *f) const; | |
479 | static void generate_test_instances(list<rgw_cls_check_index_ret *>& o); | |
480 | }; | |
481 | WRITE_CLASS_ENCODER(rgw_cls_check_index_ret) | |
482 | ||
483 | struct rgw_cls_bucket_update_stats_op | |
484 | { | |
485 | bool absolute{false}; | |
11fdf7f2 | 486 | map<RGWObjCategory, rgw_bucket_category_stats> stats; |
7c673cae FG |
487 | |
488 | rgw_cls_bucket_update_stats_op() {} | |
489 | ||
490 | void encode(bufferlist &bl) const { | |
491 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
492 | encode(absolute, bl); |
493 | encode(stats, bl); | |
7c673cae FG |
494 | ENCODE_FINISH(bl); |
495 | } | |
11fdf7f2 | 496 | void decode(bufferlist::const_iterator &bl) { |
7c673cae | 497 | DECODE_START(1, bl); |
11fdf7f2 TL |
498 | decode(absolute, bl); |
499 | decode(stats, bl); | |
7c673cae FG |
500 | DECODE_FINISH(bl); |
501 | } | |
502 | void dump(Formatter *f) const; | |
503 | static void generate_test_instances(list<rgw_cls_bucket_update_stats_op *>& o); | |
504 | }; | |
505 | WRITE_CLASS_ENCODER(rgw_cls_bucket_update_stats_op) | |
506 | ||
507 | struct rgw_cls_obj_remove_op { | |
508 | list<string> keep_attr_prefixes; | |
509 | ||
510 | void encode(bufferlist& bl) const { | |
511 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 512 | encode(keep_attr_prefixes, bl); |
7c673cae FG |
513 | ENCODE_FINISH(bl); |
514 | } | |
515 | ||
11fdf7f2 | 516 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 517 | DECODE_START(1, bl); |
11fdf7f2 | 518 | decode(keep_attr_prefixes, bl); |
7c673cae FG |
519 | DECODE_FINISH(bl); |
520 | } | |
521 | }; | |
522 | WRITE_CLASS_ENCODER(rgw_cls_obj_remove_op) | |
523 | ||
524 | struct rgw_cls_obj_store_pg_ver_op { | |
525 | string attr; | |
526 | ||
527 | void encode(bufferlist& bl) const { | |
528 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 529 | encode(attr, bl); |
7c673cae FG |
530 | ENCODE_FINISH(bl); |
531 | } | |
532 | ||
11fdf7f2 | 533 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 534 | DECODE_START(1, bl); |
11fdf7f2 | 535 | decode(attr, bl); |
7c673cae FG |
536 | DECODE_FINISH(bl); |
537 | } | |
538 | }; | |
539 | WRITE_CLASS_ENCODER(rgw_cls_obj_store_pg_ver_op) | |
540 | ||
541 | struct rgw_cls_obj_check_attrs_prefix { | |
542 | string check_prefix; | |
543 | bool fail_if_exist; | |
544 | ||
545 | rgw_cls_obj_check_attrs_prefix() : fail_if_exist(false) {} | |
546 | ||
547 | void encode(bufferlist& bl) const { | |
548 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
549 | encode(check_prefix, bl); |
550 | encode(fail_if_exist, bl); | |
7c673cae FG |
551 | ENCODE_FINISH(bl); |
552 | } | |
553 | ||
11fdf7f2 | 554 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 555 | DECODE_START(1, bl); |
11fdf7f2 TL |
556 | decode(check_prefix, bl); |
557 | decode(fail_if_exist, bl); | |
7c673cae FG |
558 | DECODE_FINISH(bl); |
559 | } | |
560 | }; | |
561 | WRITE_CLASS_ENCODER(rgw_cls_obj_check_attrs_prefix) | |
562 | ||
563 | struct rgw_cls_obj_check_mtime { | |
564 | ceph::real_time mtime; | |
565 | RGWCheckMTimeType type; | |
566 | bool high_precision_time; | |
567 | ||
568 | rgw_cls_obj_check_mtime() : type(CLS_RGW_CHECK_TIME_MTIME_EQ), high_precision_time(false) {} | |
569 | ||
570 | void encode(bufferlist& bl) const { | |
571 | ENCODE_START(2, 1, bl); | |
11fdf7f2 TL |
572 | encode(mtime, bl); |
573 | encode((uint8_t)type, bl); | |
574 | encode(high_precision_time, bl); | |
7c673cae FG |
575 | ENCODE_FINISH(bl); |
576 | } | |
577 | ||
11fdf7f2 | 578 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 579 | DECODE_START(2, bl); |
11fdf7f2 | 580 | decode(mtime, bl); |
7c673cae | 581 | uint8_t c; |
11fdf7f2 | 582 | decode(c, bl); |
7c673cae FG |
583 | type = (RGWCheckMTimeType)c; |
584 | if (struct_v >= 2) { | |
11fdf7f2 | 585 | decode(high_precision_time, bl); |
7c673cae FG |
586 | } |
587 | DECODE_FINISH(bl); | |
588 | } | |
589 | }; | |
590 | WRITE_CLASS_ENCODER(rgw_cls_obj_check_mtime) | |
591 | ||
592 | struct rgw_cls_usage_log_add_op { | |
593 | rgw_usage_log_info info; | |
594 | rgw_user user; | |
595 | ||
596 | void encode(bufferlist& bl) const { | |
597 | ENCODE_START(2, 1, bl); | |
11fdf7f2 TL |
598 | encode(info, bl); |
599 | encode(user.to_str(), bl); | |
7c673cae FG |
600 | ENCODE_FINISH(bl); |
601 | } | |
602 | ||
11fdf7f2 | 603 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 604 | DECODE_START(2, bl); |
11fdf7f2 | 605 | decode(info, bl); |
7c673cae FG |
606 | if (struct_v >= 2) { |
607 | string s; | |
11fdf7f2 | 608 | decode(s, bl); |
7c673cae FG |
609 | user.from_str(s); |
610 | } | |
611 | DECODE_FINISH(bl); | |
612 | } | |
613 | }; | |
614 | WRITE_CLASS_ENCODER(rgw_cls_usage_log_add_op) | |
615 | ||
616 | struct rgw_cls_bi_get_op { | |
617 | cls_rgw_obj_key key; | |
618 | BIIndexType type; /* namespace: plain, instance, olh */ | |
619 | ||
11fdf7f2 | 620 | rgw_cls_bi_get_op() : type(BIIndexType::Plain) {} |
7c673cae FG |
621 | |
622 | void encode(bufferlist& bl) const { | |
623 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
624 | encode(key, bl); |
625 | encode((uint8_t)type, bl); | |
7c673cae FG |
626 | ENCODE_FINISH(bl); |
627 | } | |
628 | ||
11fdf7f2 | 629 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 630 | DECODE_START(1, bl); |
11fdf7f2 | 631 | decode(key, bl); |
7c673cae | 632 | uint8_t c; |
11fdf7f2 | 633 | decode(c, bl); |
7c673cae FG |
634 | type = (BIIndexType)c; |
635 | DECODE_FINISH(bl); | |
636 | } | |
637 | }; | |
638 | WRITE_CLASS_ENCODER(rgw_cls_bi_get_op) | |
639 | ||
640 | struct rgw_cls_bi_get_ret { | |
641 | rgw_cls_bi_entry entry; | |
642 | ||
643 | rgw_cls_bi_get_ret() {} | |
644 | ||
645 | void encode(bufferlist& bl) const { | |
646 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 647 | encode(entry, bl); |
7c673cae FG |
648 | ENCODE_FINISH(bl); |
649 | } | |
650 | ||
11fdf7f2 | 651 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 652 | DECODE_START(1, bl); |
11fdf7f2 | 653 | decode(entry, bl); |
7c673cae FG |
654 | DECODE_FINISH(bl); |
655 | } | |
656 | }; | |
657 | WRITE_CLASS_ENCODER(rgw_cls_bi_get_ret) | |
658 | ||
659 | struct rgw_cls_bi_put_op { | |
660 | rgw_cls_bi_entry entry; | |
661 | ||
662 | rgw_cls_bi_put_op() {} | |
663 | ||
664 | void encode(bufferlist& bl) const { | |
665 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 666 | encode(entry, bl); |
7c673cae FG |
667 | ENCODE_FINISH(bl); |
668 | } | |
669 | ||
11fdf7f2 | 670 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 671 | DECODE_START(1, bl); |
11fdf7f2 | 672 | decode(entry, bl); |
7c673cae FG |
673 | DECODE_FINISH(bl); |
674 | } | |
675 | }; | |
676 | WRITE_CLASS_ENCODER(rgw_cls_bi_put_op) | |
677 | ||
678 | struct rgw_cls_bi_list_op { | |
679 | uint32_t max; | |
680 | string name; | |
681 | string marker; | |
682 | ||
683 | rgw_cls_bi_list_op() : max(0) {} | |
684 | ||
685 | void encode(bufferlist& bl) const { | |
686 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
687 | encode(max, bl); |
688 | encode(name, bl); | |
689 | encode(marker, bl); | |
7c673cae FG |
690 | ENCODE_FINISH(bl); |
691 | } | |
692 | ||
11fdf7f2 | 693 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 694 | DECODE_START(1, bl); |
11fdf7f2 TL |
695 | decode(max, bl); |
696 | decode(name, bl); | |
697 | decode(marker, bl); | |
7c673cae FG |
698 | DECODE_FINISH(bl); |
699 | } | |
700 | }; | |
701 | WRITE_CLASS_ENCODER(rgw_cls_bi_list_op) | |
702 | ||
703 | struct rgw_cls_bi_list_ret { | |
704 | list<rgw_cls_bi_entry> entries; | |
705 | bool is_truncated; | |
706 | ||
707 | rgw_cls_bi_list_ret() : is_truncated(false) {} | |
708 | ||
709 | void encode(bufferlist& bl) const { | |
710 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
711 | encode(entries, bl); |
712 | encode(is_truncated, bl); | |
7c673cae FG |
713 | ENCODE_FINISH(bl); |
714 | } | |
715 | ||
11fdf7f2 | 716 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 717 | DECODE_START(1, bl); |
11fdf7f2 TL |
718 | decode(entries, bl); |
719 | decode(is_truncated, bl); | |
7c673cae FG |
720 | DECODE_FINISH(bl); |
721 | } | |
722 | }; | |
723 | WRITE_CLASS_ENCODER(rgw_cls_bi_list_ret) | |
724 | ||
725 | struct rgw_cls_usage_log_read_op { | |
726 | uint64_t start_epoch; | |
727 | uint64_t end_epoch; | |
728 | string owner; | |
11fdf7f2 | 729 | string bucket; |
7c673cae FG |
730 | |
731 | string iter; // should be empty for the first call, non empty for subsequent calls | |
732 | uint32_t max_entries; | |
733 | ||
734 | void encode(bufferlist& bl) const { | |
11fdf7f2 TL |
735 | ENCODE_START(2, 1, bl); |
736 | encode(start_epoch, bl); | |
737 | encode(end_epoch, bl); | |
738 | encode(owner, bl); | |
739 | encode(iter, bl); | |
740 | encode(max_entries, bl); | |
741 | encode(bucket, bl); | |
7c673cae FG |
742 | ENCODE_FINISH(bl); |
743 | } | |
744 | ||
11fdf7f2 TL |
745 | void decode(bufferlist::const_iterator& bl) { |
746 | DECODE_START(2, bl); | |
747 | decode(start_epoch, bl); | |
748 | decode(end_epoch, bl); | |
749 | decode(owner, bl); | |
750 | decode(iter, bl); | |
751 | decode(max_entries, bl); | |
752 | if (struct_v >= 2) { | |
753 | decode(bucket, bl); | |
754 | } | |
7c673cae FG |
755 | DECODE_FINISH(bl); |
756 | } | |
757 | }; | |
758 | WRITE_CLASS_ENCODER(rgw_cls_usage_log_read_op) | |
759 | ||
760 | struct rgw_cls_usage_log_read_ret { | |
761 | map<rgw_user_bucket, rgw_usage_log_entry> usage; | |
762 | bool truncated; | |
763 | string next_iter; | |
764 | ||
765 | void encode(bufferlist& bl) const { | |
766 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
767 | encode(usage, bl); |
768 | encode(truncated, bl); | |
769 | encode(next_iter, bl); | |
7c673cae FG |
770 | ENCODE_FINISH(bl); |
771 | } | |
772 | ||
11fdf7f2 | 773 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 774 | DECODE_START(1, bl); |
11fdf7f2 TL |
775 | decode(usage, bl); |
776 | decode(truncated, bl); | |
777 | decode(next_iter, bl); | |
7c673cae FG |
778 | DECODE_FINISH(bl); |
779 | } | |
780 | }; | |
781 | WRITE_CLASS_ENCODER(rgw_cls_usage_log_read_ret) | |
782 | ||
783 | struct rgw_cls_usage_log_trim_op { | |
784 | uint64_t start_epoch; | |
785 | uint64_t end_epoch; | |
786 | string user; | |
11fdf7f2 | 787 | string bucket; |
7c673cae FG |
788 | |
789 | void encode(bufferlist& bl) const { | |
11fdf7f2 TL |
790 | ENCODE_START(3, 2, bl); |
791 | encode(start_epoch, bl); | |
792 | encode(end_epoch, bl); | |
793 | encode(user, bl); | |
794 | encode(bucket, bl); | |
7c673cae FG |
795 | ENCODE_FINISH(bl); |
796 | } | |
797 | ||
11fdf7f2 TL |
798 | void decode(bufferlist::const_iterator& bl) { |
799 | DECODE_START(3, bl); | |
800 | decode(start_epoch, bl); | |
801 | decode(end_epoch, bl); | |
802 | decode(user, bl); | |
803 | if (struct_v >= 3) { | |
804 | decode(bucket, bl); | |
805 | } | |
7c673cae FG |
806 | DECODE_FINISH(bl); |
807 | } | |
808 | }; | |
809 | WRITE_CLASS_ENCODER(rgw_cls_usage_log_trim_op) | |
810 | ||
811 | struct cls_rgw_gc_set_entry_op { | |
812 | uint32_t expiration_secs; | |
813 | cls_rgw_gc_obj_info info; | |
814 | cls_rgw_gc_set_entry_op() : expiration_secs(0) {} | |
815 | ||
816 | void encode(bufferlist& bl) const { | |
817 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
818 | encode(expiration_secs, bl); |
819 | encode(info, bl); | |
7c673cae FG |
820 | ENCODE_FINISH(bl); |
821 | } | |
822 | ||
11fdf7f2 | 823 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 824 | DECODE_START(1, bl); |
11fdf7f2 TL |
825 | decode(expiration_secs, bl); |
826 | decode(info, bl); | |
7c673cae FG |
827 | DECODE_FINISH(bl); |
828 | } | |
829 | ||
830 | void dump(Formatter *f) const; | |
831 | static void generate_test_instances(list<cls_rgw_gc_set_entry_op*>& ls); | |
832 | }; | |
833 | WRITE_CLASS_ENCODER(cls_rgw_gc_set_entry_op) | |
834 | ||
835 | struct cls_rgw_gc_defer_entry_op { | |
836 | uint32_t expiration_secs; | |
837 | string tag; | |
838 | cls_rgw_gc_defer_entry_op() : expiration_secs(0) {} | |
839 | ||
840 | void encode(bufferlist& bl) const { | |
841 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
842 | encode(expiration_secs, bl); |
843 | encode(tag, bl); | |
7c673cae FG |
844 | ENCODE_FINISH(bl); |
845 | } | |
846 | ||
11fdf7f2 | 847 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 848 | DECODE_START(1, bl); |
11fdf7f2 TL |
849 | decode(expiration_secs, bl); |
850 | decode(tag, bl); | |
7c673cae FG |
851 | DECODE_FINISH(bl); |
852 | } | |
853 | ||
854 | void dump(Formatter *f) const; | |
855 | static void generate_test_instances(list<cls_rgw_gc_defer_entry_op*>& ls); | |
856 | }; | |
857 | WRITE_CLASS_ENCODER(cls_rgw_gc_defer_entry_op) | |
858 | ||
859 | struct cls_rgw_gc_list_op { | |
860 | string marker; | |
861 | uint32_t max; | |
862 | bool expired_only; | |
863 | ||
864 | cls_rgw_gc_list_op() : max(0), expired_only(true) {} | |
865 | ||
866 | void encode(bufferlist& bl) const { | |
867 | ENCODE_START(2, 1, bl); | |
11fdf7f2 TL |
868 | encode(marker, bl); |
869 | encode(max, bl); | |
870 | encode(expired_only, bl); | |
7c673cae FG |
871 | ENCODE_FINISH(bl); |
872 | } | |
873 | ||
11fdf7f2 | 874 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 875 | DECODE_START(2, bl); |
11fdf7f2 TL |
876 | decode(marker, bl); |
877 | decode(max, bl); | |
7c673cae | 878 | if (struct_v >= 2) { |
11fdf7f2 | 879 | decode(expired_only, bl); |
7c673cae FG |
880 | } |
881 | DECODE_FINISH(bl); | |
882 | } | |
883 | ||
884 | void dump(Formatter *f) const; | |
885 | static void generate_test_instances(list<cls_rgw_gc_list_op*>& ls); | |
886 | }; | |
887 | WRITE_CLASS_ENCODER(cls_rgw_gc_list_op) | |
888 | ||
889 | struct cls_rgw_gc_list_ret { | |
890 | list<cls_rgw_gc_obj_info> entries; | |
31f18b77 | 891 | string next_marker; |
7c673cae FG |
892 | bool truncated; |
893 | ||
894 | cls_rgw_gc_list_ret() : truncated(false) {} | |
895 | ||
896 | void encode(bufferlist& bl) const { | |
31f18b77 | 897 | ENCODE_START(2, 1, bl); |
11fdf7f2 TL |
898 | encode(entries, bl); |
899 | encode(next_marker, bl); | |
900 | encode(truncated, bl); | |
7c673cae FG |
901 | ENCODE_FINISH(bl); |
902 | } | |
903 | ||
11fdf7f2 | 904 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 | 905 | DECODE_START(2, bl); |
11fdf7f2 | 906 | decode(entries, bl); |
31f18b77 | 907 | if (struct_v >= 2) |
11fdf7f2 TL |
908 | decode(next_marker, bl); |
909 | decode(truncated, bl); | |
7c673cae FG |
910 | DECODE_FINISH(bl); |
911 | } | |
912 | ||
913 | void dump(Formatter *f) const; | |
914 | static void generate_test_instances(list<cls_rgw_gc_list_ret*>& ls); | |
915 | }; | |
916 | WRITE_CLASS_ENCODER(cls_rgw_gc_list_ret) | |
917 | ||
918 | struct cls_rgw_gc_remove_op { | |
11fdf7f2 | 919 | vector<string> tags; |
7c673cae FG |
920 | |
921 | cls_rgw_gc_remove_op() {} | |
922 | ||
923 | void encode(bufferlist& bl) const { | |
924 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 925 | encode(tags, bl); |
7c673cae FG |
926 | ENCODE_FINISH(bl); |
927 | } | |
928 | ||
11fdf7f2 | 929 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 930 | DECODE_START(1, bl); |
11fdf7f2 | 931 | decode(tags, bl); |
7c673cae FG |
932 | DECODE_FINISH(bl); |
933 | } | |
934 | ||
935 | void dump(Formatter *f) const; | |
936 | static void generate_test_instances(list<cls_rgw_gc_remove_op*>& ls); | |
937 | }; | |
938 | WRITE_CLASS_ENCODER(cls_rgw_gc_remove_op) | |
939 | ||
940 | struct cls_rgw_bi_log_list_op { | |
941 | string marker; | |
942 | uint32_t max; | |
943 | ||
944 | cls_rgw_bi_log_list_op() : max(0) {} | |
945 | ||
946 | void encode(bufferlist& bl) const { | |
947 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
948 | encode(marker, bl); |
949 | encode(max, bl); | |
7c673cae FG |
950 | ENCODE_FINISH(bl); |
951 | } | |
952 | ||
11fdf7f2 | 953 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 954 | DECODE_START(1, bl); |
11fdf7f2 TL |
955 | decode(marker, bl); |
956 | decode(max, bl); | |
7c673cae FG |
957 | DECODE_FINISH(bl); |
958 | } | |
959 | ||
960 | void dump(Formatter *f) const; | |
961 | static void generate_test_instances(list<cls_rgw_bi_log_list_op*>& ls); | |
962 | }; | |
963 | WRITE_CLASS_ENCODER(cls_rgw_bi_log_list_op) | |
964 | ||
965 | struct cls_rgw_bi_log_trim_op { | |
966 | string start_marker; | |
967 | string end_marker; | |
968 | ||
969 | cls_rgw_bi_log_trim_op() {} | |
970 | ||
971 | void encode(bufferlist& bl) const { | |
972 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
973 | encode(start_marker, bl); |
974 | encode(end_marker, bl); | |
7c673cae FG |
975 | ENCODE_FINISH(bl); |
976 | } | |
977 | ||
11fdf7f2 | 978 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 979 | DECODE_START(1, bl); |
11fdf7f2 TL |
980 | decode(start_marker, bl); |
981 | decode(end_marker, bl); | |
7c673cae FG |
982 | DECODE_FINISH(bl); |
983 | } | |
984 | ||
985 | void dump(Formatter *f) const; | |
986 | static void generate_test_instances(list<cls_rgw_bi_log_trim_op*>& ls); | |
987 | }; | |
988 | WRITE_CLASS_ENCODER(cls_rgw_bi_log_trim_op) | |
989 | ||
990 | struct cls_rgw_bi_log_list_ret { | |
991 | list<rgw_bi_log_entry> entries; | |
992 | bool truncated; | |
993 | ||
994 | cls_rgw_bi_log_list_ret() : truncated(false) {} | |
995 | ||
996 | void encode(bufferlist& bl) const { | |
997 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
998 | encode(entries, bl); |
999 | encode(truncated, bl); | |
7c673cae FG |
1000 | ENCODE_FINISH(bl); |
1001 | } | |
1002 | ||
11fdf7f2 | 1003 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 1004 | DECODE_START(1, bl); |
11fdf7f2 TL |
1005 | decode(entries, bl); |
1006 | decode(truncated, bl); | |
7c673cae FG |
1007 | DECODE_FINISH(bl); |
1008 | } | |
1009 | ||
1010 | void dump(Formatter *f) const; | |
1011 | static void generate_test_instances(list<cls_rgw_bi_log_list_ret*>& ls); | |
1012 | }; | |
1013 | WRITE_CLASS_ENCODER(cls_rgw_bi_log_list_ret) | |
1014 | ||
1015 | struct cls_rgw_lc_get_next_entry_op { | |
1016 | string marker; | |
1017 | cls_rgw_lc_get_next_entry_op() {} | |
1018 | ||
1019 | void encode(bufferlist& bl) const { | |
1020 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 1021 | encode(marker, bl); |
7c673cae FG |
1022 | ENCODE_FINISH(bl); |
1023 | } | |
1024 | ||
11fdf7f2 | 1025 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 1026 | DECODE_START(1, bl); |
11fdf7f2 | 1027 | decode(marker, bl); |
7c673cae FG |
1028 | DECODE_FINISH(bl); |
1029 | } | |
1030 | }; | |
1031 | WRITE_CLASS_ENCODER(cls_rgw_lc_get_next_entry_op) | |
1032 | ||
11fdf7f2 | 1033 | using rgw_lc_entry_t = std::pair<std::string, int>; |
7c673cae | 1034 | |
11fdf7f2 TL |
1035 | struct cls_rgw_lc_get_next_entry_ret { |
1036 | rgw_lc_entry_t entry; | |
7c673cae FG |
1037 | cls_rgw_lc_get_next_entry_ret() {} |
1038 | ||
1039 | void encode(bufferlist& bl) const { | |
1040 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 1041 | encode(entry, bl); |
7c673cae FG |
1042 | ENCODE_FINISH(bl); |
1043 | } | |
1044 | ||
11fdf7f2 | 1045 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 1046 | DECODE_START(1, bl); |
11fdf7f2 | 1047 | decode(entry, bl); |
7c673cae FG |
1048 | DECODE_FINISH(bl); |
1049 | } | |
1050 | ||
1051 | }; | |
1052 | WRITE_CLASS_ENCODER(cls_rgw_lc_get_next_entry_ret) | |
1053 | ||
11fdf7f2 TL |
1054 | struct cls_rgw_lc_get_entry_op { |
1055 | string marker; | |
1056 | cls_rgw_lc_get_entry_op() {} | |
1057 | cls_rgw_lc_get_entry_op(const std::string& _marker) : marker(_marker) {} | |
1058 | ||
1059 | void encode(bufferlist& bl) const { | |
1060 | ENCODE_START(1, 1, bl); | |
1061 | encode(marker, bl); | |
1062 | ENCODE_FINISH(bl); | |
1063 | } | |
1064 | ||
1065 | void decode(bufferlist::const_iterator& bl) { | |
1066 | DECODE_START(1, bl); | |
1067 | decode(marker, bl); | |
1068 | DECODE_FINISH(bl); | |
1069 | } | |
1070 | }; | |
1071 | WRITE_CLASS_ENCODER(cls_rgw_lc_get_entry_op) | |
1072 | ||
1073 | struct cls_rgw_lc_get_entry_ret { | |
1074 | rgw_lc_entry_t entry; | |
1075 | cls_rgw_lc_get_entry_ret() {} | |
1076 | cls_rgw_lc_get_entry_ret(rgw_lc_entry_t&& _entry) : entry(std::move(_entry)) {} | |
1077 | ||
1078 | void encode(bufferlist& bl) const { | |
1079 | ENCODE_START(1, 1, bl); | |
1080 | encode(entry, bl); | |
1081 | ENCODE_FINISH(bl); | |
1082 | } | |
1083 | ||
1084 | void decode(bufferlist::const_iterator& bl) { | |
1085 | DECODE_START(1, bl); | |
1086 | decode(entry, bl); | |
1087 | DECODE_FINISH(bl); | |
1088 | } | |
1089 | ||
1090 | }; | |
1091 | WRITE_CLASS_ENCODER(cls_rgw_lc_get_entry_ret) | |
1092 | ||
1093 | ||
7c673cae | 1094 | struct cls_rgw_lc_rm_entry_op { |
11fdf7f2 | 1095 | rgw_lc_entry_t entry; |
7c673cae FG |
1096 | cls_rgw_lc_rm_entry_op() {} |
1097 | ||
1098 | void encode(bufferlist& bl) const { | |
1099 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 1100 | encode(entry, bl); |
7c673cae FG |
1101 | ENCODE_FINISH(bl); |
1102 | } | |
1103 | ||
11fdf7f2 | 1104 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 1105 | DECODE_START(1, bl); |
11fdf7f2 | 1106 | decode(entry, bl); |
7c673cae FG |
1107 | DECODE_FINISH(bl); |
1108 | } | |
1109 | }; | |
1110 | WRITE_CLASS_ENCODER(cls_rgw_lc_rm_entry_op) | |
1111 | ||
1112 | struct cls_rgw_lc_set_entry_op { | |
11fdf7f2 | 1113 | rgw_lc_entry_t entry; |
7c673cae FG |
1114 | cls_rgw_lc_set_entry_op() {} |
1115 | ||
1116 | void encode(bufferlist& bl) const { | |
1117 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 1118 | encode(entry, bl); |
7c673cae FG |
1119 | ENCODE_FINISH(bl); |
1120 | } | |
1121 | ||
11fdf7f2 | 1122 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 1123 | DECODE_START(1, bl); |
11fdf7f2 | 1124 | decode(entry, bl); |
7c673cae FG |
1125 | DECODE_FINISH(bl); |
1126 | } | |
1127 | }; | |
1128 | WRITE_CLASS_ENCODER(cls_rgw_lc_set_entry_op) | |
1129 | ||
1130 | struct cls_rgw_lc_put_head_op { | |
1131 | cls_rgw_lc_obj_head head; | |
1132 | ||
1133 | ||
1134 | cls_rgw_lc_put_head_op() {} | |
1135 | ||
1136 | void encode(bufferlist& bl) const { | |
1137 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 1138 | encode(head, bl); |
7c673cae FG |
1139 | ENCODE_FINISH(bl); |
1140 | } | |
1141 | ||
11fdf7f2 | 1142 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 1143 | DECODE_START(1, bl); |
11fdf7f2 | 1144 | decode(head, bl); |
7c673cae FG |
1145 | DECODE_FINISH(bl); |
1146 | } | |
1147 | ||
1148 | }; | |
1149 | WRITE_CLASS_ENCODER(cls_rgw_lc_put_head_op) | |
1150 | ||
1151 | struct cls_rgw_lc_get_head_ret { | |
1152 | cls_rgw_lc_obj_head head; | |
1153 | ||
1154 | cls_rgw_lc_get_head_ret() {} | |
1155 | ||
1156 | void encode(bufferlist& bl) const { | |
1157 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 1158 | encode(head, bl); |
7c673cae FG |
1159 | ENCODE_FINISH(bl); |
1160 | } | |
1161 | ||
11fdf7f2 | 1162 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 1163 | DECODE_START(1, bl); |
11fdf7f2 | 1164 | decode(head, bl); |
7c673cae FG |
1165 | DECODE_FINISH(bl); |
1166 | } | |
1167 | ||
1168 | }; | |
1169 | WRITE_CLASS_ENCODER(cls_rgw_lc_get_head_ret) | |
1170 | ||
1171 | struct cls_rgw_lc_list_entries_op { | |
1172 | string marker; | |
11fdf7f2 | 1173 | uint32_t max_entries = 0; |
7c673cae FG |
1174 | |
1175 | cls_rgw_lc_list_entries_op() {} | |
1176 | ||
1177 | void encode(bufferlist& bl) const { | |
1178 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
1179 | encode(marker, bl); |
1180 | encode(max_entries, bl); | |
7c673cae FG |
1181 | ENCODE_FINISH(bl); |
1182 | } | |
1183 | ||
11fdf7f2 | 1184 | void decode(bufferlist::const_iterator& bl) { |
7c673cae | 1185 | DECODE_START(1, bl); |
11fdf7f2 TL |
1186 | decode(marker, bl); |
1187 | decode(max_entries, bl); | |
7c673cae FG |
1188 | DECODE_FINISH(bl); |
1189 | } | |
1190 | ||
1191 | }; | |
1192 | WRITE_CLASS_ENCODER(cls_rgw_lc_list_entries_op) | |
1193 | ||
1194 | struct cls_rgw_lc_list_entries_ret { | |
1195 | map<string, int> entries; | |
c07f9fc5 | 1196 | bool is_truncated{false}; |
7c673cae FG |
1197 | |
1198 | cls_rgw_lc_list_entries_ret() {} | |
1199 | ||
1200 | void encode(bufferlist& bl) const { | |
c07f9fc5 | 1201 | ENCODE_START(2, 1, bl); |
11fdf7f2 TL |
1202 | encode(entries, bl); |
1203 | encode(is_truncated, bl); | |
7c673cae FG |
1204 | ENCODE_FINISH(bl); |
1205 | } | |
1206 | ||
11fdf7f2 | 1207 | void decode(bufferlist::const_iterator& bl) { |
c07f9fc5 | 1208 | DECODE_START(2, bl); |
11fdf7f2 | 1209 | decode(entries, bl); |
c07f9fc5 | 1210 | if (struct_v >= 2) { |
11fdf7f2 | 1211 | decode(is_truncated, bl); |
c07f9fc5 | 1212 | } |
7c673cae FG |
1213 | DECODE_FINISH(bl); |
1214 | } | |
1215 | ||
1216 | }; | |
1217 | WRITE_CLASS_ENCODER(cls_rgw_lc_list_entries_ret) | |
1218 | ||
31f18b77 FG |
1219 | struct cls_rgw_reshard_add_op { |
1220 | cls_rgw_reshard_entry entry; | |
1221 | ||
1222 | cls_rgw_reshard_add_op() {} | |
1223 | ||
1224 | void encode(bufferlist& bl) const { | |
1225 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 1226 | encode(entry, bl); |
31f18b77 FG |
1227 | ENCODE_FINISH(bl); |
1228 | } | |
1229 | ||
11fdf7f2 | 1230 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 | 1231 | DECODE_START(1, bl); |
11fdf7f2 | 1232 | decode(entry, bl); |
31f18b77 FG |
1233 | DECODE_FINISH(bl); |
1234 | } | |
1235 | static void generate_test_instances(list<cls_rgw_reshard_add_op*>& o); | |
1236 | void dump(Formatter *f) const; | |
1237 | }; | |
1238 | WRITE_CLASS_ENCODER(cls_rgw_reshard_add_op) | |
1239 | ||
1240 | struct cls_rgw_reshard_list_op { | |
1241 | uint32_t max{0}; | |
1242 | string marker; | |
1243 | ||
1244 | cls_rgw_reshard_list_op() {} | |
1245 | ||
1246 | void encode(bufferlist& bl) const { | |
1247 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
1248 | encode(max, bl); |
1249 | encode(marker, bl); | |
31f18b77 FG |
1250 | ENCODE_FINISH(bl); |
1251 | } | |
1252 | ||
11fdf7f2 | 1253 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 | 1254 | DECODE_START(1, bl); |
11fdf7f2 TL |
1255 | decode(max, bl); |
1256 | decode(marker, bl); | |
31f18b77 FG |
1257 | DECODE_FINISH(bl); |
1258 | } | |
1259 | static void generate_test_instances(list<cls_rgw_reshard_list_op*>& o); | |
1260 | void dump(Formatter *f) const; | |
1261 | }; | |
1262 | WRITE_CLASS_ENCODER(cls_rgw_reshard_list_op) | |
1263 | ||
1264 | ||
1265 | struct cls_rgw_reshard_list_ret { | |
1266 | list<cls_rgw_reshard_entry> entries; | |
1267 | bool is_truncated{false}; | |
1268 | ||
1269 | cls_rgw_reshard_list_ret() {} | |
1270 | ||
1271 | void encode(bufferlist& bl) const { | |
1272 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
1273 | encode(entries, bl); |
1274 | encode(is_truncated, bl); | |
31f18b77 FG |
1275 | ENCODE_FINISH(bl); |
1276 | } | |
1277 | ||
11fdf7f2 | 1278 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 | 1279 | DECODE_START(1, bl); |
11fdf7f2 TL |
1280 | decode(entries, bl); |
1281 | decode(is_truncated, bl); | |
31f18b77 FG |
1282 | DECODE_FINISH(bl); |
1283 | } | |
1284 | static void generate_test_instances(list<cls_rgw_reshard_list_ret*>& o); | |
1285 | void dump(Formatter *f) const; | |
1286 | }; | |
1287 | WRITE_CLASS_ENCODER(cls_rgw_reshard_list_ret) | |
1288 | ||
1289 | struct cls_rgw_reshard_get_op { | |
1290 | cls_rgw_reshard_entry entry; | |
1291 | ||
1292 | cls_rgw_reshard_get_op() {} | |
1293 | ||
1294 | void encode(bufferlist& bl) const { | |
1295 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 1296 | encode(entry, bl); |
31f18b77 FG |
1297 | ENCODE_FINISH(bl); |
1298 | } | |
1299 | ||
11fdf7f2 | 1300 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 | 1301 | DECODE_START(1, bl); |
11fdf7f2 | 1302 | decode(entry, bl); |
31f18b77 FG |
1303 | DECODE_FINISH(bl); |
1304 | } | |
1305 | static void generate_test_instances(list<cls_rgw_reshard_get_op*>& o); | |
1306 | void dump(Formatter *f) const; | |
1307 | }; | |
1308 | WRITE_CLASS_ENCODER(cls_rgw_reshard_get_op) | |
1309 | ||
1310 | struct cls_rgw_reshard_get_ret { | |
1311 | cls_rgw_reshard_entry entry; | |
1312 | ||
1313 | cls_rgw_reshard_get_ret() {} | |
1314 | ||
1315 | void encode(bufferlist& bl) const { | |
1316 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 1317 | encode(entry, bl); |
31f18b77 FG |
1318 | ENCODE_FINISH(bl); |
1319 | } | |
1320 | ||
11fdf7f2 | 1321 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 | 1322 | DECODE_START(1, bl); |
11fdf7f2 | 1323 | decode(entry, bl); |
31f18b77 FG |
1324 | DECODE_FINISH(bl); |
1325 | } | |
1326 | static void generate_test_instances(list<cls_rgw_reshard_get_ret*>& o); | |
1327 | void dump(Formatter *f) const; | |
1328 | }; | |
1329 | WRITE_CLASS_ENCODER(cls_rgw_reshard_get_ret) | |
1330 | ||
1331 | struct cls_rgw_reshard_remove_op { | |
1332 | string tenant; | |
1333 | string bucket_name; | |
1334 | string bucket_id; | |
1335 | ||
1336 | cls_rgw_reshard_remove_op() {} | |
1337 | ||
1338 | void encode(bufferlist& bl) const { | |
1339 | ENCODE_START(1, 1, bl); | |
11fdf7f2 TL |
1340 | encode(tenant, bl); |
1341 | encode(bucket_name, bl); | |
1342 | encode(bucket_id, bl); | |
31f18b77 FG |
1343 | ENCODE_FINISH(bl); |
1344 | } | |
1345 | ||
11fdf7f2 | 1346 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 | 1347 | DECODE_START(1, bl); |
11fdf7f2 TL |
1348 | decode(tenant, bl); |
1349 | decode(bucket_name, bl); | |
1350 | decode(bucket_id, bl); | |
31f18b77 FG |
1351 | DECODE_FINISH(bl); |
1352 | } | |
1353 | static void generate_test_instances(list<cls_rgw_reshard_remove_op*>& o); | |
1354 | void dump(Formatter *f) const; | |
1355 | }; | |
1356 | WRITE_CLASS_ENCODER(cls_rgw_reshard_remove_op) | |
1357 | ||
1358 | struct cls_rgw_set_bucket_resharding_op { | |
1359 | cls_rgw_bucket_instance_entry entry; | |
1360 | ||
1361 | void encode(bufferlist& bl) const { | |
1362 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 1363 | encode(entry, bl); |
31f18b77 FG |
1364 | ENCODE_FINISH(bl); |
1365 | } | |
1366 | ||
11fdf7f2 | 1367 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 | 1368 | DECODE_START(1, bl); |
11fdf7f2 | 1369 | decode(entry, bl); |
31f18b77 FG |
1370 | DECODE_FINISH(bl); |
1371 | } | |
1372 | static void generate_test_instances(list<cls_rgw_set_bucket_resharding_op*>& o); | |
1373 | void dump(Formatter *f) const; | |
1374 | }; | |
1375 | WRITE_CLASS_ENCODER(cls_rgw_set_bucket_resharding_op) | |
1376 | ||
1377 | struct cls_rgw_clear_bucket_resharding_op { | |
1378 | void encode(bufferlist& bl) const { | |
1379 | ENCODE_START(1, 1, bl); | |
1380 | ENCODE_FINISH(bl); | |
1381 | } | |
1382 | ||
11fdf7f2 | 1383 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 FG |
1384 | DECODE_START(1, bl); |
1385 | DECODE_FINISH(bl); | |
1386 | } | |
1387 | static void generate_test_instances(list<cls_rgw_clear_bucket_resharding_op*>& o); | |
1388 | void dump(Formatter *f) const; | |
1389 | }; | |
1390 | WRITE_CLASS_ENCODER(cls_rgw_clear_bucket_resharding_op) | |
1391 | ||
1392 | struct cls_rgw_guard_bucket_resharding_op { | |
1393 | int ret_err{0}; | |
1394 | ||
1395 | void encode(bufferlist& bl) const { | |
1396 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 1397 | encode(ret_err, bl); |
31f18b77 FG |
1398 | ENCODE_FINISH(bl); |
1399 | } | |
1400 | ||
11fdf7f2 | 1401 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 | 1402 | DECODE_START(1, bl); |
11fdf7f2 | 1403 | decode(ret_err, bl); |
31f18b77 FG |
1404 | DECODE_FINISH(bl); |
1405 | } | |
1406 | ||
1407 | static void generate_test_instances(list<cls_rgw_guard_bucket_resharding_op*>& o); | |
1408 | void dump(Formatter *f) const; | |
1409 | }; | |
1410 | WRITE_CLASS_ENCODER(cls_rgw_guard_bucket_resharding_op) | |
1411 | ||
1412 | struct cls_rgw_get_bucket_resharding_op { | |
1413 | ||
1414 | void encode(bufferlist& bl) const { | |
1415 | ENCODE_START(1, 1, bl); | |
1416 | ENCODE_FINISH(bl); | |
1417 | } | |
1418 | ||
11fdf7f2 | 1419 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 FG |
1420 | DECODE_START(1, bl); |
1421 | DECODE_FINISH(bl); | |
1422 | } | |
1423 | ||
1424 | static void generate_test_instances(list<cls_rgw_get_bucket_resharding_op*>& o); | |
1425 | void dump(Formatter *f) const; | |
1426 | }; | |
1427 | WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_op) | |
1428 | ||
1429 | struct cls_rgw_get_bucket_resharding_ret { | |
1430 | cls_rgw_bucket_instance_entry new_instance; | |
1431 | ||
1432 | void encode(bufferlist& bl) const { | |
1433 | ENCODE_START(1, 1, bl); | |
11fdf7f2 | 1434 | encode(new_instance, bl); |
31f18b77 FG |
1435 | ENCODE_FINISH(bl); |
1436 | } | |
1437 | ||
11fdf7f2 | 1438 | void decode(bufferlist::const_iterator& bl) { |
31f18b77 | 1439 | DECODE_START(1, bl); |
11fdf7f2 | 1440 | decode(new_instance, bl); |
31f18b77 FG |
1441 | DECODE_FINISH(bl); |
1442 | } | |
1443 | ||
1444 | static void generate_test_instances(list<cls_rgw_get_bucket_resharding_ret*>& o); | |
1445 | void dump(Formatter *f) const; | |
1446 | }; | |
1447 | WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_ret) | |
1448 | ||
7c673cae | 1449 | #endif /* CEPH_CLS_RGW_OPS_H */ |