Skip to content

Commit

Permalink
Merge pull request #10000 from weiqiaomiao/wqm-wip-add-userlist-cli
Browse files Browse the repository at this point in the history
rgw: add "radosgw-admin user list" cli

verified
  • Loading branch information
mattbenjamin committed Jul 1, 2016
2 parents f76f5a9 + 2e2b9f3 commit 89561ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/rgw/rgw_admin.cc
Expand Up @@ -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" ;
Expand Down Expand Up @@ -269,6 +270,7 @@ enum {
OPT_USER_ENABLE,
OPT_USER_CHECK,
OPT_USER_STATS,
OPT_USER_LIST,
OPT_SUBUSER_CREATE,
OPT_SUBUSER_MODIFY,
OPT_SUBUSER_RM,
Expand Down Expand Up @@ -453,6 +455,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;
Expand Down Expand Up @@ -4853,7 +4857,10 @@ int main(int argc, char **argv)
}
}

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);
Expand Down
1 change: 1 addition & 0 deletions src/test/cli/radosgw-admin/help.t
Expand Up @@ -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
Expand Down

0 comments on commit 89561ac

Please sign in to comment.