]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/cls/rgw/cls_rgw_ops.h
update sources to v12.1.0
[ceph.git] / ceph / src / cls / rgw / cls_rgw_ops.h
index 74035929387b443d54326c54cddb5d6dc519350f..538443adf40b40179904a4d1f439d7efd4b573a4 100644 (file)
@@ -1,10 +1,6 @@
 #ifndef CEPH_CLS_RGW_OPS_H
 #define CEPH_CLS_RGW_OPS_H
 
-#include <map>
-
-#include "include/types.h"
-#include "common/ceph_time.h"
 #include "cls/rgw/cls_rgw_types.h"
 
 struct rgw_cls_tag_timeout_op
@@ -36,11 +32,12 @@ struct rgw_cls_obj_prepare_op
   string locator;
   bool log_op;
   uint16_t bilog_flags;
+  rgw_zone_set zones_trace;
 
   rgw_cls_obj_prepare_op() : op(CLS_RGW_OP_UNKNOWN), log_op(false), bilog_flags(0) {}
 
   void encode(bufferlist &bl) const {
-    ENCODE_START(6, 5, bl);
+    ENCODE_START(7, 5, bl);
     uint8_t c = (uint8_t)op;
     ::encode(c, bl);
     ::encode(tag, bl);
@@ -48,10 +45,11 @@ struct rgw_cls_obj_prepare_op
     ::encode(log_op, bl);
     ::encode(key, bl);
     ::encode(bilog_flags, bl);
+    ::encode(zones_trace, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
-    DECODE_START_LEGACY_COMPAT_LEN(6, 3, 3, bl);
+    DECODE_START_LEGACY_COMPAT_LEN(7, 3, 3, bl);
     uint8_t c;
     ::decode(c, bl);
     op = (RGWModifyOp)c;
@@ -71,6 +69,9 @@ struct rgw_cls_obj_prepare_op
     if (struct_v >= 6) {
       ::decode(bilog_flags, bl);
     }
+    if (struct_v >= 7) {
+      ::decode(zones_trace, bl);
+    }
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -90,11 +91,12 @@ struct rgw_cls_obj_complete_op
   uint16_t bilog_flags;
 
   list<cls_rgw_obj_key> remove_objs;
+  rgw_zone_set zones_trace;
 
   rgw_cls_obj_complete_op() : op(CLS_RGW_OP_ADD), log_op(false), bilog_flags(0) {}
 
   void encode(bufferlist &bl) const {
-    ENCODE_START(8, 7, bl);
+    ENCODE_START(9, 7, bl);
     uint8_t c = (uint8_t)op;
     ::encode(c, bl);
     ::encode(ver.epoch, bl);
@@ -106,10 +108,11 @@ struct rgw_cls_obj_complete_op
     ::encode(log_op, bl);
     ::encode(key, bl);
     ::encode(bilog_flags, bl);
+    ::encode(zones_trace, bl);
     ENCODE_FINISH(bl);
  }
   void decode(bufferlist::iterator &bl) {
-    DECODE_START_LEGACY_COMPAT_LEN(8, 3, 3, bl);
+    DECODE_START_LEGACY_COMPAT_LEN(9, 3, 3, bl);
     uint8_t c;
     ::decode(c, bl);
     op = (RGWModifyOp)c;
@@ -149,6 +152,9 @@ struct rgw_cls_obj_complete_op
     if (struct_v >= 8) {
       ::decode(bilog_flags, bl);
     }
+    if (struct_v >= 9) {
+      ::decode(zones_trace, bl);
+    }
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -167,11 +173,12 @@ struct rgw_cls_link_olh_op {
   uint16_t bilog_flags;
   real_time unmod_since; /* only create delete marker if newer then this */
   bool high_precision_time;
+  rgw_zone_set zones_trace;
 
   rgw_cls_link_olh_op() : delete_marker(false), olh_epoch(0), log_op(false), bilog_flags(0), high_precision_time(false) {}
 
   void encode(bufferlist& bl) const {
-    ENCODE_START(4, 1, bl);
+    ENCODE_START(5, 1, bl);
     ::encode(key, bl);
     ::encode(olh_tag, bl);
     ::encode(delete_marker, bl);
@@ -184,11 +191,12 @@ struct rgw_cls_link_olh_op {
     ::encode(t, bl);
     ::encode(unmod_since, bl);
     ::encode(high_precision_time, bl);
+    ::encode(zones_trace, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
-    DECODE_START(4, bl);
+    DECODE_START(5, bl);
     ::decode(key, bl);
     ::decode(olh_tag, bl);
     ::decode(delete_marker, bl);
@@ -203,11 +211,16 @@ struct rgw_cls_link_olh_op {
       unmod_since = ceph::real_clock::from_time_t(static_cast<time_t>(t));
     }
     if (struct_v >= 3) {
+      uint64_t t;
+      ::decode(t, bl);
       ::decode(unmod_since, bl);
     }
     if (struct_v >= 4) {
       ::decode(high_precision_time, bl);
     }
+    if (struct_v >= 5) {
+      ::decode(zones_trace, bl);
+    }
     DECODE_FINISH(bl);
   }
 
@@ -223,22 +236,24 @@ struct rgw_cls_unlink_instance_op {
   bool log_op;
   uint16_t bilog_flags;
   string olh_tag;
+  rgw_zone_set zones_trace;
 
   rgw_cls_unlink_instance_op() : olh_epoch(0), log_op(false), bilog_flags(0) {}
 
   void encode(bufferlist& bl) const {
-    ENCODE_START(2, 1, bl);
+    ENCODE_START(3, 1, bl);
     ::encode(key, bl);
     ::encode(op_tag, bl);
     ::encode(olh_epoch, bl);
     ::encode(log_op, bl);
     ::encode(bilog_flags, bl);
     ::encode(olh_tag, bl);
+    ::encode(zones_trace, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
-    DECODE_START(2, bl);
+    DECODE_START(3, bl);
     ::decode(key, bl);
     ::decode(op_tag, bl);
     ::decode(olh_epoch, bl);
@@ -247,6 +262,9 @@ struct rgw_cls_unlink_instance_op {
     if (struct_v >= 2) {
       ::decode(olh_tag, bl);
     }
+    if (struct_v >= 3) {
+      ::decode(zones_trace, bl);
+    }
     DECODE_FINISH(bl);
   }
 
@@ -841,20 +859,24 @@ WRITE_CLASS_ENCODER(cls_rgw_gc_list_op)
 
 struct cls_rgw_gc_list_ret {
   list<cls_rgw_gc_obj_info> entries;
+  string next_marker;
   bool truncated;
 
   cls_rgw_gc_list_ret() : truncated(false) {}
 
   void encode(bufferlist& bl) const {
-    ENCODE_START(1, 1, bl);
+    ENCODE_START(2, 1, bl);
     ::encode(entries, bl);
+    ::encode(next_marker, bl);
     ::encode(truncated, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
-    DECODE_START(1, bl);
+    DECODE_START(2, bl);
     ::decode(entries, bl);
+    if (struct_v >= 2)
+      ::decode(next_marker, bl);
     ::decode(truncated, bl);
     DECODE_FINISH(bl);
   }
@@ -1119,4 +1141,234 @@ struct cls_rgw_lc_list_entries_ret {
 };
 WRITE_CLASS_ENCODER(cls_rgw_lc_list_entries_ret)
 
+struct cls_rgw_reshard_add_op {
+ cls_rgw_reshard_entry entry;
+
+  cls_rgw_reshard_add_op() {}
+
+  void encode(bufferlist& bl) const {
+    ENCODE_START(1, 1, bl);
+    ::encode(entry, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::iterator& bl) {
+    DECODE_START(1, bl);
+    ::decode(entry, bl);
+    DECODE_FINISH(bl);
+  }
+  static void generate_test_instances(list<cls_rgw_reshard_add_op*>& o);
+  void dump(Formatter *f) const;
+};
+WRITE_CLASS_ENCODER(cls_rgw_reshard_add_op)
+
+struct cls_rgw_reshard_list_op {
+  uint32_t max{0};
+  string marker;
+
+  cls_rgw_reshard_list_op() {}
+
+  void encode(bufferlist& bl) const {
+    ENCODE_START(1, 1, bl);
+    ::encode(max, bl);
+    ::encode(marker, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::iterator& bl) {
+    DECODE_START(1, bl);
+    ::decode(max, bl);
+    ::decode(marker, bl);
+    DECODE_FINISH(bl);
+  }
+  static void generate_test_instances(list<cls_rgw_reshard_list_op*>& o);
+  void dump(Formatter *f) const;
+};
+WRITE_CLASS_ENCODER(cls_rgw_reshard_list_op)
+
+
+struct cls_rgw_reshard_list_ret {
+  list<cls_rgw_reshard_entry> entries;
+  bool is_truncated{false};
+
+  cls_rgw_reshard_list_ret() {}
+
+  void encode(bufferlist& bl) const {
+    ENCODE_START(1, 1, bl);
+    ::encode(entries, bl);
+    ::encode(is_truncated, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::iterator& bl) {
+    DECODE_START(1, bl);
+    ::decode(entries, bl);
+    ::decode(is_truncated, bl);
+    DECODE_FINISH(bl);
+  }
+  static void generate_test_instances(list<cls_rgw_reshard_list_ret*>& o);
+  void dump(Formatter *f) const;
+};
+WRITE_CLASS_ENCODER(cls_rgw_reshard_list_ret)
+
+struct cls_rgw_reshard_get_op {
+  cls_rgw_reshard_entry entry;
+
+  cls_rgw_reshard_get_op() {}
+
+  void encode(bufferlist& bl) const {
+    ENCODE_START(1, 1, bl);
+    ::encode(entry, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::iterator& bl) {
+    DECODE_START(1, bl);
+    ::decode(entry, bl);
+    DECODE_FINISH(bl);
+  }
+  static void generate_test_instances(list<cls_rgw_reshard_get_op*>& o);
+  void dump(Formatter *f) const;
+};
+WRITE_CLASS_ENCODER(cls_rgw_reshard_get_op)
+
+struct cls_rgw_reshard_get_ret {
+  cls_rgw_reshard_entry entry;
+
+  cls_rgw_reshard_get_ret() {}
+
+  void encode(bufferlist& bl) const {
+    ENCODE_START(1, 1, bl);
+    ::encode(entry, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::iterator& bl) {
+    DECODE_START(1, bl);
+    ::decode(entry, bl);
+    DECODE_FINISH(bl);
+  }
+  static void generate_test_instances(list<cls_rgw_reshard_get_ret*>& o);
+  void dump(Formatter *f) const;
+};
+WRITE_CLASS_ENCODER(cls_rgw_reshard_get_ret)
+
+struct cls_rgw_reshard_remove_op {
+  string tenant;
+  string bucket_name;
+  string bucket_id;
+
+  cls_rgw_reshard_remove_op() {}
+
+  void encode(bufferlist& bl) const {
+    ENCODE_START(1, 1, bl);
+    ::encode(tenant, bl);
+    ::encode(bucket_name, bl);
+    ::encode(bucket_id, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::iterator& bl) {
+    DECODE_START(1, bl);
+    ::decode(tenant, bl);
+    ::decode(bucket_name, bl);
+    ::decode(bucket_id, bl);
+    DECODE_FINISH(bl);
+  }
+  static void generate_test_instances(list<cls_rgw_reshard_remove_op*>& o);
+  void dump(Formatter *f) const;
+};
+WRITE_CLASS_ENCODER(cls_rgw_reshard_remove_op)
+
+struct cls_rgw_set_bucket_resharding_op  {
+  cls_rgw_bucket_instance_entry entry;
+
+  void encode(bufferlist& bl) const {
+    ENCODE_START(1, 1, bl);
+    ::encode(entry, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::iterator& bl) {
+    DECODE_START(1, bl);
+    ::decode(entry, bl);
+    DECODE_FINISH(bl);
+  }
+  static void generate_test_instances(list<cls_rgw_set_bucket_resharding_op*>& o);
+  void dump(Formatter *f) const;
+};
+WRITE_CLASS_ENCODER(cls_rgw_set_bucket_resharding_op)
+
+struct cls_rgw_clear_bucket_resharding_op {
+  void encode(bufferlist& bl) const {
+    ENCODE_START(1, 1, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::iterator& bl) {
+    DECODE_START(1, bl);
+    DECODE_FINISH(bl);
+  }
+  static void generate_test_instances(list<cls_rgw_clear_bucket_resharding_op*>& o);
+  void dump(Formatter *f) const;
+};
+WRITE_CLASS_ENCODER(cls_rgw_clear_bucket_resharding_op)
+
+struct cls_rgw_guard_bucket_resharding_op  {
+  int ret_err{0};
+
+  void encode(bufferlist& bl) const {
+    ENCODE_START(1, 1, bl);
+    ::encode(ret_err, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::iterator& bl) {
+    DECODE_START(1, bl);
+    ::decode(ret_err, bl);
+    DECODE_FINISH(bl);
+  }
+
+  static void generate_test_instances(list<cls_rgw_guard_bucket_resharding_op*>& o);
+  void dump(Formatter *f) const;
+};
+WRITE_CLASS_ENCODER(cls_rgw_guard_bucket_resharding_op)
+
+struct cls_rgw_get_bucket_resharding_op  {
+
+  void encode(bufferlist& bl) const {
+    ENCODE_START(1, 1, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::iterator& bl) {
+    DECODE_START(1, bl);
+    DECODE_FINISH(bl);
+  }
+
+  static void generate_test_instances(list<cls_rgw_get_bucket_resharding_op*>& o);
+  void dump(Formatter *f) const;
+};
+WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_op)
+
+struct cls_rgw_get_bucket_resharding_ret  {
+  cls_rgw_bucket_instance_entry new_instance;
+
+  void encode(bufferlist& bl) const {
+    ENCODE_START(1, 1, bl);
+    ::encode(new_instance, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::iterator& bl) {
+    DECODE_START(1, bl);
+    ::decode(new_instance, bl);
+    DECODE_FINISH(bl);
+  }
+
+  static void generate_test_instances(list<cls_rgw_get_bucket_resharding_ret*>& o);
+  void dump(Formatter *f) const;
+};
+WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_ret)
+
 #endif /* CEPH_CLS_RGW_OPS_H */