]> git.proxmox.com Git - ceph.git/blob - ceph/src/cls/rgw/cls_rgw_ops.h
c5e252e645a4785d4b2f8e9e0d3042117bf1d308
[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 WRITE_CLASS_ENCODER(cls_rgw_gc_set_entry_op)
843
844 struct cls_rgw_gc_defer_entry_op {
845 uint32_t expiration_secs;
846 std::string tag;
847 cls_rgw_gc_defer_entry_op() : expiration_secs(0) {}
848
849 void encode(ceph::buffer::list& bl) const {
850 ENCODE_START(1, 1, bl);
851 encode(expiration_secs, bl);
852 encode(tag, bl);
853 ENCODE_FINISH(bl);
854 }
855
856 void decode(ceph::buffer::list::const_iterator& bl) {
857 DECODE_START(1, bl);
858 decode(expiration_secs, bl);
859 decode(tag, bl);
860 DECODE_FINISH(bl);
861 }
862
863 void dump(ceph::Formatter *f) const;
864 static void generate_test_instances(std::list<cls_rgw_gc_defer_entry_op*>& ls);
865 };
866 WRITE_CLASS_ENCODER(cls_rgw_gc_defer_entry_op)
867
868 struct cls_rgw_gc_list_op {
869 std::string marker;
870 uint32_t max;
871 bool expired_only;
872
873 cls_rgw_gc_list_op() : max(0), expired_only(true) {}
874
875 void encode(ceph::buffer::list& bl) const {
876 ENCODE_START(2, 1, bl);
877 encode(marker, bl);
878 encode(max, bl);
879 encode(expired_only, bl);
880 ENCODE_FINISH(bl);
881 }
882
883 void decode(ceph::buffer::list::const_iterator& bl) {
884 DECODE_START(2, bl);
885 decode(marker, bl);
886 decode(max, bl);
887 if (struct_v >= 2) {
888 decode(expired_only, bl);
889 }
890 DECODE_FINISH(bl);
891 }
892
893 void dump(ceph::Formatter *f) const;
894 static void generate_test_instances(std::list<cls_rgw_gc_list_op*>& ls);
895 };
896 WRITE_CLASS_ENCODER(cls_rgw_gc_list_op)
897
898 struct cls_rgw_gc_list_ret {
899 std::list<cls_rgw_gc_obj_info> entries;
900 std::string next_marker;
901 bool truncated;
902
903 cls_rgw_gc_list_ret() : truncated(false) {}
904
905 void encode(ceph::buffer::list& bl) const {
906 ENCODE_START(2, 1, bl);
907 encode(entries, bl);
908 encode(next_marker, bl);
909 encode(truncated, bl);
910 ENCODE_FINISH(bl);
911 }
912
913 void decode(ceph::buffer::list::const_iterator& bl) {
914 DECODE_START(2, bl);
915 decode(entries, bl);
916 if (struct_v >= 2)
917 decode(next_marker, bl);
918 decode(truncated, bl);
919 DECODE_FINISH(bl);
920 }
921
922 void dump(ceph::Formatter *f) const;
923 static void generate_test_instances(std::list<cls_rgw_gc_list_ret*>& ls);
924 };
925 WRITE_CLASS_ENCODER(cls_rgw_gc_list_ret)
926
927 struct cls_rgw_gc_remove_op {
928 std::vector<std::string> tags;
929
930 cls_rgw_gc_remove_op() {}
931
932 void encode(ceph::buffer::list& bl) const {
933 ENCODE_START(1, 1, bl);
934 encode(tags, bl);
935 ENCODE_FINISH(bl);
936 }
937
938 void decode(ceph::buffer::list::const_iterator& bl) {
939 DECODE_START(1, bl);
940 decode(tags, bl);
941 DECODE_FINISH(bl);
942 }
943
944 void dump(ceph::Formatter *f) const;
945 static void generate_test_instances(std::list<cls_rgw_gc_remove_op*>& ls);
946 };
947 WRITE_CLASS_ENCODER(cls_rgw_gc_remove_op)
948
949 struct cls_rgw_bi_log_list_op {
950 std::string marker;
951 uint32_t max;
952
953 cls_rgw_bi_log_list_op() : max(0) {}
954
955 void encode(ceph::buffer::list& bl) const {
956 ENCODE_START(1, 1, bl);
957 encode(marker, bl);
958 encode(max, bl);
959 ENCODE_FINISH(bl);
960 }
961
962 void decode(ceph::buffer::list::const_iterator& bl) {
963 DECODE_START(1, bl);
964 decode(marker, bl);
965 decode(max, bl);
966 DECODE_FINISH(bl);
967 }
968
969 void dump(ceph::Formatter *f) const;
970 static void generate_test_instances(std::list<cls_rgw_bi_log_list_op*>& ls);
971 };
972 WRITE_CLASS_ENCODER(cls_rgw_bi_log_list_op)
973
974 struct cls_rgw_bi_log_trim_op {
975 std::string start_marker;
976 std::string end_marker;
977
978 cls_rgw_bi_log_trim_op() {}
979
980 void encode(ceph::buffer::list& bl) const {
981 ENCODE_START(1, 1, bl);
982 encode(start_marker, bl);
983 encode(end_marker, bl);
984 ENCODE_FINISH(bl);
985 }
986
987 void decode(ceph::buffer::list::const_iterator& bl) {
988 DECODE_START(1, bl);
989 decode(start_marker, bl);
990 decode(end_marker, bl);
991 DECODE_FINISH(bl);
992 }
993
994 void dump(ceph::Formatter *f) const;
995 static void generate_test_instances(std::list<cls_rgw_bi_log_trim_op*>& ls);
996 };
997 WRITE_CLASS_ENCODER(cls_rgw_bi_log_trim_op)
998
999 struct cls_rgw_bi_log_list_ret {
1000 std::list<rgw_bi_log_entry> entries;
1001 bool truncated;
1002
1003 cls_rgw_bi_log_list_ret() : truncated(false) {}
1004
1005 void encode(ceph::buffer::list& bl) const {
1006 ENCODE_START(1, 1, bl);
1007 encode(entries, bl);
1008 encode(truncated, bl);
1009 ENCODE_FINISH(bl);
1010 }
1011
1012 void decode(ceph::buffer::list::const_iterator& bl) {
1013 DECODE_START(1, bl);
1014 decode(entries, bl);
1015 decode(truncated, bl);
1016 DECODE_FINISH(bl);
1017 }
1018
1019 void dump(ceph::Formatter *f) const;
1020 static void generate_test_instances(std::list<cls_rgw_bi_log_list_ret*>& ls);
1021 };
1022 WRITE_CLASS_ENCODER(cls_rgw_bi_log_list_ret)
1023
1024 struct cls_rgw_lc_get_next_entry_op {
1025 std::string marker;
1026 cls_rgw_lc_get_next_entry_op() {}
1027
1028 void encode(ceph::buffer::list& bl) const {
1029 ENCODE_START(1, 1, bl);
1030 encode(marker, bl);
1031 ENCODE_FINISH(bl);
1032 }
1033
1034 void decode(ceph::buffer::list::const_iterator& bl) {
1035 DECODE_START(1, bl);
1036 decode(marker, bl);
1037 DECODE_FINISH(bl);
1038 }
1039 };
1040 WRITE_CLASS_ENCODER(cls_rgw_lc_get_next_entry_op)
1041
1042 struct cls_rgw_lc_get_next_entry_ret {
1043 cls_rgw_lc_entry entry;
1044
1045 cls_rgw_lc_get_next_entry_ret() {}
1046
1047 void encode(ceph::buffer::list& bl) const {
1048 ENCODE_START(2, 2, bl);
1049 encode(entry, bl);
1050 ENCODE_FINISH(bl);
1051 }
1052
1053 void decode(ceph::buffer::list::const_iterator& bl) {
1054 DECODE_START(2, bl);
1055 if (struct_v < 2) {
1056 std::pair<std::string, int> oe;
1057 decode(oe, bl);
1058 entry = {oe.first, 0 /* start */, uint32_t(oe.second)};
1059 } else {
1060 decode(entry, bl);
1061 }
1062 DECODE_FINISH(bl);
1063 }
1064
1065 };
1066 WRITE_CLASS_ENCODER(cls_rgw_lc_get_next_entry_ret)
1067
1068 struct cls_rgw_lc_get_entry_op {
1069 std::string marker;
1070 cls_rgw_lc_get_entry_op() {}
1071 cls_rgw_lc_get_entry_op(const std::string& _marker) : marker(_marker) {}
1072
1073 void encode(ceph::buffer::list& bl) const {
1074 ENCODE_START(1, 1, bl);
1075 encode(marker, bl);
1076 ENCODE_FINISH(bl);
1077 }
1078
1079 void decode(ceph::buffer::list::const_iterator& bl) {
1080 DECODE_START(1, bl);
1081 decode(marker, bl);
1082 DECODE_FINISH(bl);
1083 }
1084 };
1085 WRITE_CLASS_ENCODER(cls_rgw_lc_get_entry_op)
1086
1087 struct cls_rgw_lc_get_entry_ret {
1088 cls_rgw_lc_entry entry;
1089
1090 cls_rgw_lc_get_entry_ret() {}
1091 cls_rgw_lc_get_entry_ret(cls_rgw_lc_entry&& _entry)
1092 : entry(std::move(_entry)) {}
1093
1094 void encode(ceph::buffer::list& bl) const {
1095 ENCODE_START(1, 1, bl);
1096 encode(entry, bl);
1097 ENCODE_FINISH(bl);
1098 }
1099
1100 void decode(ceph::buffer::list::const_iterator& bl) {
1101 DECODE_START(1, bl);
1102 decode(entry, bl);
1103 DECODE_FINISH(bl);
1104 }
1105
1106 };
1107 WRITE_CLASS_ENCODER(cls_rgw_lc_get_entry_ret)
1108
1109 struct cls_rgw_lc_rm_entry_op {
1110 cls_rgw_lc_entry entry;
1111 cls_rgw_lc_rm_entry_op() {}
1112
1113 void encode(ceph::buffer::list& bl) const {
1114 ENCODE_START(2, 2, bl);
1115 encode(entry, bl);
1116 ENCODE_FINISH(bl);
1117 }
1118
1119 void decode(ceph::buffer::list::const_iterator& bl) {
1120 DECODE_START(2, bl);
1121 if (struct_v < 2) {
1122 std::pair<std::string, int> oe;
1123 decode(oe, bl);
1124 entry = {oe.first, 0 /* start */, uint32_t(oe.second)};
1125 } else {
1126 decode(entry, bl);
1127 }
1128 DECODE_FINISH(bl);
1129 }
1130 };
1131 WRITE_CLASS_ENCODER(cls_rgw_lc_rm_entry_op)
1132
1133 struct cls_rgw_lc_set_entry_op {
1134 cls_rgw_lc_entry entry;
1135 cls_rgw_lc_set_entry_op() {}
1136
1137 void encode(ceph::buffer::list& bl) const {
1138 ENCODE_START(2, 2, bl);
1139 encode(entry, bl);
1140 ENCODE_FINISH(bl);
1141 }
1142
1143 void decode(ceph::buffer::list::const_iterator& bl) {
1144 DECODE_START(2, bl);
1145 if (struct_v < 2) {
1146 std::pair<std::string, int> oe;
1147 decode(oe, bl);
1148 entry = {oe.first, 0 /* start */, uint32_t(oe.second)};
1149 } else {
1150 decode(entry, bl);
1151 }
1152 DECODE_FINISH(bl);
1153 }
1154 };
1155 WRITE_CLASS_ENCODER(cls_rgw_lc_set_entry_op)
1156
1157 struct cls_rgw_lc_put_head_op {
1158 cls_rgw_lc_obj_head head;
1159
1160
1161 cls_rgw_lc_put_head_op() {}
1162
1163 void encode(ceph::buffer::list& bl) const {
1164 ENCODE_START(1, 1, bl);
1165 encode(head, bl);
1166 ENCODE_FINISH(bl);
1167 }
1168
1169 void decode(ceph::buffer::list::const_iterator& bl) {
1170 DECODE_START(1, bl);
1171 decode(head, bl);
1172 DECODE_FINISH(bl);
1173 }
1174
1175 };
1176 WRITE_CLASS_ENCODER(cls_rgw_lc_put_head_op)
1177
1178 struct cls_rgw_lc_get_head_ret {
1179 cls_rgw_lc_obj_head head;
1180
1181 cls_rgw_lc_get_head_ret() {}
1182
1183 void encode(ceph::buffer::list& bl) const {
1184 ENCODE_START(1, 1, bl);
1185 encode(head, bl);
1186 ENCODE_FINISH(bl);
1187 }
1188
1189 void decode(ceph::buffer::list::const_iterator& bl) {
1190 DECODE_START(1, bl);
1191 decode(head, bl);
1192 DECODE_FINISH(bl);
1193 }
1194
1195 };
1196 WRITE_CLASS_ENCODER(cls_rgw_lc_get_head_ret)
1197
1198 struct cls_rgw_lc_list_entries_op {
1199 std::string marker;
1200 uint32_t max_entries = 0;
1201 uint8_t compat_v{0};
1202
1203 cls_rgw_lc_list_entries_op() {}
1204
1205 void encode(ceph::buffer::list& bl) const {
1206 ENCODE_START(3, 1, bl);
1207 encode(marker, bl);
1208 encode(max_entries, bl);
1209 ENCODE_FINISH(bl);
1210 }
1211
1212 void decode(ceph::buffer::list::const_iterator& bl) {
1213 DECODE_START(3, bl);
1214 compat_v = struct_v;
1215 decode(marker, bl);
1216 decode(max_entries, bl);
1217 DECODE_FINISH(bl);
1218 }
1219
1220 };
1221 WRITE_CLASS_ENCODER(cls_rgw_lc_list_entries_op)
1222
1223 struct cls_rgw_lc_list_entries_ret {
1224 std::vector<cls_rgw_lc_entry> entries;
1225 bool is_truncated{false};
1226 uint8_t compat_v;
1227
1228 cls_rgw_lc_list_entries_ret(uint8_t compat_v = 3)
1229 : compat_v(compat_v) {}
1230
1231 void encode(ceph::buffer::list& bl) const {
1232 ENCODE_START(compat_v, 1, bl);
1233 if (compat_v <= 2) {
1234 std::map<std::string, int> oes;
1235 std::for_each(entries.begin(), entries.end(),
1236 [&oes](const cls_rgw_lc_entry& elt)
1237 {oes.insert({elt.bucket, elt.status});});
1238 encode(oes, bl);
1239 } else {
1240 encode(entries, bl);
1241 }
1242 encode(is_truncated, bl);
1243 ENCODE_FINISH(bl);
1244 }
1245
1246 void decode(ceph::buffer::list::const_iterator& bl) {
1247 DECODE_START(3, bl);
1248 compat_v = struct_v;
1249 if (struct_v <= 2) {
1250 std::map<std::string, int> oes;
1251 decode(oes, bl);
1252 std::for_each(oes.begin(), oes.end(),
1253 [this](const std::pair<std::string, int>& oe)
1254 {entries.push_back({oe.first, 0 /* start */,
1255 uint32_t(oe.second)});});
1256 } else {
1257 decode(entries, bl);
1258 }
1259 if (struct_v >= 2) {
1260 decode(is_truncated, bl);
1261 }
1262 DECODE_FINISH(bl);
1263 }
1264 };
1265 WRITE_CLASS_ENCODER(cls_rgw_lc_list_entries_ret)
1266
1267 struct cls_rgw_reshard_add_op {
1268 cls_rgw_reshard_entry entry;
1269
1270 cls_rgw_reshard_add_op() {}
1271
1272 void encode(ceph::buffer::list& bl) const {
1273 ENCODE_START(1, 1, bl);
1274 encode(entry, bl);
1275 ENCODE_FINISH(bl);
1276 }
1277
1278 void decode(ceph::buffer::list::const_iterator& bl) {
1279 DECODE_START(1, bl);
1280 decode(entry, bl);
1281 DECODE_FINISH(bl);
1282 }
1283 static void generate_test_instances(std::list<cls_rgw_reshard_add_op*>& o);
1284 void dump(ceph::Formatter *f) const;
1285 };
1286 WRITE_CLASS_ENCODER(cls_rgw_reshard_add_op)
1287
1288 struct cls_rgw_reshard_list_op {
1289 uint32_t max{0};
1290 std::string marker;
1291
1292 cls_rgw_reshard_list_op() {}
1293
1294 void encode(ceph::buffer::list& bl) const {
1295 ENCODE_START(1, 1, bl);
1296 encode(max, bl);
1297 encode(marker, bl);
1298 ENCODE_FINISH(bl);
1299 }
1300
1301 void decode(ceph::buffer::list::const_iterator& bl) {
1302 DECODE_START(1, bl);
1303 decode(max, bl);
1304 decode(marker, bl);
1305 DECODE_FINISH(bl);
1306 }
1307 static void generate_test_instances(std::list<cls_rgw_reshard_list_op*>& o);
1308 void dump(ceph::Formatter *f) const;
1309 };
1310 WRITE_CLASS_ENCODER(cls_rgw_reshard_list_op)
1311
1312
1313 struct cls_rgw_reshard_list_ret {
1314 std::list<cls_rgw_reshard_entry> entries;
1315 bool is_truncated{false};
1316
1317 cls_rgw_reshard_list_ret() {}
1318
1319 void encode(ceph::buffer::list& bl) const {
1320 ENCODE_START(1, 1, bl);
1321 encode(entries, bl);
1322 encode(is_truncated, bl);
1323 ENCODE_FINISH(bl);
1324 }
1325
1326 void decode(ceph::buffer::list::const_iterator& bl) {
1327 DECODE_START(1, bl);
1328 decode(entries, bl);
1329 decode(is_truncated, bl);
1330 DECODE_FINISH(bl);
1331 }
1332 static void generate_test_instances(std::list<cls_rgw_reshard_list_ret*>& o);
1333 void dump(ceph::Formatter *f) const;
1334 };
1335 WRITE_CLASS_ENCODER(cls_rgw_reshard_list_ret)
1336
1337 struct cls_rgw_reshard_get_op {
1338 cls_rgw_reshard_entry entry;
1339
1340 cls_rgw_reshard_get_op() {}
1341
1342 void encode(ceph::buffer::list& bl) const {
1343 ENCODE_START(1, 1, bl);
1344 encode(entry, bl);
1345 ENCODE_FINISH(bl);
1346 }
1347
1348 void decode(ceph::buffer::list::const_iterator& bl) {
1349 DECODE_START(1, bl);
1350 decode(entry, bl);
1351 DECODE_FINISH(bl);
1352 }
1353 static void generate_test_instances(std::list<cls_rgw_reshard_get_op*>& o);
1354 void dump(ceph::Formatter *f) const;
1355 };
1356 WRITE_CLASS_ENCODER(cls_rgw_reshard_get_op)
1357
1358 struct cls_rgw_reshard_get_ret {
1359 cls_rgw_reshard_entry entry;
1360
1361 cls_rgw_reshard_get_ret() {}
1362
1363 void encode(ceph::buffer::list& bl) const {
1364 ENCODE_START(1, 1, bl);
1365 encode(entry, bl);
1366 ENCODE_FINISH(bl);
1367 }
1368
1369 void decode(ceph::buffer::list::const_iterator& bl) {
1370 DECODE_START(1, bl);
1371 decode(entry, bl);
1372 DECODE_FINISH(bl);
1373 }
1374 static void generate_test_instances(std::list<cls_rgw_reshard_get_ret*>& o);
1375 void dump(ceph::Formatter *f) const;
1376 };
1377 WRITE_CLASS_ENCODER(cls_rgw_reshard_get_ret)
1378
1379 struct cls_rgw_reshard_remove_op {
1380 std::string tenant;
1381 std::string bucket_name;
1382 std::string bucket_id;
1383
1384 cls_rgw_reshard_remove_op() {}
1385
1386 void encode(ceph::buffer::list& bl) const {
1387 ENCODE_START(1, 1, bl);
1388 encode(tenant, bl);
1389 encode(bucket_name, bl);
1390 encode(bucket_id, bl);
1391 ENCODE_FINISH(bl);
1392 }
1393
1394 void decode(ceph::buffer::list::const_iterator& bl) {
1395 DECODE_START(1, bl);
1396 decode(tenant, bl);
1397 decode(bucket_name, bl);
1398 decode(bucket_id, bl);
1399 DECODE_FINISH(bl);
1400 }
1401 static void generate_test_instances(std::list<cls_rgw_reshard_remove_op*>& o);
1402 void dump(ceph::Formatter *f) const;
1403 };
1404 WRITE_CLASS_ENCODER(cls_rgw_reshard_remove_op)
1405
1406 struct cls_rgw_set_bucket_resharding_op {
1407 cls_rgw_bucket_instance_entry entry;
1408
1409 void encode(ceph::buffer::list& bl) const {
1410 ENCODE_START(1, 1, bl);
1411 encode(entry, bl);
1412 ENCODE_FINISH(bl);
1413 }
1414
1415 void decode(ceph::buffer::list::const_iterator& bl) {
1416 DECODE_START(1, bl);
1417 decode(entry, bl);
1418 DECODE_FINISH(bl);
1419 }
1420 static void generate_test_instances(std::list<cls_rgw_set_bucket_resharding_op*>& o);
1421 void dump(ceph::Formatter *f) const;
1422 };
1423 WRITE_CLASS_ENCODER(cls_rgw_set_bucket_resharding_op)
1424
1425 struct cls_rgw_clear_bucket_resharding_op {
1426 void encode(ceph::buffer::list& bl) const {
1427 ENCODE_START(1, 1, bl);
1428 ENCODE_FINISH(bl);
1429 }
1430
1431 void decode(ceph::buffer::list::const_iterator& bl) {
1432 DECODE_START(1, bl);
1433 DECODE_FINISH(bl);
1434 }
1435 static void generate_test_instances(std::list<cls_rgw_clear_bucket_resharding_op*>& o);
1436 void dump(ceph::Formatter *f) const;
1437 };
1438 WRITE_CLASS_ENCODER(cls_rgw_clear_bucket_resharding_op)
1439
1440 struct cls_rgw_guard_bucket_resharding_op {
1441 int ret_err{0};
1442
1443 void encode(ceph::buffer::list& bl) const {
1444 ENCODE_START(1, 1, bl);
1445 encode(ret_err, bl);
1446 ENCODE_FINISH(bl);
1447 }
1448
1449 void decode(ceph::buffer::list::const_iterator& bl) {
1450 DECODE_START(1, bl);
1451 decode(ret_err, bl);
1452 DECODE_FINISH(bl);
1453 }
1454
1455 static void generate_test_instances(std::list<cls_rgw_guard_bucket_resharding_op*>& o);
1456 void dump(ceph::Formatter *f) const;
1457 };
1458 WRITE_CLASS_ENCODER(cls_rgw_guard_bucket_resharding_op)
1459
1460 struct cls_rgw_get_bucket_resharding_op {
1461
1462 void encode(ceph::buffer::list& bl) const {
1463 ENCODE_START(1, 1, bl);
1464 ENCODE_FINISH(bl);
1465 }
1466
1467 void decode(ceph::buffer::list::const_iterator& bl) {
1468 DECODE_START(1, bl);
1469 DECODE_FINISH(bl);
1470 }
1471
1472 static void generate_test_instances(std::list<cls_rgw_get_bucket_resharding_op*>& o);
1473 void dump(ceph::Formatter *f) const;
1474 };
1475 WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_op)
1476
1477 struct cls_rgw_get_bucket_resharding_ret {
1478 cls_rgw_bucket_instance_entry new_instance;
1479
1480 void encode(ceph::buffer::list& bl) const {
1481 ENCODE_START(1, 1, bl);
1482 encode(new_instance, bl);
1483 ENCODE_FINISH(bl);
1484 }
1485
1486 void decode(ceph::buffer::list::const_iterator& bl) {
1487 DECODE_START(1, bl);
1488 decode(new_instance, bl);
1489 DECODE_FINISH(bl);
1490 }
1491
1492 static void generate_test_instances(std::list<cls_rgw_get_bucket_resharding_ret*>& o);
1493 void dump(ceph::Formatter *f) const;
1494 };
1495 WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_ret)