From 6bc32b20086c7cecd58b439b6b7d819b63fdcb73 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 26 Nov 2012 14:56:18 -0800 Subject: [PATCH] rgw: usage REST api handles cateogories Fixes: #3528 The usage REST api was missing the categories filter. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_rest_usage.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/rgw/rgw_rest_usage.cc b/src/rgw/rgw_rest_usage.cc index 428744538e58..e087bcc512c2 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); } -- 2.47.3