]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: replica log RESTful api uses bucket instance id
authorYehuda Sadeh <yehuda@inktank.com>
Tue, 2 Jul 2013 21:01:13 +0000 (14:01 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Tue, 2 Jul 2013 22:02:30 +0000 (15:02 -0700)
Modified RESTful api for replica log to use bucket instance id
instead of bucket name.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_rest_replica_log.cc

index dfd935024fa0b55818b0f8cbbeaba95bb6833842..863a979a22e4144bcc60972fbd486b85603c02ef 100644 (file)
@@ -165,14 +165,13 @@ void RGWOp_OBJLog_DeleteBounds::execute() {
   http_ret = rl.delete_bound(shard, daemon_id);
 }
 
-static int bucket_name_to_bucket(RGWRados *store, string& bucket_str, rgw_bucket& bucket) {
+static int bucket_instance_to_bucket(RGWRados *store, string& bucket_instance, rgw_bucket& bucket) {
   RGWBucketInfo bucket_info;
-  RGWObjVersionTracker objv_tracker;
   time_t mtime;
   
-  int r = store->get_bucket_info(NULL, bucket_str, bucket_info, &objv_tracker, &mtime);
+  int r = store->get_bucket_instance_info(NULL, bucket_instance, bucket_info, &mtime, NULL);
   if (r < 0) {
-    dout(5) << "could not get bucket info for bucket=" << bucket_str << dendl;
+    dout(5) << "could not get bucket instance info for bucket=" << bucket_instance << dendl;
     return -EINVAL;
   }
 
@@ -181,12 +180,12 @@ static int bucket_name_to_bucket(RGWRados *store, string& bucket_str, rgw_bucket
 }
 
 void RGWOp_BILog_SetBounds::execute() {
-  string bucket_str = s->info.args.get("bucket"),
+  string bucket_instance = s->info.args.get("bucket-instance"),
          marker = s->info.args.get("marker"),
          time = s->info.args.get("time"),
          daemon_id = s->info.args.get("daemon_id");
 
-  if (bucket_str.empty() ||
+  if (bucket_instance.empty() ||
       marker.empty() ||
       time.empty() ||
       daemon_id.empty()) {
@@ -203,7 +202,7 @@ void RGWOp_BILog_SetBounds::execute() {
   }
 
   rgw_bucket bucket;
-  if ((http_ret = bucket_name_to_bucket(store, bucket_str, bucket)) < 0) 
+  if ((http_ret = bucket_instance_to_bucket(store, bucket_instance, bucket)) < 0) 
     return;
 
   RGWReplicaBucketLogger rl(store);
@@ -218,16 +217,16 @@ void RGWOp_BILog_SetBounds::execute() {
 }
 
 void RGWOp_BILog_GetBounds::execute() {
-  string bucket_str = s->info.args.get("bucket");
+  string bucket_instance = s->info.args.get("bucket-instance");
 
-  if (bucket_str.empty()) {
+  if (bucket_instance.empty()) {
     dout(5) << " Error - invalid parameter list" << dendl;
     http_ret = -EINVAL;
     return;
   }
 
   rgw_bucket bucket;
-  if ((http_ret = bucket_name_to_bucket(store, bucket_str, bucket)) < 0) 
+  if ((http_ret = bucket_instance_to_bucket(store, bucket_instance, bucket)) < 0) 
     return;
 
   RGWReplicaBucketLogger rl(store);
@@ -247,10 +246,10 @@ void RGWOp_BILog_GetBounds::send_response() {
 }
 
 void RGWOp_BILog_DeleteBounds::execute() {
-  string bucket_str = s->info.args.get("bucket"),
+  string bucket_instance = s->info.args.get("bucket-instance"),
          daemon_id = s->info.args.get("daemon_id");
 
-  if (bucket_str.empty() ||
+  if (bucket_instance.empty() ||
       daemon_id.empty()) {
     dout(5) << "Error - invalid parameter list" << dendl;
     http_ret = -EINVAL;
@@ -258,7 +257,7 @@ void RGWOp_BILog_DeleteBounds::execute() {
   }
   
   rgw_bucket bucket;
-  if ((http_ret = bucket_name_to_bucket(store, bucket_str, bucket)) < 0) 
+  if ((http_ret = bucket_instance_to_bucket(store, bucket_instance, bucket)) < 0) 
     return;
   
   RGWReplicaBucketLogger rl(store);