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_reset_stats_op
{
140 cls_user_reset_stats_op() {}
142 void encode(bufferlist
& bl
) const {
143 ENCODE_START(1, 1, bl
);
148 void decode(bufferlist::iterator
& bl
) {
154 void dump(Formatter
*f
) const;
155 static void generate_test_instances(list
<cls_user_reset_stats_op
*>& ls
);
157 WRITE_CLASS_ENCODER(cls_user_reset_stats_op
);
159 struct cls_user_get_header_ret
{
160 cls_user_header header
;
162 cls_user_get_header_ret() {}
164 void encode(bufferlist
& bl
) const {
165 ENCODE_START(1, 1, bl
);
166 ::encode(header
, bl
);
170 void decode(bufferlist::iterator
& bl
) {
172 ::decode(header
, bl
);
176 void dump(Formatter
*f
) const;
177 static void generate_test_instances(list
<cls_user_get_header_ret
*>& ls
);
179 WRITE_CLASS_ENCODER(cls_user_get_header_ret
)
181 struct cls_user_complete_stats_sync_op
{
184 cls_user_complete_stats_sync_op() {}
186 void encode(bufferlist
& bl
) const {
187 ENCODE_START(1, 1, bl
);
192 void decode(bufferlist::iterator
& bl
) {
198 void dump(Formatter
*f
) const;
199 static void generate_test_instances(list
<cls_user_complete_stats_sync_op
*>& ls
);
201 WRITE_CLASS_ENCODER(cls_user_complete_stats_sync_op
)