From: Yehuda Sadeh Date: Tue, 2 Jul 2013 21:01:13 +0000 (-0700) Subject: rgw: replica log RESTful api uses bucket instance id X-Git-Tag: v0.67-rc1~128^2~18^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b3f6423e7098c8df745f331ba148fda0692a76ed;p=ceph.git rgw: replica log RESTful api uses bucket instance id Modified RESTful api for replica log to use bucket instance id instead of bucket name. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rest_replica_log.cc b/src/rgw/rgw_rest_replica_log.cc index dfd935024fa0..863a979a22e4 100644 --- a/src/rgw/rgw_rest_replica_log.cc +++ b/src/rgw/rgw_rest_replica_log.cc @@ -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);