From: Yehuda Sadeh Date: Mon, 26 Nov 2012 22:56:18 +0000 (-0800) Subject: rgw: usage REST api handles cateogories X-Git-Tag: v0.55~45 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6bc32b20086c7cecd58b439b6b7d819b63fdcb73;p=ceph.git rgw: usage REST api handles cateogories Fixes: #3528 The usage REST api was missing the categories filter. Signed-off-by: Yehuda Sadeh --- 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 cat_list; + list::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); }