]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: add --quota-scope param to usage 707/head
authorYehuda Sadeh <yehuda@inktank.com>
Mon, 14 Oct 2013 17:26:49 +0000 (10:26 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Mon, 14 Oct 2013 17:26:49 +0000 (10:26 -0700)
and also look at it when setting quota on a bucket.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_admin.cc
src/test/cli/radosgw-admin/help.t

index 11d8c71ad15e89a19a25c884c45d36f9fa28d820..b23bf3ba5d4bfba03e1c612e68c70cf39abb4e29 100644 (file)
@@ -161,6 +161,7 @@ void _usage()
   cerr << "   --bucket                  specified bucket for quota command\n";
   cerr << "   --max-objects             specify max objects\n";
   cerr << "   --max-size                specify max size (in bytes)\n";
+  cerr << "   --quota-scope             scope of quota (bucket, user)\n";
   cerr << "\n";
   generic_client_usage();
 }
@@ -2324,6 +2325,10 @@ next:
     }
 
     if (!bucket_name.empty()) {
+      if (!quota_scope.empty() && quota_scope != "bucket") {
+        cerr << "ERROR: invalid quota scope specification." << std::endl;
+        return EINVAL;
+      }
       set_bucket_quota(store, opt_cmd, bucket_name, max_size, max_objects);
     } else if (!user_id.empty()) {
       if (quota_scope != "bucket") {
index ed559916b4cba644bd75be40268c2c38f4c112fd..417c04ee77782983fea88c031ffb21e675740efc 100644 (file)
      --bucket                  specified bucket for quota command
      --max-objects             specify max objects
      --max-size                specify max size (in bytes)
+     --quota-scope             scope of quota (bucket, user)
   
     --conf/-c        Read configuration from the given configuration file
     --id/-i          set ID portion of my name