]> git.proxmox.com Git - ceph.git/blob - ceph/src/cls/rgw/cls_rgw_ops.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / cls / rgw / cls_rgw_ops.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 CEPH_CLS_RGW_OPS_H
5 #define CEPH_CLS_RGW_OPS_H
6
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(ceph::buffer::list &bl) const {
16 ENCODE_START(1, 1, bl);
17 encode(tag_timeout, bl);
18 ENCODE_FINISH(bl);
19 }
20 void decode(ceph::buffer::list::const_iterator &bl) {
21 DECODE_START(1, bl);
22 decode(tag_timeout, bl);
23 DECODE_FINISH(bl);
24 }
25 void dump(ceph::Formatter *f) const;
26 static void generate_test_instances(std::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 std::string tag;
35 std::string locator;
36 bool log_op;
37 uint16_t bilog_flags;
38 rgw_zone_set zones_trace;
39
40 rgw_cls_obj_prepare_op() : op(CLS_RGW_OP_UNKNOWN), log_op(false), bilog_flags(0) {}
41
42 void encode(ceph::buffer::list &bl) const {
43 ENCODE_START(7, 5, bl);
44 uint8_t c = (uint8_t)op;
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);
52 ENCODE_FINISH(bl);
53 }
54 void decode(ceph::buffer::list::const_iterator &bl) {
55 DECODE_START_LEGACY_COMPAT_LEN(7, 3, 3, bl);
56 uint8_t c;
57 decode(c, bl);
58 op = (RGWModifyOp)c;
59 if (struct_v < 5) {
60 decode(key.name, bl);
61 }
62 decode(tag, bl);
63 if (struct_v >= 2) {
64 decode(locator, bl);
65 }
66 if (struct_v >= 4) {
67 decode(log_op, bl);
68 }
69 if (struct_v >= 5) {
70 decode(key, bl);
71 }
72 if (struct_v >= 6) {
73 decode(bilog_flags, bl);
74 }
75 if (struct_v >= 7) {
76 decode(zones_trace, bl);
77 }
78 DECODE_FINISH(bl);
79 }
80 void dump(ceph::Formatter *f) const;
81 static void generate_test_instances(std::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 std::string locator;
90 rgw_bucket_entry_ver ver;
91 rgw_bucket_dir_entry_meta meta;
92 std::string tag;
93 bool log_op;
94 uint16_t bilog_flags;
95
96 std::list<cls_rgw_obj_key> remove_objs;
97 rgw_zone_set zones_trace;
98
99 rgw_cls_obj_complete_op() : op(CLS_RGW_OP_ADD), log_op(false), bilog_flags(0) {}
100
101 void encode(ceph::buffer::list &bl) const {
102 ENCODE_START(9, 7, bl);
103 uint8_t c = (uint8_t)op;
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);
115 ENCODE_FINISH(bl);
116 }
117 void decode(ceph::buffer::list::const_iterator &bl) {
118 DECODE_START_LEGACY_COMPAT_LEN(9, 3, 3, bl);
119 uint8_t c;
120 decode(c, bl);
121 op = (RGWModifyOp)c;
122 if (struct_v < 7) {
123 decode(key.name, bl);
124 }
125 decode(ver.epoch, bl);
126 decode(meta, bl);
127 decode(tag, bl);
128 if (struct_v >= 2) {
129 decode(locator, bl);
130 }
131 if (struct_v >= 4 && struct_v < 7) {
132 std::list<std::string> old_remove_objs;
133 decode(old_remove_objs, bl);
134
135 for (auto 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 {
142 decode(remove_objs, bl);
143 }
144 if (struct_v >= 5) {
145 decode(ver, bl);
146 } else {
147 ver.pool = -1;
148 }
149 if (struct_v >= 6) {
150 decode(log_op, bl);
151 }
152 if (struct_v >= 7) {
153 decode(key, bl);
154 }
155 if (struct_v >= 8) {
156 decode(bilog_flags, bl);
157 }
158 if (struct_v >= 9) {
159 decode(zones_trace, bl);
160 }
161 DECODE_FINISH(bl);
162 }
163 void dump(ceph::Formatter *f) const;
164 static void generate_test_instances(std::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 std::string olh_tag;
171 bool delete_marker;
172 std::string op_tag;
173 rgw_bucket_dir_entry_meta meta;
174 uint64_t olh_epoch;
175 bool log_op;
176 uint16_t bilog_flags;
177 ceph::real_time unmod_since; /* only create delete marker if newer then this */
178 bool high_precision_time;
179 rgw_zone_set zones_trace;
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(ceph::buffer::list& bl) const {
184 ENCODE_START(5, 1, bl);
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);
193 uint64_t t = ceph::real_clock::to_time_t(unmod_since);
194 encode(t, bl);
195 encode(unmod_since, bl);
196 encode(high_precision_time, bl);
197 encode(zones_trace, bl);
198 ENCODE_FINISH(bl);
199 }
200
201 void decode(ceph::buffer::list::const_iterator& bl) {
202 DECODE_START(5, bl);
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);
211 if (struct_v == 2) {
212 uint64_t t;
213 decode(t, bl);
214 unmod_since = ceph::real_clock::from_time_t(static_cast<time_t>(t));
215 }
216 if (struct_v >= 3) {
217 uint64_t t;
218 decode(t, bl);
219 decode(unmod_since, bl);
220 }
221 if (struct_v >= 4) {
222 decode(high_precision_time, bl);
223 }
224 if (struct_v >= 5) {
225 decode(zones_trace, bl);
226 }
227 DECODE_FINISH(bl);
228 }
229
230 static void generate_test_instances(std::list<rgw_cls_link_olh_op *>& o);
231 void dump(ceph::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 std::string op_tag;
238 uint64_t olh_epoch;
239 bool log_op;
240 uint16_t bilog_flags;
241 std::string olh_tag;
242 rgw_zone_set zones_trace;
243
244 rgw_cls_unlink_instance_op() : olh_epoch(0), log_op(false), bilog_flags(0) {}
245
246 void encode(ceph::buffer::list& bl) const {
247 ENCODE_START(3, 1, bl);
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);
255 ENCODE_FINISH(bl);
256 }
257
258 void decode(ceph::buffer::list::const_iterator& bl) {
259 DECODE_START(3, bl);
260 decode(key, bl);
261 decode(op_tag, bl);
262 decode(olh_epoch, bl);
263 decode(log_op, bl);
264 decode(bilog_flags, bl);
265 if (struct_v >= 2) {
266 decode(olh_tag, bl);
267 }
268 if (struct_v >= 3) {
269 decode(zones_trace, bl);
270 }
271 DECODE_FINISH(bl);
272 }
273
274 static void generate_test_instances(std::list<rgw_cls_unlink_instance_op *>& o);
275 void dump(ceph::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 std::string olh_tag;
284
285 rgw_cls_read_olh_log_op() : ver_marker(0) {}
286
287 void encode(ceph::buffer::list &bl) const {
288 ENCODE_START(1, 1, bl);
289 encode(olh, bl);
290 encode(ver_marker, bl);
291 encode(olh_tag, bl);
292 ENCODE_FINISH(bl);
293 }
294 void decode(ceph::buffer::list::const_iterator &bl) {
295 DECODE_START(1, bl);
296 decode(olh, bl);
297 decode(ver_marker, bl);
298 decode(olh_tag, bl);
299 DECODE_FINISH(bl);
300 }
301 static void generate_test_instances(std::list<rgw_cls_read_olh_log_op *>& o);
302 void dump(ceph::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 {
309 std::map<uint64_t, std::vector<rgw_bucket_olh_log_entry> > log;
310 bool is_truncated;
311
312 rgw_cls_read_olh_log_ret() : is_truncated(false) {}
313
314 void encode(ceph::buffer::list &bl) const {
315 ENCODE_START(1, 1, bl);
316 encode(log, bl);
317 encode(is_truncated, bl);
318 ENCODE_FINISH(bl);
319 }
320 void decode(ceph::buffer::list::const_iterator &bl) {
321 DECODE_START(1, bl);
322 decode(log, bl);
323 decode(is_truncated, bl);
324 DECODE_FINISH(bl);
325 }
326 static void generate_test_instances(std::list<rgw_cls_read_olh_log_ret *>& o);
327 void dump(ceph::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 std::string olh_tag;
336
337 rgw_cls_trim_olh_log_op() : ver(0) {}
338
339 void encode(ceph::buffer::list &bl) const {
340 ENCODE_START(1, 1, bl);
341 encode(olh, bl);
342 encode(ver, bl);
343 encode(olh_tag, bl);
344 ENCODE_FINISH(bl);
345 }
346 void decode(ceph::buffer::list::const_iterator &bl) {
347 DECODE_START(1, bl);
348 decode(olh, bl);
349 decode(ver, bl);
350 decode(olh_tag, bl);
351 DECODE_FINISH(bl);
352 }
353 static void generate_test_instances(std::list<rgw_cls_trim_olh_log_op *>& o);
354 void dump(ceph::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 std::string olh_tag;
361
362 rgw_cls_bucket_clear_olh_op() {}
363
364 void encode(ceph::buffer::list& bl) const {
365 ENCODE_START(1, 1, bl);
366 encode(key, bl);
367 encode(olh_tag, bl);
368 ENCODE_FINISH(bl);
369 }
370
371 void decode(ceph::buffer::list::const_iterator& bl) {
372 DECODE_START(1, bl);
373 decode(key, bl);
374 decode(olh_tag, bl);
375 DECODE_FINISH(bl);
376 }
377
378 static void generate_test_instances(std::list<rgw_cls_bucket_clear_olh_op *>& o);
379 void dump(ceph::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 std::string filter_prefix;
388 bool list_versions;
389 std::string delimiter;
390
391 rgw_cls_list_op() : num_entries(0), list_versions(false) {}
392
393 void encode(ceph::buffer::list &bl) const {
394 ENCODE_START(6, 4, bl);
395 encode(num_entries, bl);
396 encode(filter_prefix, bl);
397 encode(start_obj, bl);
398 encode(list_versions, bl);
399 encode(delimiter, bl);
400 ENCODE_FINISH(bl);
401 }
402 void decode(ceph::buffer::list::const_iterator &bl) {
403 DECODE_START_LEGACY_COMPAT_LEN(6, 2, 2, bl);
404 if (struct_v < 4) {
405 decode(start_obj.name, bl);
406 }
407 decode(num_entries, bl);
408 if (struct_v >= 3) {
409 decode(filter_prefix, bl);
410 }
411 if (struct_v >= 4) {
412 decode(start_obj, bl);
413 }
414 if (struct_v >= 5) {
415 decode(list_versions, bl);
416 }
417 if (struct_v >= 6) {
418 decode(delimiter, bl);
419 }
420 DECODE_FINISH(bl);
421 }
422 void dump(ceph::Formatter *f) const;
423 static void generate_test_instances(std::list<rgw_cls_list_op*>& o);
424 };
425 WRITE_CLASS_ENCODER(rgw_cls_list_op)
426
427 struct rgw_cls_list_ret {
428 rgw_bucket_dir dir;
429 bool is_truncated;
430
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 {}
440
441 void encode(ceph::buffer::list &bl) const {
442 ENCODE_START(3, 2, bl);
443 encode(dir, bl);
444 encode(is_truncated, bl);
445 ENCODE_FINISH(bl);
446 }
447 void decode(ceph::buffer::list::const_iterator &bl) {
448 DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
449 decode(dir, bl);
450 decode(is_truncated, bl);
451 cls_filtered = struct_v >= 3;
452 DECODE_FINISH(bl);
453 }
454 void dump(ceph::Formatter *f) const;
455 static void generate_test_instances(std::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(ceph::buffer::list &bl) const {
467 ENCODE_START(1, 1, bl);
468 encode(existing_header, bl);
469 encode(calculated_header, bl);
470 ENCODE_FINISH(bl);
471 }
472 void decode(ceph::buffer::list::const_iterator &bl) {
473 DECODE_START(1, bl);
474 decode(existing_header, bl);
475 decode(calculated_header, bl);
476 DECODE_FINISH(bl);
477 }
478 void dump(ceph::Formatter *f) const;
479 static void generate_test_instances(std::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};
486 std::map<RGWObjCategory, rgw_bucket_category_stats> stats;
487
488 rgw_cls_bucket_update_stats_op() {}
489
490 void encode(ceph::buffer::list &bl) const {
491 ENCODE_START(1, 1, bl);
492 encode(absolute, bl);
493 encode(stats, bl);
494 ENCODE_FINISH(bl);
495 }
496 void decode(ceph::buffer::list::const_iterator &bl) {
497 DECODE_START(1, bl);
498 decode(absolute, bl);
499 decode(stats, bl);
500 DECODE_FINISH(bl);
501 }
502 void dump(ceph::Formatter *f) const;
503 static void generate_test_instances(std::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 std::list<std::string> keep_attr_prefixes;
509
510 void encode(ceph::buffer::list& bl) const {
511 ENCODE_START(1, 1, bl);
512 encode(keep_attr_prefixes, bl);
513 ENCODE_FINISH(bl);
514 }
515
516 void decode(ceph::buffer::list::const_iterator& bl) {
517 DECODE_START(1, bl);
518 decode(keep_attr_prefixes, bl);
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 std::string attr;
526
527 void encode(ceph::buffer::list& bl) const {
528 ENCODE_START(1, 1, bl);
529 encode(attr, bl);
530 ENCODE_FINISH(bl);
531 }
532
533 void decode(ceph::buffer::list::const_iterator& bl) {
534 DECODE_START(1, bl);
535 decode(attr, bl);
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 std::string check_prefix;
543 bool fail_if_exist;
544
545 rgw_cls_obj_check_attrs_prefix() : fail_if_exist(false) {}
546
547 void encode(ceph::buffer::list& bl) const {
548 ENCODE_START(1, 1, bl);
549 encode(check_prefix, bl);
550 encode(fail_if_exist, bl);
551 ENCODE_FINISH(bl);
552 }
553
554 void decode(ceph::buffer::list::const_iterator& bl) {
555 DECODE_START(1, bl);
556 decode(check_prefix, bl);
557 decode(fail_if_exist, bl);
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(ceph::buffer::list& bl) const {
571 ENCODE_START(2, 1, bl);
572 encode(mtime, bl);
573 encode((uint8_t)type, bl);
574 encode(high_precision_time, bl);
575 ENCODE_FINISH(bl);
576 }
577
578 void decode(ceph::buffer::list::const_iterator& bl) {
579 DECODE_START(2, bl);
580 decode(mtime, bl);
581 uint8_t c;
582 decode(c, bl);
583 type = (RGWCheckMTimeType)c;
584 if (struct_v >= 2) {
585 decode(high_precision_time, bl);
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(ceph::buffer::list& bl) const {
597 ENCODE_START(2, 1, bl);
598 encode(info, bl);
599 encode(user.to_str(), bl);
600 ENCODE_FINISH(bl);
601 }
602
603 void decode(ceph::buffer::list::const_iterator& bl) {
604 DECODE_START(2, bl);
605 decode(info, bl);
606 if (struct_v >= 2) {
607 std::string s;
608 decode(s, bl);
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
620 rgw_cls_bi_get_op() : type(BIIndexType::Plain) {}
621
622 void encode(ceph::buffer::list& bl) const {
623 ENCODE_START(1, 1, bl);
624 encode(key, bl);
625 encode((uint8_t)type, bl);
626 ENCODE_FINISH(bl);
627 }
628
629 void decode(ceph::buffer::list::const_iterator& bl) {
630 DECODE_START(1, bl);
631 decode(key, bl);
632 uint8_t c;
633 decode(c, bl);
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(ceph::buffer::list& bl) const {
646 ENCODE_START(1, 1, bl);
647 encode(entry, bl);
648 ENCODE_FINISH(bl);
649 }
650
651 void decode(ceph::buffer::list::const_iterator& bl) {
652 DECODE_START(1, bl);
653 decode(entry, bl);
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(ceph::buffer::list& bl) const {
665 ENCODE_START(1, 1, bl);
666 encode(entry, bl);
667 ENCODE_FINISH(bl);
668 }
669
670 void decode(ceph::buffer::list::const_iterator& bl) {
671 DECODE_START(1, bl);
672 decode(entry, bl);
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 std::string name;
681 std::string marker;
682
683 rgw_cls_bi_list_op() : max(0) {}
684
685 void encode(ceph::buffer::list& bl) const {
686 ENCODE_START(1, 1, bl);
687 encode(max, bl);
688 encode(name, bl);
689 encode(marker, bl);
690 ENCODE_FINISH(bl);
691 }
692
693 void decode(ceph::buffer::list::const_iterator& bl) {
694 DECODE_START(1, bl);
695 decode(max, bl);
696 decode(name, bl);
697 decode(marker, bl);
698 DECODE_FINISH(bl);
699 }
700 };
701 WRITE_CLASS_ENCODER(rgw_cls_bi_list_op)
702
703 struct rgw_cls_bi_list_ret {
704 std::list<rgw_cls_bi_entry> entries;
705 bool is_truncated;
706
707 rgw_cls_bi_list_ret() : is_truncated(false) {}
708
709 void encode(ceph::buffer::list& bl) const {
710 ENCODE_START(1, 1, bl);
711 encode(entries, bl);
712 encode(is_truncated, bl);
713 ENCODE_FINISH(bl);
714 }
715
716 void decode(ceph::buffer::list::const_iterator& bl) {
717 DECODE_START(1, bl);
718 decode(entries, bl);
719 decode(is_truncated, bl);
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 std::string owner;
729 std::string bucket;
730
731 std::string iter; // should be empty for the first call, non empty for subsequent calls
732 uint32_t max_entries;
733
734 void encode(ceph::buffer::list& bl) const {
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);
742 ENCODE_FINISH(bl);
743 }
744
745 void decode(ceph::buffer::list::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 }
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 std::map<rgw_user_bucket, rgw_usage_log_entry> usage;
762 bool truncated;
763 std::string next_iter;
764
765 void encode(ceph::buffer::list& bl) const {
766 ENCODE_START(1, 1, bl);
767 encode(usage, bl);
768 encode(truncated, bl);
769 encode(next_iter, bl);
770 ENCODE_FINISH(bl);
771 }
772
773 void decode(ceph::buffer::list::const_iterator& bl) {
774 DECODE_START(1, bl);
775 decode(usage, bl);
776 decode(truncated, bl);
777 decode(next_iter, bl);
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 std::string user;
787 std::string bucket;
788
789 void encode(ceph::buffer::list& bl) const {
790 ENCODE_START(3, 2, bl);
791 encode(start_epoch, bl);
792 encode(end_epoch, bl);
793 encode(user, bl);
794 encode(bucket, bl);
795 ENCODE_FINISH(bl);
796 }
797
798 void decode(ceph::buffer::list::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 }
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(ceph::buffer::list& bl) const {
817 ENCODE_START(1, 1, bl);
818 encode(expiration_secs, bl);
819 encode(info, bl);
820 ENCODE_FINISH(bl);
821 }
822
823 void decode(ceph::buffer::list::const_iterator& bl) {
824 DECODE_START(1, bl);
825 decode(expiration_secs, bl);
826 decode(info, bl);
827 DECODE_FINISH(bl);
828 }
829
830 void dump(ceph::Formatter *f) const;
831 static void generate_test_instances(std::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 std::string tag;
838 cls_rgw_gc_defer_entry_op() : expiration_secs(0) {}
839
840 void encode(ceph::buffer::list& bl) const {
841 ENCODE_START(1, 1, bl);
842 encode(expiration_secs, bl);
843 encode(tag, bl);
844 ENCODE_FINISH(bl);
845 }
846
847 void decode(ceph::buffer::list::const_iterator& bl) {
848 DECODE_START(1, bl);
849 decode(expiration_secs, bl);
850 decode(tag, bl);
851 DECODE_FINISH(bl);
852 }
853
854 void dump(ceph::Formatter *f) const;
855 static void generate_test_instances(std::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 std::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(ceph::buffer::list& bl) const {
867 ENCODE_START(2, 1, bl);
868 encode(marker, bl);
869 encode(max, bl);
870 encode(expired_only, bl);
871 ENCODE_FINISH(bl);
872 }
873
874 void decode(ceph::buffer::list::const_iterator& bl) {
875 DECODE_START(2, bl);
876 decode(marker, bl);
877 decode(max, bl);
878 if (struct_v >= 2) {
879 decode(expired_only, bl);
880 }
881 DECODE_FINISH(bl);
882 }
883
884 void dump(ceph::Formatter *f) const;
885 static void generate_test_instances(std::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 std::list<cls_rgw_gc_obj_info> entries;
891 std::string next_marker;
892 bool truncated;
893
894 cls_rgw_gc_list_ret() : truncated(false) {}
895
896 void encode(ceph::buffer::list& bl) const {
897 ENCODE_START(2, 1, bl);
898 encode(entries, bl);
899 encode(next_marker, bl);
900 encode(truncated, bl);
901 ENCODE_FINISH(bl);
902 }
903
904 void decode(ceph::buffer::list::const_iterator& bl) {
905 DECODE_START(2, bl);
906 decode(entries, bl);
907 if (struct_v >= 2)
908 decode(next_marker, bl);
909 decode(truncated, bl);
910 DECODE_FINISH(bl);
911 }
912
913 void dump(ceph::Formatter *f) const;
914 static void generate_test_instances(std::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 {
919 std::vector<std::string> tags;
920
921 cls_rgw_gc_remove_op() {}
922
923 void encode(ceph::buffer::list& bl) const {
924 ENCODE_START(1, 1, bl);
925 encode(tags, bl);
926 ENCODE_FINISH(bl);
927 }
928
929 void decode(ceph::buffer::list::const_iterator& bl) {
930 DECODE_START(1, bl);
931 decode(tags, bl);
932 DECODE_FINISH(bl);
933 }
934
935 void dump(ceph::Formatter *f) const;
936 static void generate_test_instances(std::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 std::string marker;
942 uint32_t max;
943
944 cls_rgw_bi_log_list_op() : max(0) {}
945
946 void encode(ceph::buffer::list& bl) const {
947 ENCODE_START(1, 1, bl);
948 encode(marker, bl);
949 encode(max, bl);
950 ENCODE_FINISH(bl);
951 }
952
953 void decode(ceph::buffer::list::const_iterator& bl) {
954 DECODE_START(1, bl);
955 decode(marker, bl);
956 decode(max, bl);
957 DECODE_FINISH(bl);
958 }
959
960 void dump(ceph::Formatter *f) const;
961 static void generate_test_instances(std::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 std::string start_marker;
967 std::string end_marker;
968
969 cls_rgw_bi_log_trim_op() {}
970
971 void encode(ceph::buffer::list& bl) const {
972 ENCODE_START(1, 1, bl);
973 encode(start_marker, bl);
974 encode(end_marker, bl);
975 ENCODE_FINISH(bl);
976 }
977
978 void decode(ceph::buffer::list::const_iterator& bl) {
979 DECODE_START(1, bl);
980 decode(start_marker, bl);
981 decode(end_marker, bl);
982 DECODE_FINISH(bl);
983 }
984
985 void dump(ceph::Formatter *f) const;
986 static void generate_test_instances(std::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 std::list<rgw_bi_log_entry> entries;
992 bool truncated;
993
994 cls_rgw_bi_log_list_ret() : truncated(false) {}
995
996 void encode(ceph::buffer::list& bl) const {
997 ENCODE_START(1, 1, bl);
998 encode(entries, bl);
999 encode(truncated, bl);
1000 ENCODE_FINISH(bl);
1001 }
1002
1003 void decode(ceph::buffer::list::const_iterator& bl) {
1004 DECODE_START(1, bl);
1005 decode(entries, bl);
1006 decode(truncated, bl);
1007 DECODE_FINISH(bl);
1008 }
1009
1010 void dump(ceph::Formatter *f) const;
1011 static void generate_test_instances(std::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 std::string marker;
1017 cls_rgw_lc_get_next_entry_op() {}
1018
1019 void encode(ceph::buffer::list& bl) const {
1020 ENCODE_START(1, 1, bl);
1021 encode(marker, bl);
1022 ENCODE_FINISH(bl);
1023 }
1024
1025 void decode(ceph::buffer::list::const_iterator& bl) {
1026 DECODE_START(1, bl);
1027 decode(marker, bl);
1028 DECODE_FINISH(bl);
1029 }
1030 };
1031 WRITE_CLASS_ENCODER(cls_rgw_lc_get_next_entry_op)
1032
1033 struct cls_rgw_lc_get_next_entry_ret {
1034 cls_rgw_lc_entry entry;
1035
1036 cls_rgw_lc_get_next_entry_ret() {}
1037
1038 void encode(ceph::buffer::list& bl) const {
1039 ENCODE_START(2, 2, bl);
1040 encode(entry, bl);
1041 ENCODE_FINISH(bl);
1042 }
1043
1044 void decode(ceph::buffer::list::const_iterator& bl) {
1045 DECODE_START(2, bl);
1046 if (struct_v < 2) {
1047 std::pair<std::string, int> oe;
1048 decode(oe, bl);
1049 entry = {oe.first, 0 /* start */, uint32_t(oe.second)};
1050 } else {
1051 decode(entry, bl);
1052 }
1053 DECODE_FINISH(bl);
1054 }
1055
1056 };
1057 WRITE_CLASS_ENCODER(cls_rgw_lc_get_next_entry_ret)
1058
1059 struct cls_rgw_lc_get_entry_op {
1060 std::string marker;
1061 cls_rgw_lc_get_entry_op() {}
1062 cls_rgw_lc_get_entry_op(const std::string& _marker) : marker(_marker) {}
1063
1064 void encode(ceph::buffer::list& bl) const {
1065 ENCODE_START(1, 1, bl);
1066 encode(marker, bl);
1067 ENCODE_FINISH(bl);
1068 }
1069
1070 void decode(ceph::buffer::list::const_iterator& bl) {
1071 DECODE_START(1, bl);
1072 decode(marker, bl);
1073 DECODE_FINISH(bl);
1074 }
1075 };
1076 WRITE_CLASS_ENCODER(cls_rgw_lc_get_entry_op)
1077
1078 struct cls_rgw_lc_get_entry_ret {
1079 cls_rgw_lc_entry entry;
1080
1081 cls_rgw_lc_get_entry_ret() {}
1082 cls_rgw_lc_get_entry_ret(cls_rgw_lc_entry&& _entry)
1083 : entry(std::move(_entry)) {}
1084
1085 void encode(ceph::buffer::list& bl) const {
1086 ENCODE_START(1, 1, bl);
1087 encode(entry, bl);
1088 ENCODE_FINISH(bl);
1089 }
1090
1091 void decode(ceph::buffer::list::const_iterator& bl) {
1092 DECODE_START(1, bl);
1093 decode(entry, bl);
1094 DECODE_FINISH(bl);
1095 }
1096
1097 };
1098 WRITE_CLASS_ENCODER(cls_rgw_lc_get_entry_ret)
1099
1100 struct cls_rgw_lc_rm_entry_op {
1101 cls_rgw_lc_entry entry;
1102 cls_rgw_lc_rm_entry_op() {}
1103
1104 void encode(ceph::buffer::list& bl) const {
1105 ENCODE_START(2, 2, bl);
1106 encode(entry, bl);
1107 ENCODE_FINISH(bl);
1108 }
1109
1110 void decode(ceph::buffer::list::const_iterator& bl) {
1111 DECODE_START(2, bl);
1112 if (struct_v < 2) {
1113 std::pair<std::string, int> oe;
1114 decode(oe, bl);
1115 entry = {oe.first, 0 /* start */, uint32_t(oe.second)};
1116 } else {
1117 decode(entry, bl);
1118 }
1119 DECODE_FINISH(bl);
1120 }
1121 };
1122 WRITE_CLASS_ENCODER(cls_rgw_lc_rm_entry_op)
1123
1124 struct cls_rgw_lc_set_entry_op {
1125 cls_rgw_lc_entry entry;
1126 cls_rgw_lc_set_entry_op() {}
1127
1128 void encode(ceph::buffer::list& bl) const {
1129 ENCODE_START(2, 2, bl);
1130 encode(entry, bl);
1131 ENCODE_FINISH(bl);
1132 }
1133
1134 void decode(ceph::buffer::list::const_iterator& bl) {
1135 DECODE_START(2, bl);
1136 if (struct_v < 2) {
1137 std::pair<std::string, int> oe;
1138 decode(oe, bl);
1139 entry = {oe.first, 0 /* start */, uint32_t(oe.second)};
1140 } else {
1141 decode(entry, bl);
1142 }
1143 DECODE_FINISH(bl);
1144 }
1145 };
1146 WRITE_CLASS_ENCODER(cls_rgw_lc_set_entry_op)
1147
1148 struct cls_rgw_lc_put_head_op {
1149 cls_rgw_lc_obj_head head;
1150
1151
1152 cls_rgw_lc_put_head_op() {}
1153
1154 void encode(ceph::buffer::list& bl) const {
1155 ENCODE_START(1, 1, bl);
1156 encode(head, bl);
1157 ENCODE_FINISH(bl);
1158 }
1159
1160 void decode(ceph::buffer::list::const_iterator& bl) {
1161 DECODE_START(1, bl);
1162 decode(head, bl);
1163 DECODE_FINISH(bl);
1164 }
1165
1166 };
1167 WRITE_CLASS_ENCODER(cls_rgw_lc_put_head_op)
1168
1169 struct cls_rgw_lc_get_head_ret {
1170 cls_rgw_lc_obj_head head;
1171
1172 cls_rgw_lc_get_head_ret() {}
1173
1174 void encode(ceph::buffer::list& bl) const {
1175 ENCODE_START(1, 1, bl);
1176 encode(head, bl);
1177 ENCODE_FINISH(bl);
1178 }
1179
1180 void decode(ceph::buffer::list::const_iterator& bl) {
1181 DECODE_START(1, bl);
1182 decode(head, bl);
1183 DECODE_FINISH(bl);
1184 }
1185
1186 };
1187 WRITE_CLASS_ENCODER(cls_rgw_lc_get_head_ret)
1188
1189 struct cls_rgw_lc_list_entries_op {
1190 std::string marker;
1191 uint32_t max_entries = 0;
1192 uint8_t compat_v{0};
1193
1194 cls_rgw_lc_list_entries_op() {}
1195
1196 void encode(ceph::buffer::list& bl) const {
1197 ENCODE_START(3, 1, bl);
1198 encode(marker, bl);
1199 encode(max_entries, bl);
1200 ENCODE_FINISH(bl);
1201 }
1202
1203 void decode(ceph::buffer::list::const_iterator& bl) {
1204 DECODE_START(3, bl);
1205 compat_v = struct_v;
1206 decode(marker, bl);
1207 decode(max_entries, bl);
1208 DECODE_FINISH(bl);
1209 }
1210
1211 };
1212 WRITE_CLASS_ENCODER(cls_rgw_lc_list_entries_op)
1213
1214 struct cls_rgw_lc_list_entries_ret {
1215 vector<cls_rgw_lc_entry> entries;
1216 bool is_truncated{false};
1217 uint8_t compat_v;
1218
1219 cls_rgw_lc_list_entries_ret(uint8_t compat_v = 3)
1220 : compat_v(compat_v) {}
1221
1222 void encode(ceph::buffer::list& bl) const {
1223 ENCODE_START(compat_v, 1, bl);
1224 if (compat_v <= 2) {
1225 map<string, int> oes;
1226 std::for_each(entries.begin(), entries.end(),
1227 [&oes](const cls_rgw_lc_entry& elt)
1228 {oes.insert({elt.bucket, elt.status});});
1229 encode(oes, bl);
1230 } else {
1231 encode(entries, bl);
1232 }
1233 encode(is_truncated, bl);
1234 ENCODE_FINISH(bl);
1235 }
1236
1237 void decode(ceph::buffer::list::const_iterator& bl) {
1238 DECODE_START(3, bl);
1239 compat_v = struct_v;
1240 if (struct_v <= 2) {
1241 map<string, int> oes;
1242 decode(oes, bl);
1243 std::for_each(oes.begin(), oes.end(),
1244 [this](const std::pair<string, int>& oe)
1245 {entries.push_back({oe.first, 0 /* start */,
1246 uint32_t(oe.second)});});
1247 } else {
1248 decode(entries, bl);
1249 }
1250 if (struct_v >= 2) {
1251 decode(is_truncated, bl);
1252 }
1253 DECODE_FINISH(bl);
1254 }
1255 };
1256 WRITE_CLASS_ENCODER(cls_rgw_lc_list_entries_ret)
1257
1258 struct cls_rgw_reshard_add_op {
1259 cls_rgw_reshard_entry entry;
1260
1261 cls_rgw_reshard_add_op() {}
1262
1263 void encode(ceph::buffer::list& bl) const {
1264 ENCODE_START(1, 1, bl);
1265 encode(entry, bl);
1266 ENCODE_FINISH(bl);
1267 }
1268
1269 void decode(ceph::buffer::list::const_iterator& bl) {
1270 DECODE_START(1, bl);
1271 decode(entry, bl);
1272 DECODE_FINISH(bl);
1273 }
1274 static void generate_test_instances(std::list<cls_rgw_reshard_add_op*>& o);
1275 void dump(ceph::Formatter *f) const;
1276 };
1277 WRITE_CLASS_ENCODER(cls_rgw_reshard_add_op)
1278
1279 struct cls_rgw_reshard_list_op {
1280 uint32_t max{0};
1281 std::string marker;
1282
1283 cls_rgw_reshard_list_op() {}
1284
1285 void encode(ceph::buffer::list& bl) const {
1286 ENCODE_START(1, 1, bl);
1287 encode(max, bl);
1288 encode(marker, bl);
1289 ENCODE_FINISH(bl);
1290 }
1291
1292 void decode(ceph::buffer::list::const_iterator& bl) {
1293 DECODE_START(1, bl);
1294 decode(max, bl);
1295 decode(marker, bl);
1296 DECODE_FINISH(bl);
1297 }
1298 static void generate_test_instances(std::list<cls_rgw_reshard_list_op*>& o);
1299 void dump(ceph::Formatter *f) const;
1300 };
1301 WRITE_CLASS_ENCODER(cls_rgw_reshard_list_op)
1302
1303
1304 struct cls_rgw_reshard_list_ret {
1305 std::list<cls_rgw_reshard_entry> entries;
1306 bool is_truncated{false};
1307
1308 cls_rgw_reshard_list_ret() {}
1309
1310 void encode(ceph::buffer::list& bl) const {
1311 ENCODE_START(1, 1, bl);
1312 encode(entries, bl);
1313 encode(is_truncated, bl);
1314 ENCODE_FINISH(bl);
1315 }
1316
1317 void decode(ceph::buffer::list::const_iterator& bl) {
1318 DECODE_START(1, bl);
1319 decode(entries, bl);
1320 decode(is_truncated, bl);
1321 DECODE_FINISH(bl);
1322 }
1323 static void generate_test_instances(std::list<cls_rgw_reshard_list_ret*>& o);
1324 void dump(ceph::Formatter *f) const;
1325 };
1326 WRITE_CLASS_ENCODER(cls_rgw_reshard_list_ret)
1327
1328 struct cls_rgw_reshard_get_op {
1329 cls_rgw_reshard_entry entry;
1330
1331 cls_rgw_reshard_get_op() {}
1332
1333 void encode(ceph::buffer::list& bl) const {
1334 ENCODE_START(1, 1, bl);
1335 encode(entry, bl);
1336 ENCODE_FINISH(bl);
1337 }
1338
1339 void decode(ceph::buffer::list::const_iterator& bl) {
1340 DECODE_START(1, bl);
1341 decode(entry, bl);
1342 DECODE_FINISH(bl);
1343 }
1344 static void generate_test_instances(std::list<cls_rgw_reshard_get_op*>& o);
1345 void dump(ceph::Formatter *f) const;
1346 };
1347 WRITE_CLASS_ENCODER(cls_rgw_reshard_get_op)
1348
1349 struct cls_rgw_reshard_get_ret {
1350 cls_rgw_reshard_entry entry;
1351
1352 cls_rgw_reshard_get_ret() {}
1353
1354 void encode(ceph::buffer::list& bl) const {
1355 ENCODE_START(1, 1, bl);
1356 encode(entry, bl);
1357 ENCODE_FINISH(bl);
1358 }
1359
1360 void decode(ceph::buffer::list::const_iterator& bl) {
1361 DECODE_START(1, bl);
1362 decode(entry, bl);
1363 DECODE_FINISH(bl);
1364 }
1365 static void generate_test_instances(std::list<cls_rgw_reshard_get_ret*>& o);
1366 void dump(ceph::Formatter *f) const;
1367 };
1368 WRITE_CLASS_ENCODER(cls_rgw_reshard_get_ret)
1369
1370 struct cls_rgw_reshard_remove_op {
1371 std::string tenant;
1372 std::string bucket_name;
1373 std::string bucket_id;
1374
1375 cls_rgw_reshard_remove_op() {}
1376
1377 void encode(ceph::buffer::list& bl) const {
1378 ENCODE_START(1, 1, bl);
1379 encode(tenant, bl);
1380 encode(bucket_name, bl);
1381 encode(bucket_id, bl);
1382 ENCODE_FINISH(bl);
1383 }
1384
1385 void decode(ceph::buffer::list::const_iterator& bl) {
1386 DECODE_START(1, bl);
1387 decode(tenant, bl);
1388 decode(bucket_name, bl);
1389 decode(bucket_id, bl);
1390 DECODE_FINISH(bl);
1391 }
1392 static void generate_test_instances(std::list<cls_rgw_reshard_remove_op*>& o);
1393 void dump(ceph::Formatter *f) const;
1394 };
1395 WRITE_CLASS_ENCODER(cls_rgw_reshard_remove_op)
1396
1397 struct cls_rgw_set_bucket_resharding_op {
1398 cls_rgw_bucket_instance_entry entry;
1399
1400 void encode(ceph::buffer::list& bl) const {
1401 ENCODE_START(1, 1, bl);
1402 encode(entry, bl);
1403 ENCODE_FINISH(bl);
1404 }
1405
1406 void decode(ceph::buffer::list::const_iterator& bl) {
1407 DECODE_START(1, bl);
1408 decode(entry, bl);
1409 DECODE_FINISH(bl);
1410 }
1411 static void generate_test_instances(std::list<cls_rgw_set_bucket_resharding_op*>& o);
1412 void dump(ceph::Formatter *f) const;
1413 };
1414 WRITE_CLASS_ENCODER(cls_rgw_set_bucket_resharding_op)
1415
1416 struct cls_rgw_clear_bucket_resharding_op {
1417 void encode(ceph::buffer::list& bl) const {
1418 ENCODE_START(1, 1, bl);
1419 ENCODE_FINISH(bl);
1420 }
1421
1422 void decode(ceph::buffer::list::const_iterator& bl) {
1423 DECODE_START(1, bl);
1424 DECODE_FINISH(bl);
1425 }
1426 static void generate_test_instances(std::list<cls_rgw_clear_bucket_resharding_op*>& o);
1427 void dump(ceph::Formatter *f) const;
1428 };
1429 WRITE_CLASS_ENCODER(cls_rgw_clear_bucket_resharding_op)
1430
1431 struct cls_rgw_guard_bucket_resharding_op {
1432 int ret_err{0};
1433
1434 void encode(ceph::buffer::list& bl) const {
1435 ENCODE_START(1, 1, bl);
1436 encode(ret_err, bl);
1437 ENCODE_FINISH(bl);
1438 }
1439
1440 void decode(ceph::buffer::list::const_iterator& bl) {
1441 DECODE_START(1, bl);
1442 decode(ret_err, bl);
1443 DECODE_FINISH(bl);
1444 }
1445
1446 static void generate_test_instances(std::list<cls_rgw_guard_bucket_resharding_op*>& o);
1447 void dump(ceph::Formatter *f) const;
1448 };
1449 WRITE_CLASS_ENCODER(cls_rgw_guard_bucket_resharding_op)
1450
1451 struct cls_rgw_get_bucket_resharding_op {
1452
1453 void encode(ceph::buffer::list& bl) const {
1454 ENCODE_START(1, 1, bl);
1455 ENCODE_FINISH(bl);
1456 }
1457
1458 void decode(ceph::buffer::list::const_iterator& bl) {
1459 DECODE_START(1, bl);
1460 DECODE_FINISH(bl);
1461 }
1462
1463 static void generate_test_instances(std::list<cls_rgw_get_bucket_resharding_op*>& o);
1464 void dump(ceph::Formatter *f) const;
1465 };
1466 WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_op)
1467
1468 struct cls_rgw_get_bucket_resharding_ret {
1469 cls_rgw_bucket_instance_entry new_instance;
1470
1471 void encode(ceph::buffer::list& bl) const {
1472 ENCODE_START(1, 1, bl);
1473 encode(new_instance, bl);
1474 ENCODE_FINISH(bl);
1475 }
1476
1477 void decode(ceph::buffer::list::const_iterator& bl) {
1478 DECODE_START(1, bl);
1479 decode(new_instance, bl);
1480 DECODE_FINISH(bl);
1481 }
1482
1483 static void generate_test_instances(std::list<cls_rgw_get_bucket_resharding_ret*>& o);
1484 void dump(ceph::Formatter *f) const;
1485 };
1486 WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_ret)
1487
1488 #endif /* CEPH_CLS_RGW_OPS_H */