diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2012-11-26 14:56:18 -0800 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2012-11-26 15:55:00 -0800 |
commit | 6bc32b20086c7cecd58b439b6b7d819b63fdcb73 (patch) | |
tree | 17360d317f964f98702c97d2265fcb16b53ac504 | |
parent | b1c71088bbd13955cfa81283fa2efc34822cd873 (diff) | |
download | ceph-6bc32b20086c7cecd58b439b6b7d819b63fdcb73.tar.gz |
rgw: usage REST api handles cateogories
Fixes: #3528
The usage REST api was missing the categories filter.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_rest_usage.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rgw/rgw_rest_usage.cc b/src/rgw/rgw_rest_usage.cc index 428744538e5..e087bcc512c 100644 --- a/src/rgw/rgw_rest_usage.cc +++ b/src/rgw/rgw_rest_usage.cc @@ -2,6 +2,8 @@ #include "rgw_usage.h" #include "rgw_rest_usage.h" +#include "include/str_list.h" + #define dout_subsys ceph_subsys_rgw class RGWOp_Usage_Get : public RGWRESTOp { @@ -31,6 +33,18 @@ void RGWOp_Usage_Get::execute() { RESTArgs::get_bool(s, "show-entries", true, &show_entries); RESTArgs::get_bool(s, "show-summary", true, &show_summary); + string cat_str; + RESTArgs::get_string(s, "categories", cat_str, &cat_str); + + if (!cat_str.empty()) { + list<string> cat_list; + list<string>::iterator iter; + get_str_list(cat_str, cat_list); + for (iter = cat_list.begin(); iter != cat_list.end(); ++iter) { + categories[*iter] = true; + } + } + http_ret = RGWUsage::show(store, uid, start, end, show_entries, show_summary, &categories, flusher); } |