1 #ifndef CEPH_CLS_RGW_OPS_H
2 #define CEPH_CLS_RGW_OPS_H
4 #include "cls/rgw/cls_rgw_types.h"
6 struct rgw_cls_tag_timeout_op
10 rgw_cls_tag_timeout_op() : tag_timeout(0) {}
12 void encode(bufferlist
&bl
) const {
13 ENCODE_START(1, 1, bl
);
14 ::encode(tag_timeout
, bl
);
17 void decode(bufferlist::iterator
&bl
) {
19 ::decode(tag_timeout
, bl
);
22 void dump(Formatter
*f
) const;
23 static void generate_test_instances(list
<rgw_cls_tag_timeout_op
*>& ls
);
25 WRITE_CLASS_ENCODER(rgw_cls_tag_timeout_op
)
27 struct rgw_cls_obj_prepare_op
35 rgw_zone_set zones_trace
;
37 rgw_cls_obj_prepare_op() : op(CLS_RGW_OP_UNKNOWN
), log_op(false), bilog_flags(0) {}
39 void encode(bufferlist
&bl
) const {
40 ENCODE_START(7, 5, bl
);
41 uint8_t c
= (uint8_t)op
;
44 ::encode(locator
, bl
);
47 ::encode(bilog_flags
, bl
);
48 ::encode(zones_trace
, bl
);
51 void decode(bufferlist::iterator
&bl
) {
52 DECODE_START_LEGACY_COMPAT_LEN(7, 3, 3, bl
);
57 ::decode(key
.name
, bl
);
61 ::decode(locator
, bl
);
70 ::decode(bilog_flags
, bl
);
73 ::decode(zones_trace
, bl
);
77 void dump(Formatter
*f
) const;
78 static void generate_test_instances(list
<rgw_cls_obj_prepare_op
*>& o
);
80 WRITE_CLASS_ENCODER(rgw_cls_obj_prepare_op
)
82 struct rgw_cls_obj_complete_op
87 rgw_bucket_entry_ver ver
;
88 struct rgw_bucket_dir_entry_meta meta
;
93 list
<cls_rgw_obj_key
> remove_objs
;
94 rgw_zone_set zones_trace
;
96 rgw_cls_obj_complete_op() : op(CLS_RGW_OP_ADD
), log_op(false), bilog_flags(0) {}
98 void encode(bufferlist
&bl
) const {
99 ENCODE_START(9, 7, bl
);
100 uint8_t c
= (uint8_t)op
;
102 ::encode(ver
.epoch
, bl
);
105 ::encode(locator
, bl
);
106 ::encode(remove_objs
, bl
);
108 ::encode(log_op
, bl
);
110 ::encode(bilog_flags
, bl
);
111 ::encode(zones_trace
, bl
);
114 void decode(bufferlist::iterator
&bl
) {
115 DECODE_START_LEGACY_COMPAT_LEN(9, 3, 3, bl
);
120 ::decode(key
.name
, bl
);
122 ::decode(ver
.epoch
, bl
);
126 ::decode(locator
, bl
);
128 if (struct_v
>= 4 && struct_v
< 7) {
129 list
<string
> old_remove_objs
;
130 ::decode(old_remove_objs
, bl
);
132 for (list
<string
>::iterator iter
= old_remove_objs
.begin();
133 iter
!= old_remove_objs
.end(); ++iter
) {
136 remove_objs
.push_back(k
);
139 ::decode(remove_objs
, bl
);
147 ::decode(log_op
, bl
);
153 ::decode(bilog_flags
, bl
);
156 ::decode(zones_trace
, bl
);
160 void dump(Formatter
*f
) const;
161 static void generate_test_instances(list
<rgw_cls_obj_complete_op
*>& o
);
163 WRITE_CLASS_ENCODER(rgw_cls_obj_complete_op
)
165 struct rgw_cls_link_olh_op
{
170 struct rgw_bucket_dir_entry_meta meta
;
173 uint16_t bilog_flags
;
174 real_time unmod_since
; /* only create delete marker if newer then this */
175 bool high_precision_time
;
176 rgw_zone_set zones_trace
;
178 rgw_cls_link_olh_op() : delete_marker(false), olh_epoch(0), log_op(false), bilog_flags(0), high_precision_time(false) {}
180 void encode(bufferlist
& bl
) const {
181 ENCODE_START(5, 1, bl
);
183 ::encode(olh_tag
, bl
);
184 ::encode(delete_marker
, bl
);
185 ::encode(op_tag
, bl
);
187 ::encode(olh_epoch
, bl
);
188 ::encode(log_op
, bl
);
189 ::encode(bilog_flags
, bl
);
190 uint64_t t
= ceph::real_clock::to_time_t(unmod_since
);
192 ::encode(unmod_since
, bl
);
193 ::encode(high_precision_time
, bl
);
194 ::encode(zones_trace
, bl
);
198 void decode(bufferlist::iterator
& bl
) {
201 ::decode(olh_tag
, bl
);
202 ::decode(delete_marker
, bl
);
203 ::decode(op_tag
, bl
);
205 ::decode(olh_epoch
, bl
);
206 ::decode(log_op
, bl
);
207 ::decode(bilog_flags
, bl
);
211 unmod_since
= ceph::real_clock::from_time_t(static_cast<time_t>(t
));
216 ::decode(unmod_since
, bl
);
219 ::decode(high_precision_time
, bl
);
222 ::decode(zones_trace
, bl
);
227 static void generate_test_instances(list
<rgw_cls_link_olh_op
*>& o
);
228 void dump(Formatter
*f
) const;
230 WRITE_CLASS_ENCODER(rgw_cls_link_olh_op
)
232 struct rgw_cls_unlink_instance_op
{
237 uint16_t bilog_flags
;
239 rgw_zone_set zones_trace
;
241 rgw_cls_unlink_instance_op() : olh_epoch(0), log_op(false), bilog_flags(0) {}
243 void encode(bufferlist
& bl
) const {
244 ENCODE_START(3, 1, bl
);
246 ::encode(op_tag
, bl
);
247 ::encode(olh_epoch
, bl
);
248 ::encode(log_op
, bl
);
249 ::encode(bilog_flags
, bl
);
250 ::encode(olh_tag
, bl
);
251 ::encode(zones_trace
, bl
);
255 void decode(bufferlist::iterator
& bl
) {
258 ::decode(op_tag
, bl
);
259 ::decode(olh_epoch
, bl
);
260 ::decode(log_op
, bl
);
261 ::decode(bilog_flags
, bl
);
263 ::decode(olh_tag
, bl
);
266 ::decode(zones_trace
, bl
);
271 static void generate_test_instances(list
<rgw_cls_unlink_instance_op
*>& o
);
272 void dump(Formatter
*f
) const;
274 WRITE_CLASS_ENCODER(rgw_cls_unlink_instance_op
)
276 struct rgw_cls_read_olh_log_op
282 rgw_cls_read_olh_log_op() : ver_marker(0) {}
284 void encode(bufferlist
&bl
) const {
285 ENCODE_START(1, 1, bl
);
287 ::encode(ver_marker
, bl
);
288 ::encode(olh_tag
, bl
);
291 void decode(bufferlist::iterator
&bl
) {
294 ::decode(ver_marker
, bl
);
295 ::decode(olh_tag
, bl
);
298 static void generate_test_instances(list
<rgw_cls_read_olh_log_op
*>& o
);
299 void dump(Formatter
*f
) const;
301 WRITE_CLASS_ENCODER(rgw_cls_read_olh_log_op
)
304 struct rgw_cls_read_olh_log_ret
306 map
<uint64_t, vector
<struct rgw_bucket_olh_log_entry
> > log
;
309 rgw_cls_read_olh_log_ret() : is_truncated(false) {}
311 void encode(bufferlist
&bl
) const {
312 ENCODE_START(1, 1, bl
);
314 ::encode(is_truncated
, bl
);
317 void decode(bufferlist::iterator
&bl
) {
320 ::decode(is_truncated
, bl
);
323 static void generate_test_instances(list
<rgw_cls_read_olh_log_ret
*>& o
);
324 void dump(Formatter
*f
) const;
326 WRITE_CLASS_ENCODER(rgw_cls_read_olh_log_ret
)
328 struct rgw_cls_trim_olh_log_op
334 rgw_cls_trim_olh_log_op() : ver(0) {}
336 void encode(bufferlist
&bl
) const {
337 ENCODE_START(1, 1, bl
);
340 ::encode(olh_tag
, bl
);
343 void decode(bufferlist::iterator
&bl
) {
347 ::decode(olh_tag
, bl
);
350 static void generate_test_instances(list
<rgw_cls_trim_olh_log_op
*>& o
);
351 void dump(Formatter
*f
) const;
353 WRITE_CLASS_ENCODER(rgw_cls_trim_olh_log_op
)
355 struct rgw_cls_bucket_clear_olh_op
{
359 rgw_cls_bucket_clear_olh_op() {}
361 void encode(bufferlist
& bl
) const {
362 ENCODE_START(1, 1, bl
);
364 ::encode(olh_tag
, bl
);
368 void decode(bufferlist::iterator
& bl
) {
371 ::decode(olh_tag
, bl
);
375 static void generate_test_instances(list
<rgw_cls_bucket_clear_olh_op
*>& o
);
376 void dump(Formatter
*f
) const;
378 WRITE_CLASS_ENCODER(rgw_cls_bucket_clear_olh_op
)
380 struct rgw_cls_list_op
382 cls_rgw_obj_key start_obj
;
383 uint32_t num_entries
;
384 string filter_prefix
;
387 rgw_cls_list_op() : num_entries(0), list_versions(false) {}
389 void encode(bufferlist
&bl
) const {
390 ENCODE_START(5, 4, bl
);
391 ::encode(num_entries
, bl
);
392 ::encode(filter_prefix
, bl
);
393 ::encode(start_obj
, bl
);
394 ::encode(list_versions
, bl
);
397 void decode(bufferlist::iterator
&bl
) {
398 DECODE_START_LEGACY_COMPAT_LEN(5, 2, 2, bl
);
400 ::decode(start_obj
.name
, bl
);
402 ::decode(num_entries
, bl
);
404 ::decode(filter_prefix
, bl
);
406 ::decode(start_obj
, bl
);
408 ::decode(list_versions
, bl
);
411 void dump(Formatter
*f
) const;
412 static void generate_test_instances(list
<rgw_cls_list_op
*>& o
);
414 WRITE_CLASS_ENCODER(rgw_cls_list_op
)
416 struct rgw_cls_list_ret
421 rgw_cls_list_ret() : is_truncated(false) {}
423 void encode(bufferlist
&bl
) const {
424 ENCODE_START(2, 2, bl
);
426 ::encode(is_truncated
, bl
);
429 void decode(bufferlist::iterator
&bl
) {
430 DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl
);
432 ::decode(is_truncated
, bl
);
435 void dump(Formatter
*f
) const;
436 static void generate_test_instances(list
<rgw_cls_list_ret
*>& o
);
438 WRITE_CLASS_ENCODER(rgw_cls_list_ret
)
440 struct rgw_cls_check_index_ret
442 rgw_bucket_dir_header existing_header
;
443 rgw_bucket_dir_header calculated_header
;
445 rgw_cls_check_index_ret() {}
447 void encode(bufferlist
&bl
) const {
448 ENCODE_START(1, 1, bl
);
449 ::encode(existing_header
, bl
);
450 ::encode(calculated_header
, bl
);
453 void decode(bufferlist::iterator
&bl
) {
455 ::decode(existing_header
, bl
);
456 ::decode(calculated_header
, bl
);
459 void dump(Formatter
*f
) const;
460 static void generate_test_instances(list
<rgw_cls_check_index_ret
*>& o
);
462 WRITE_CLASS_ENCODER(rgw_cls_check_index_ret
)
464 struct rgw_cls_bucket_update_stats_op
466 bool absolute
{false};
467 map
<uint8_t, rgw_bucket_category_stats
> stats
;
469 rgw_cls_bucket_update_stats_op() {}
471 void encode(bufferlist
&bl
) const {
472 ENCODE_START(1, 1, bl
);
473 ::encode(absolute
, bl
);
477 void decode(bufferlist::iterator
&bl
) {
479 ::decode(absolute
, bl
);
483 void dump(Formatter
*f
) const;
484 static void generate_test_instances(list
<rgw_cls_bucket_update_stats_op
*>& o
);
486 WRITE_CLASS_ENCODER(rgw_cls_bucket_update_stats_op
)
488 struct rgw_cls_obj_remove_op
{
489 list
<string
> keep_attr_prefixes
;
491 void encode(bufferlist
& bl
) const {
492 ENCODE_START(1, 1, bl
);
493 ::encode(keep_attr_prefixes
, bl
);
497 void decode(bufferlist::iterator
& bl
) {
499 ::decode(keep_attr_prefixes
, bl
);
503 WRITE_CLASS_ENCODER(rgw_cls_obj_remove_op
)
505 struct rgw_cls_obj_store_pg_ver_op
{
508 void encode(bufferlist
& bl
) const {
509 ENCODE_START(1, 1, bl
);
514 void decode(bufferlist::iterator
& bl
) {
520 WRITE_CLASS_ENCODER(rgw_cls_obj_store_pg_ver_op
)
522 struct rgw_cls_obj_check_attrs_prefix
{
526 rgw_cls_obj_check_attrs_prefix() : fail_if_exist(false) {}
528 void encode(bufferlist
& bl
) const {
529 ENCODE_START(1, 1, bl
);
530 ::encode(check_prefix
, bl
);
531 ::encode(fail_if_exist
, bl
);
535 void decode(bufferlist::iterator
& bl
) {
537 ::decode(check_prefix
, bl
);
538 ::decode(fail_if_exist
, bl
);
542 WRITE_CLASS_ENCODER(rgw_cls_obj_check_attrs_prefix
)
544 struct rgw_cls_obj_check_mtime
{
545 ceph::real_time mtime
;
546 RGWCheckMTimeType type
;
547 bool high_precision_time
;
549 rgw_cls_obj_check_mtime() : type(CLS_RGW_CHECK_TIME_MTIME_EQ
), high_precision_time(false) {}
551 void encode(bufferlist
& bl
) const {
552 ENCODE_START(2, 1, bl
);
554 ::encode((uint8_t)type
, bl
);
555 ::encode(high_precision_time
, bl
);
559 void decode(bufferlist::iterator
& bl
) {
564 type
= (RGWCheckMTimeType
)c
;
566 ::decode(high_precision_time
, bl
);
571 WRITE_CLASS_ENCODER(rgw_cls_obj_check_mtime
)
573 struct rgw_cls_usage_log_add_op
{
574 rgw_usage_log_info info
;
577 void encode(bufferlist
& bl
) const {
578 ENCODE_START(2, 1, bl
);
580 ::encode(user
.to_str(), bl
);
584 void decode(bufferlist::iterator
& bl
) {
595 WRITE_CLASS_ENCODER(rgw_cls_usage_log_add_op
)
597 struct rgw_cls_bi_get_op
{
599 BIIndexType type
; /* namespace: plain, instance, olh */
601 rgw_cls_bi_get_op() : type(PlainIdx
) {}
603 void encode(bufferlist
& bl
) const {
604 ENCODE_START(1, 1, bl
);
606 ::encode((uint8_t)type
, bl
);
610 void decode(bufferlist::iterator
& bl
) {
615 type
= (BIIndexType
)c
;
619 WRITE_CLASS_ENCODER(rgw_cls_bi_get_op
)
621 struct rgw_cls_bi_get_ret
{
622 rgw_cls_bi_entry entry
;
624 rgw_cls_bi_get_ret() {}
626 void encode(bufferlist
& bl
) const {
627 ENCODE_START(1, 1, bl
);
632 void decode(bufferlist::iterator
& bl
) {
638 WRITE_CLASS_ENCODER(rgw_cls_bi_get_ret
)
640 struct rgw_cls_bi_put_op
{
641 rgw_cls_bi_entry entry
;
643 rgw_cls_bi_put_op() {}
645 void encode(bufferlist
& bl
) const {
646 ENCODE_START(1, 1, bl
);
651 void decode(bufferlist::iterator
& bl
) {
657 WRITE_CLASS_ENCODER(rgw_cls_bi_put_op
)
659 struct rgw_cls_bi_list_op
{
664 rgw_cls_bi_list_op() : max(0) {}
666 void encode(bufferlist
& bl
) const {
667 ENCODE_START(1, 1, bl
);
670 ::encode(marker
, bl
);
674 void decode(bufferlist::iterator
& bl
) {
678 ::decode(marker
, bl
);
682 WRITE_CLASS_ENCODER(rgw_cls_bi_list_op
)
684 struct rgw_cls_bi_list_ret
{
685 list
<rgw_cls_bi_entry
> entries
;
688 rgw_cls_bi_list_ret() : is_truncated(false) {}
690 void encode(bufferlist
& bl
) const {
691 ENCODE_START(1, 1, bl
);
692 ::encode(entries
, bl
);
693 ::encode(is_truncated
, bl
);
697 void decode(bufferlist::iterator
& bl
) {
699 ::decode(entries
, bl
);
700 ::decode(is_truncated
, bl
);
704 WRITE_CLASS_ENCODER(rgw_cls_bi_list_ret
)
706 struct rgw_cls_usage_log_read_op
{
707 uint64_t start_epoch
;
711 string iter
; // should be empty for the first call, non empty for subsequent calls
712 uint32_t max_entries
;
714 void encode(bufferlist
& bl
) const {
715 ENCODE_START(1, 1, bl
);
716 ::encode(start_epoch
, bl
);
717 ::encode(end_epoch
, bl
);
720 ::encode(max_entries
, bl
);
724 void decode(bufferlist::iterator
& bl
) {
726 ::decode(start_epoch
, bl
);
727 ::decode(end_epoch
, bl
);
730 ::decode(max_entries
, bl
);
734 WRITE_CLASS_ENCODER(rgw_cls_usage_log_read_op
)
736 struct rgw_cls_usage_log_read_ret
{
737 map
<rgw_user_bucket
, rgw_usage_log_entry
> usage
;
741 void encode(bufferlist
& bl
) const {
742 ENCODE_START(1, 1, bl
);
744 ::encode(truncated
, bl
);
745 ::encode(next_iter
, bl
);
749 void decode(bufferlist::iterator
& bl
) {
752 ::decode(truncated
, bl
);
753 ::decode(next_iter
, bl
);
757 WRITE_CLASS_ENCODER(rgw_cls_usage_log_read_ret
)
759 struct rgw_cls_usage_log_trim_op
{
760 uint64_t start_epoch
;
764 void encode(bufferlist
& bl
) const {
765 ENCODE_START(2, 2, bl
);
766 ::encode(start_epoch
, bl
);
767 ::encode(end_epoch
, bl
);
772 void decode(bufferlist::iterator
& bl
) {
774 ::decode(start_epoch
, bl
);
775 ::decode(end_epoch
, bl
);
780 WRITE_CLASS_ENCODER(rgw_cls_usage_log_trim_op
)
782 struct cls_rgw_gc_set_entry_op
{
783 uint32_t expiration_secs
;
784 cls_rgw_gc_obj_info info
;
785 cls_rgw_gc_set_entry_op() : expiration_secs(0) {}
787 void encode(bufferlist
& bl
) const {
788 ENCODE_START(1, 1, bl
);
789 ::encode(expiration_secs
, bl
);
794 void decode(bufferlist::iterator
& bl
) {
796 ::decode(expiration_secs
, bl
);
801 void dump(Formatter
*f
) const;
802 static void generate_test_instances(list
<cls_rgw_gc_set_entry_op
*>& ls
);
804 WRITE_CLASS_ENCODER(cls_rgw_gc_set_entry_op
)
806 struct cls_rgw_gc_defer_entry_op
{
807 uint32_t expiration_secs
;
809 cls_rgw_gc_defer_entry_op() : expiration_secs(0) {}
811 void encode(bufferlist
& bl
) const {
812 ENCODE_START(1, 1, bl
);
813 ::encode(expiration_secs
, bl
);
818 void decode(bufferlist::iterator
& bl
) {
820 ::decode(expiration_secs
, bl
);
825 void dump(Formatter
*f
) const;
826 static void generate_test_instances(list
<cls_rgw_gc_defer_entry_op
*>& ls
);
828 WRITE_CLASS_ENCODER(cls_rgw_gc_defer_entry_op
)
830 struct cls_rgw_gc_list_op
{
835 cls_rgw_gc_list_op() : max(0), expired_only(true) {}
837 void encode(bufferlist
& bl
) const {
838 ENCODE_START(2, 1, bl
);
839 ::encode(marker
, bl
);
841 ::encode(expired_only
, bl
);
845 void decode(bufferlist::iterator
& bl
) {
847 ::decode(marker
, bl
);
850 ::decode(expired_only
, bl
);
855 void dump(Formatter
*f
) const;
856 static void generate_test_instances(list
<cls_rgw_gc_list_op
*>& ls
);
858 WRITE_CLASS_ENCODER(cls_rgw_gc_list_op
)
860 struct cls_rgw_gc_list_ret
{
861 list
<cls_rgw_gc_obj_info
> entries
;
865 cls_rgw_gc_list_ret() : truncated(false) {}
867 void encode(bufferlist
& bl
) const {
868 ENCODE_START(2, 1, bl
);
869 ::encode(entries
, bl
);
870 ::encode(next_marker
, bl
);
871 ::encode(truncated
, bl
);
875 void decode(bufferlist::iterator
& bl
) {
877 ::decode(entries
, bl
);
879 ::decode(next_marker
, bl
);
880 ::decode(truncated
, bl
);
884 void dump(Formatter
*f
) const;
885 static void generate_test_instances(list
<cls_rgw_gc_list_ret
*>& ls
);
887 WRITE_CLASS_ENCODER(cls_rgw_gc_list_ret
)
889 struct cls_rgw_gc_remove_op
{
892 cls_rgw_gc_remove_op() {}
894 void encode(bufferlist
& bl
) const {
895 ENCODE_START(1, 1, bl
);
900 void decode(bufferlist::iterator
& bl
) {
906 void dump(Formatter
*f
) const;
907 static void generate_test_instances(list
<cls_rgw_gc_remove_op
*>& ls
);
909 WRITE_CLASS_ENCODER(cls_rgw_gc_remove_op
)
911 struct cls_rgw_bi_log_list_op
{
915 cls_rgw_bi_log_list_op() : max(0) {}
917 void encode(bufferlist
& bl
) const {
918 ENCODE_START(1, 1, bl
);
919 ::encode(marker
, bl
);
924 void decode(bufferlist::iterator
& bl
) {
926 ::decode(marker
, bl
);
931 void dump(Formatter
*f
) const;
932 static void generate_test_instances(list
<cls_rgw_bi_log_list_op
*>& ls
);
934 WRITE_CLASS_ENCODER(cls_rgw_bi_log_list_op
)
936 struct cls_rgw_bi_log_trim_op
{
940 cls_rgw_bi_log_trim_op() {}
942 void encode(bufferlist
& bl
) const {
943 ENCODE_START(1, 1, bl
);
944 ::encode(start_marker
, bl
);
945 ::encode(end_marker
, bl
);
949 void decode(bufferlist::iterator
& bl
) {
951 ::decode(start_marker
, bl
);
952 ::decode(end_marker
, bl
);
956 void dump(Formatter
*f
) const;
957 static void generate_test_instances(list
<cls_rgw_bi_log_trim_op
*>& ls
);
959 WRITE_CLASS_ENCODER(cls_rgw_bi_log_trim_op
)
961 struct cls_rgw_bi_log_list_ret
{
962 list
<rgw_bi_log_entry
> entries
;
965 cls_rgw_bi_log_list_ret() : truncated(false) {}
967 void encode(bufferlist
& bl
) const {
968 ENCODE_START(1, 1, bl
);
969 ::encode(entries
, bl
);
970 ::encode(truncated
, bl
);
974 void decode(bufferlist::iterator
& bl
) {
976 ::decode(entries
, bl
);
977 ::decode(truncated
, bl
);
981 void dump(Formatter
*f
) const;
982 static void generate_test_instances(list
<cls_rgw_bi_log_list_ret
*>& ls
);
984 WRITE_CLASS_ENCODER(cls_rgw_bi_log_list_ret
)
986 struct cls_rgw_lc_get_next_entry_op
{
988 cls_rgw_lc_get_next_entry_op() {}
990 void encode(bufferlist
& bl
) const {
991 ENCODE_START(1, 1, bl
);
992 ::encode(marker
, bl
);
996 void decode(bufferlist::iterator
& bl
) {
998 ::decode(marker
, bl
);
1002 WRITE_CLASS_ENCODER(cls_rgw_lc_get_next_entry_op
)
1004 struct cls_rgw_lc_get_next_entry_ret
{
1005 pair
<string
, int> entry
;
1007 cls_rgw_lc_get_next_entry_ret() {}
1009 void encode(bufferlist
& bl
) const {
1010 ENCODE_START(1, 1, bl
);
1011 ::encode(entry
, bl
);
1015 void decode(bufferlist::iterator
& bl
) {
1016 DECODE_START(1, bl
);
1017 ::decode(entry
, bl
);
1022 WRITE_CLASS_ENCODER(cls_rgw_lc_get_next_entry_ret
)
1024 struct cls_rgw_lc_rm_entry_op
{
1025 pair
<string
, int> entry
;
1026 cls_rgw_lc_rm_entry_op() {}
1028 void encode(bufferlist
& bl
) const {
1029 ENCODE_START(1, 1, bl
);
1030 ::encode(entry
, bl
);
1034 void decode(bufferlist::iterator
& bl
) {
1035 DECODE_START(1, bl
);
1036 ::decode(entry
, bl
);
1040 WRITE_CLASS_ENCODER(cls_rgw_lc_rm_entry_op
)
1042 struct cls_rgw_lc_set_entry_op
{
1043 pair
<string
, int> entry
;
1044 cls_rgw_lc_set_entry_op() {}
1046 void encode(bufferlist
& bl
) const {
1047 ENCODE_START(1, 1, bl
);
1048 ::encode(entry
, bl
);
1052 void decode(bufferlist::iterator
& bl
) {
1053 DECODE_START(1, bl
);
1054 ::decode(entry
, bl
);
1058 WRITE_CLASS_ENCODER(cls_rgw_lc_set_entry_op
)
1060 struct cls_rgw_lc_put_head_op
{
1061 cls_rgw_lc_obj_head head
;
1064 cls_rgw_lc_put_head_op() {}
1066 void encode(bufferlist
& bl
) const {
1067 ENCODE_START(1, 1, bl
);
1072 void decode(bufferlist::iterator
& bl
) {
1073 DECODE_START(1, bl
);
1079 WRITE_CLASS_ENCODER(cls_rgw_lc_put_head_op
)
1081 struct cls_rgw_lc_get_head_ret
{
1082 cls_rgw_lc_obj_head head
;
1084 cls_rgw_lc_get_head_ret() {}
1086 void encode(bufferlist
& bl
) const {
1087 ENCODE_START(1, 1, bl
);
1092 void decode(bufferlist::iterator
& bl
) {
1093 DECODE_START(1, bl
);
1099 WRITE_CLASS_ENCODER(cls_rgw_lc_get_head_ret
)
1101 struct cls_rgw_lc_list_entries_op
{
1103 uint32_t max_entries
;
1105 cls_rgw_lc_list_entries_op() {}
1107 void encode(bufferlist
& bl
) const {
1108 ENCODE_START(1, 1, bl
);
1109 ::encode(marker
, bl
);
1110 ::encode(max_entries
, bl
);
1114 void decode(bufferlist::iterator
& bl
) {
1115 DECODE_START(1, bl
);
1116 ::decode(marker
, bl
);
1117 ::decode(max_entries
, bl
);
1122 WRITE_CLASS_ENCODER(cls_rgw_lc_list_entries_op
)
1124 struct cls_rgw_lc_list_entries_ret
{
1125 map
<string
, int> entries
;
1126 bool is_truncated
{false};
1128 cls_rgw_lc_list_entries_ret() {}
1130 void encode(bufferlist
& bl
) const {
1131 ENCODE_START(2, 1, bl
);
1132 ::encode(entries
, bl
);
1133 ::encode(is_truncated
, bl
);
1137 void decode(bufferlist::iterator
& bl
) {
1138 DECODE_START(2, bl
);
1139 ::decode(entries
, bl
);
1140 if (struct_v
>= 2) {
1141 ::decode(is_truncated
, bl
);
1147 WRITE_CLASS_ENCODER(cls_rgw_lc_list_entries_ret
)
1149 struct cls_rgw_reshard_add_op
{
1150 cls_rgw_reshard_entry entry
;
1152 cls_rgw_reshard_add_op() {}
1154 void encode(bufferlist
& bl
) const {
1155 ENCODE_START(1, 1, bl
);
1156 ::encode(entry
, bl
);
1160 void decode(bufferlist::iterator
& bl
) {
1161 DECODE_START(1, bl
);
1162 ::decode(entry
, bl
);
1165 static void generate_test_instances(list
<cls_rgw_reshard_add_op
*>& o
);
1166 void dump(Formatter
*f
) const;
1168 WRITE_CLASS_ENCODER(cls_rgw_reshard_add_op
)
1170 struct cls_rgw_reshard_list_op
{
1174 cls_rgw_reshard_list_op() {}
1176 void encode(bufferlist
& bl
) const {
1177 ENCODE_START(1, 1, bl
);
1179 ::encode(marker
, bl
);
1183 void decode(bufferlist::iterator
& bl
) {
1184 DECODE_START(1, bl
);
1186 ::decode(marker
, bl
);
1189 static void generate_test_instances(list
<cls_rgw_reshard_list_op
*>& o
);
1190 void dump(Formatter
*f
) const;
1192 WRITE_CLASS_ENCODER(cls_rgw_reshard_list_op
)
1195 struct cls_rgw_reshard_list_ret
{
1196 list
<cls_rgw_reshard_entry
> entries
;
1197 bool is_truncated
{false};
1199 cls_rgw_reshard_list_ret() {}
1201 void encode(bufferlist
& bl
) const {
1202 ENCODE_START(1, 1, bl
);
1203 ::encode(entries
, bl
);
1204 ::encode(is_truncated
, bl
);
1208 void decode(bufferlist::iterator
& bl
) {
1209 DECODE_START(1, bl
);
1210 ::decode(entries
, bl
);
1211 ::decode(is_truncated
, bl
);
1214 static void generate_test_instances(list
<cls_rgw_reshard_list_ret
*>& o
);
1215 void dump(Formatter
*f
) const;
1217 WRITE_CLASS_ENCODER(cls_rgw_reshard_list_ret
)
1219 struct cls_rgw_reshard_get_op
{
1220 cls_rgw_reshard_entry entry
;
1222 cls_rgw_reshard_get_op() {}
1224 void encode(bufferlist
& bl
) const {
1225 ENCODE_START(1, 1, bl
);
1226 ::encode(entry
, bl
);
1230 void decode(bufferlist::iterator
& bl
) {
1231 DECODE_START(1, bl
);
1232 ::decode(entry
, bl
);
1235 static void generate_test_instances(list
<cls_rgw_reshard_get_op
*>& o
);
1236 void dump(Formatter
*f
) const;
1238 WRITE_CLASS_ENCODER(cls_rgw_reshard_get_op
)
1240 struct cls_rgw_reshard_get_ret
{
1241 cls_rgw_reshard_entry entry
;
1243 cls_rgw_reshard_get_ret() {}
1245 void encode(bufferlist
& bl
) const {
1246 ENCODE_START(1, 1, bl
);
1247 ::encode(entry
, bl
);
1251 void decode(bufferlist::iterator
& bl
) {
1252 DECODE_START(1, bl
);
1253 ::decode(entry
, bl
);
1256 static void generate_test_instances(list
<cls_rgw_reshard_get_ret
*>& o
);
1257 void dump(Formatter
*f
) const;
1259 WRITE_CLASS_ENCODER(cls_rgw_reshard_get_ret
)
1261 struct cls_rgw_reshard_remove_op
{
1266 cls_rgw_reshard_remove_op() {}
1268 void encode(bufferlist
& bl
) const {
1269 ENCODE_START(1, 1, bl
);
1270 ::encode(tenant
, bl
);
1271 ::encode(bucket_name
, bl
);
1272 ::encode(bucket_id
, bl
);
1276 void decode(bufferlist::iterator
& bl
) {
1277 DECODE_START(1, bl
);
1278 ::decode(tenant
, bl
);
1279 ::decode(bucket_name
, bl
);
1280 ::decode(bucket_id
, bl
);
1283 static void generate_test_instances(list
<cls_rgw_reshard_remove_op
*>& o
);
1284 void dump(Formatter
*f
) const;
1286 WRITE_CLASS_ENCODER(cls_rgw_reshard_remove_op
)
1288 struct cls_rgw_set_bucket_resharding_op
{
1289 cls_rgw_bucket_instance_entry entry
;
1291 void encode(bufferlist
& bl
) const {
1292 ENCODE_START(1, 1, bl
);
1293 ::encode(entry
, bl
);
1297 void decode(bufferlist::iterator
& bl
) {
1298 DECODE_START(1, bl
);
1299 ::decode(entry
, bl
);
1302 static void generate_test_instances(list
<cls_rgw_set_bucket_resharding_op
*>& o
);
1303 void dump(Formatter
*f
) const;
1305 WRITE_CLASS_ENCODER(cls_rgw_set_bucket_resharding_op
)
1307 struct cls_rgw_clear_bucket_resharding_op
{
1308 void encode(bufferlist
& bl
) const {
1309 ENCODE_START(1, 1, bl
);
1313 void decode(bufferlist::iterator
& bl
) {
1314 DECODE_START(1, bl
);
1317 static void generate_test_instances(list
<cls_rgw_clear_bucket_resharding_op
*>& o
);
1318 void dump(Formatter
*f
) const;
1320 WRITE_CLASS_ENCODER(cls_rgw_clear_bucket_resharding_op
)
1322 struct cls_rgw_guard_bucket_resharding_op
{
1325 void encode(bufferlist
& bl
) const {
1326 ENCODE_START(1, 1, bl
);
1327 ::encode(ret_err
, bl
);
1331 void decode(bufferlist::iterator
& bl
) {
1332 DECODE_START(1, bl
);
1333 ::decode(ret_err
, bl
);
1337 static void generate_test_instances(list
<cls_rgw_guard_bucket_resharding_op
*>& o
);
1338 void dump(Formatter
*f
) const;
1340 WRITE_CLASS_ENCODER(cls_rgw_guard_bucket_resharding_op
)
1342 struct cls_rgw_get_bucket_resharding_op
{
1344 void encode(bufferlist
& bl
) const {
1345 ENCODE_START(1, 1, bl
);
1349 void decode(bufferlist::iterator
& bl
) {
1350 DECODE_START(1, bl
);
1354 static void generate_test_instances(list
<cls_rgw_get_bucket_resharding_op
*>& o
);
1355 void dump(Formatter
*f
) const;
1357 WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_op
)
1359 struct cls_rgw_get_bucket_resharding_ret
{
1360 cls_rgw_bucket_instance_entry new_instance
;
1362 void encode(bufferlist
& bl
) const {
1363 ENCODE_START(1, 1, bl
);
1364 ::encode(new_instance
, bl
);
1368 void decode(bufferlist::iterator
& bl
) {
1369 DECODE_START(1, bl
);
1370 ::decode(new_instance
, bl
);
1374 static void generate_test_instances(list
<cls_rgw_get_bucket_resharding_ret
*>& o
);
1375 void dump(Formatter
*f
) const;
1377 WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_ret
)
1379 #endif /* CEPH_CLS_RGW_OPS_H */