cout << " log rm remove log object\n";
cout << " usage show show usage (by user, date range)\n";
cout << " usage trim trim usage (by user, date range)\n";
+ cout << " usage clear reset all the usage stats for the cluster\n";
cout << " gc list dump expired garbage collection objects (specify\n";
cout << " --include-all to list all entries, including unexpired)\n";
cout << " gc process manually process garbage (specify\n";
OPT_LOG_RM,
OPT_USAGE_SHOW,
OPT_USAGE_TRIM,
+ OPT_USAGE_CLEAR,
OPT_OBJECT_RM,
OPT_OBJECT_UNLINK,
OPT_OBJECT_STAT,
return OPT_USAGE_SHOW;
if (strcmp(cmd, "trim") == 0)
return OPT_USAGE_TRIM;
+ if (strcmp(cmd, "clear") == 0)
+ return OPT_USAGE_CLEAR;
} else if (strcmp(prev_cmd, "caps") == 0) {
if (strcmp(cmd, "add") == 0)
return OPT_CAPS_ADD;
}
}
+ if (opt_cmd == OPT_USAGE_CLEAR) {
+ if (!yes_i_really_mean_it) {
+ cerr << "usage clear would remove *all* users usage data for all time" << std::endl;
+ cerr << "do you really mean it? (requires --yes-i-really-mean-it)" << std::endl;
+ return 1;
+ }
+
+ ret = RGWUsage::clear(store);
+ if (ret < 0) {
+ return ret;
+ }
+ }
+
+
if (opt_cmd == OPT_OLH_GET || opt_cmd == OPT_OLH_READLOG) {
if (bucket_name.empty()) {
cerr << "ERROR: bucket not specified" << std::endl;
log rm remove log object
usage show show usage (by user, date range)
usage trim trim usage (by user, date range)
+ usage clear reset all the usage stats for the cluster
gc list dump expired garbage collection objects (specify
--include-all to list all entries, including unexpired)
gc process manually process garbage (specify