1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_CLS_USER_OPS_H
5 #define CEPH_CLS_USER_OPS_H
7 #include "cls_user_types.h"
9 struct cls_user_set_buckets_op {
10 list<cls_user_bucket_entry> entries;
12 real_time time; /* op time */
14 cls_user_set_buckets_op() : add(false) {}
16 void encode(bufferlist& bl) const {
17 ENCODE_START(1, 1, bl);
18 ::encode(entries, bl);
24 void decode(bufferlist::iterator& bl) {
26 ::decode(entries, bl);
32 void dump(Formatter *f) const;
33 static void generate_test_instances(list<cls_user_set_buckets_op*>& ls);
35 WRITE_CLASS_ENCODER(cls_user_set_buckets_op)
37 struct cls_user_remove_bucket_op {
38 cls_user_bucket bucket;
40 cls_user_remove_bucket_op() {}
42 void encode(bufferlist& bl) const {
43 ENCODE_START(1, 1, bl);
48 void decode(bufferlist::iterator& bl) {
54 void dump(Formatter *f) const;
55 static void generate_test_instances(list<cls_user_remove_bucket_op*>& ls);
57 WRITE_CLASS_ENCODER(cls_user_remove_bucket_op)
59 struct cls_user_list_buckets_op {
62 int max_entries; /* upperbound to returned num of entries
63 might return less than that and still be truncated */
65 cls_user_list_buckets_op()
68 void encode(bufferlist& bl) const {
69 ENCODE_START(2, 1, bl);
71 ::encode(max_entries, bl);
72 ::encode(end_marker, bl);
76 void decode(bufferlist::iterator& bl) {
79 ::decode(max_entries, bl);
81 ::decode(end_marker, bl);
86 void dump(Formatter *f) const;
87 static void generate_test_instances(list<cls_user_list_buckets_op*>& ls);
89 WRITE_CLASS_ENCODER(cls_user_list_buckets_op)
91 struct cls_user_list_buckets_ret {
92 list<cls_user_bucket_entry> entries;
96 cls_user_list_buckets_ret() : truncated(false) {}
98 void encode(bufferlist& bl) const {
99 ENCODE_START(1, 1, bl);
100 ::encode(entries, bl);
101 ::encode(marker, bl);
102 ::encode(truncated, bl);
106 void decode(bufferlist::iterator& bl) {
108 ::decode(entries, bl);
109 ::decode(marker, bl);
110 ::decode(truncated, bl);
114 void dump(Formatter *f) const;
115 static void generate_test_instances(list<cls_user_list_buckets_ret*>& ls);
117 WRITE_CLASS_ENCODER(cls_user_list_buckets_ret)
120 struct cls_user_get_header_op {
121 cls_user_get_header_op() {}
123 void encode(bufferlist& bl) const {
124 ENCODE_START(1, 1, bl);
128 void decode(bufferlist::iterator& bl) {
133 void dump(Formatter *f) const;
134 static void generate_test_instances(list<cls_user_get_header_op*>& ls);
136 WRITE_CLASS_ENCODER(cls_user_get_header_op)
138 struct cls_user_get_header_ret {
139 cls_user_header header;
141 cls_user_get_header_ret() {}
143 void encode(bufferlist& bl) const {
144 ENCODE_START(1, 1, bl);
145 ::encode(header, bl);
149 void decode(bufferlist::iterator& bl) {
151 ::decode(header, bl);
155 void dump(Formatter *f) const;
156 static void generate_test_instances(list<cls_user_get_header_ret*>& ls);
158 WRITE_CLASS_ENCODER(cls_user_get_header_ret)
160 struct cls_user_complete_stats_sync_op {
163 cls_user_complete_stats_sync_op() {}
165 void encode(bufferlist& bl) const {
166 ENCODE_START(1, 1, bl);
171 void decode(bufferlist::iterator& bl) {
177 void dump(Formatter *f) const;
178 static void generate_test_instances(list<cls_user_complete_stats_sync_op*>& ls);
180 WRITE_CLASS_ENCODER(cls_user_complete_stats_sync_op)