]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: sync plugin for aws (the humble beginnings!)
authorAbhishek Lekshmanan <abhishek@suse.com>
Tue, 21 Feb 2017 10:08:45 +0000 (11:08 +0100)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 10 Apr 2018 15:03:10 +0000 (08:03 -0700)
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/CMakeLists.txt
src/rgw/rgw_sync_module_aws.cc [new file with mode: 0644]
src/rgw/rgw_sync_module_aws.h [new file with mode: 0644]

index 606bdcd72e2bc08ae87334124bf5ef9968251b99..772b72c8d57a3bf681fe72a3492f0d264261c130 100644 (file)
@@ -75,6 +75,7 @@ set(rgw_a_srcs
   rgw_data_sync.cc
   rgw_otp.cc
   rgw_sync_module.cc
+  rgw_sync_module_aws.cc
   rgw_sync_module_es.cc
   rgw_sync_module_es_rest.cc
   rgw_sync_module_log.cc
diff --git a/src/rgw/rgw_sync_module_aws.cc b/src/rgw/rgw_sync_module_aws.cc
new file mode 100644 (file)
index 0000000..2c94432
--- /dev/null
@@ -0,0 +1,21 @@
+#include "rgw_common.h"
+#include "rgw_coroutine.h"
+#include "rgw_sync_module.h"
+#include "rgw_data_sync.h"
+#include "rgw_boost_asio_yield.h"
+#include "rgw_sync_module_aws.h"
+#include "rgw_rest_conn.h"
+#include "rgw_cr_rest.h"
+
+#define dout_subsys ceph_subsys_rgw
+
+static string aws_object_name(const RGWBucketInfo& bucket_info, const rgw_obj_key&key, bool user_buckets=false){
+  string obj_name;
+  if(!user_buckets){
+    obj_name = bucket_info.owner.tenant + bucket_info.owner.id + "/" + bucket_info.bucket.name + "/" + key.name;
+      } else {
+    // for future when every tenant gets their own bucket
+    obj_name = bucket_info.bucket.name + "/" + key.name;
+  }
+  return obj_name;
+}
diff --git a/src/rgw/rgw_sync_module_aws.h b/src/rgw/rgw_sync_module_aws.h
new file mode 100644 (file)
index 0000000..d322e9a
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef RGW_SYNC_MODULE_AWS_H
+#define RGW_SYNC_MODULE_AWS_H
+
+#include "rgw_sync_module.h"
+
+class RGWAWSSyncModule : public RGWSyncModule {
+ public:
+  RGWAWSSyncModule() {}
+  bool supports_data_export() override { return false;}
+  int create_instance(CephContext *cct, map<string, string>& config, RGWSyncModuleInstanceRef *instance) override;
+};
+
+#endif /* RGW_SYNC_MODULE_AWS_H */