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