]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: Add master_zonegroup and master_zone to period prepare
authorOrit Wasserman <owasserm@redhat.com>
Wed, 9 Sep 2015 08:54:47 +0000 (10:54 +0200)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:12:42 +0000 (16:12 -0800)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_admin.cc
src/rgw/rgw_rados.h

index 7e068a348d266a09afb8e3bf0458966d0dc41c5e..01eeba50fb457c8885d71a716ebcc5749ff7c4ea 100644 (file)
@@ -173,6 +173,8 @@ void _usage()
   cerr << "   --remote=<remote>         remote to pull period\n";
   cerr << "   --parent=<id>             parent period id\n";
   cerr << "   --period=<id>             period id\n";
+  cerr << "   --master-zonegroup=<id>   master zonegroup id\n";
+  cerr << "   --master-zone=<id>        master zone id\n";
   cerr << "   --realm=<realm>     realm name\n";
   cerr << "   --realm-id=<realm id>     realm id\n";
   cerr << "   --realm-new-name=<realm new name> realm new name\n";
@@ -1252,6 +1254,7 @@ int main(int argc, char **argv)
   std::string start_date, end_date;
   std::string key_type_str;
   std::string period_id, url, parent_period;
+  std::string master_zonegroup, master_zone;
   std::string realm_name, realm_id, realm_new_name;
   std::string zone_name, zone_id, zone_new_name;
   std::string zonegroup_name, zonegroup_id, zonegroup_new_name;
@@ -1547,6 +1550,10 @@ int main(int argc, char **argv)
       }
     } else if (ceph_argparse_witharg(args, i, &val, "--parent", (char*)NULL)) {
       parent_period = val;
+    } else if (ceph_argparse_witharg(args, i, &val, "--master-zonegroup", (char*)NULL)) {
+      master_zonegroup = val;
+    } else if (ceph_argparse_witharg(args, i, &val, "--master-zone", (char*)NULL)) {
+      master_zone = val;
     } else if (ceph_argparse_witharg(args, i, &val, "--period", (char*)NULL)) {
       period_id = val;
     } else if (ceph_argparse_witharg(args, i, &val, "--url", (char*)NULL)) {
@@ -1688,7 +1695,7 @@ int main(int argc, char **argv)
     switch (opt_cmd) {
     case OPT_PERIOD_PREPARE:
       {
-       RGWPeriod period( g_ceph_context, store);
+       RGWPeriod period(g_ceph_context, store, master_zonegroup, master_zone);
        int ret = period.create();
        if (ret < 0) {
          cerr << "ERROR: couldn't prepare new period " << ": " << cpp_strerror(-ret) << std::endl;
index 9288d5dbf8d1836058b1109172f246fbd51f2e48..ea642bd80801f2e892449729a219011726038de1 100644 (file)
@@ -1274,6 +1274,12 @@ public:
            const string& period_id = "", epoch_t _epoch = 0)
     : id(period_id), epoch(_epoch), cct(_cct), store(_store) {}
 
+  RGWPeriod(CephContext *_cct, RGWRados *_store,
+           const string& _master_zonegroup, const string& _master_zone,
+           const string& period_id = "", epoch_t _epoch = 0)
+    : id(period_id), epoch(_epoch), master_zonegroup(_master_zonegroup), master_zone(_master_zone), cct(_cct),
+      store(_store) {}
+
   string get_id() { return id;}
   epoch_t get_epoch() { return epoch;}
   string get_predecessor() { return predecessor_uuid;}
@@ -1283,7 +1289,7 @@ public:
   const string& get_pool_name(CephContext *cct);
   const string& get_latest_epoch_oid();
   const string& get_info_oid_prefix();
-
+  
   int get_latest_epoch(epoch_t& epoch);
   int init(const string& realm_id = "", const string &realm_name = "", bool setup_obj = true);
   int init(const string& period_id, epoch_t epoch, bool setup_obj = true);