]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add "radosgw-admin user list" cli 10000/head
authorweiqiaomiao <wei.qiaomiao@zte.com.cn>
Wed, 29 Jun 2016 07:54:49 +0000 (15:54 +0800)
committerweiqiaomiao <wei.qiaomiao@zte.com.cn>
Wed, 29 Jun 2016 08:07:31 +0000 (16:07 +0800)
add "radosgw-admin user list" command  in order to more intuitive list users than "radosgw-admin metadata list user" command

Signed-off-by: weiqiaomiao <wei.qiaomiao@zte.com.cn>
src/rgw/rgw_admin.cc
src/test/cli/radosgw-admin/help.t

index 1c5e7a480f623663478e9b0c36c9ad8839748cd0..0412aa80283465b1e85c6c7133aa4871644babf6 100644 (file)
@@ -57,6 +57,7 @@ void _usage()
   cout << "  user enable                re-enable user after suspension\n";
   cout << "  user check                 check user info\n";
   cout << "  user stats                 show user stats as accounted by quota subsystem\n";
+  cout << "  user list                  list users\n";
   cout << "  caps add                   add user capabilities\n";
   cout << "  caps rm                    remove user capabilities\n";
   cout << "  subuser create             create a new subuser\n" ;
@@ -268,6 +269,7 @@ enum {
   OPT_USER_ENABLE,
   OPT_USER_CHECK,
   OPT_USER_STATS,
+  OPT_USER_LIST,
   OPT_SUBUSER_CREATE,
   OPT_SUBUSER_MODIFY,
   OPT_SUBUSER_RM,
@@ -452,6 +454,8 @@ static int get_cmd(const char *cmd, const char *prev_cmd, const char *prev_prev_
       return OPT_USER_CHECK;
     if (strcmp(cmd, "stats") == 0)
       return OPT_USER_STATS;
+    if (strcmp(cmd, "list") == 0)
+      return OPT_USER_LIST;
   } else if (strcmp(prev_cmd, "subuser") == 0) {
     if (strcmp(cmd, "create") == 0)
       return OPT_SUBUSER_CREATE;
@@ -4852,7 +4856,10 @@ next:
     }
   }
 
-  if (opt_cmd == OPT_METADATA_LIST) {
+  if (opt_cmd == OPT_METADATA_LIST || opt_cmd == OPT_USER_LIST) {
+    if (opt_cmd == OPT_USER_LIST) {
+      metadata_key = "user";
+    }
     void *handle;
     int max = 1000;
     int ret = store->meta_mgr->list_keys_init(metadata_key, &handle);
index 17f822050c787b432354d8a9e688e1d0f8ee7cbf..d385f639e9af27802dfb1d633af27c39edb7f2dd 100644 (file)
@@ -9,6 +9,7 @@
     user enable                re-enable user after suspension
     user check                 check user info
     user stats                 show user stats as accounted by quota subsystem
+    user list                  list users
     caps add                   add user capabilities
     caps rm                    remove user capabilities
     subuser create             create a new subuser