From 141a1242bbcf7df8ec6de181b4a3f9b40d0d21ca Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Wed, 16 Aug 2023 14:15:17 -0400 Subject: [PATCH] rgw: add versioning status during `radosgw-admin bucket stats` We received an RFE to including versioning informatio during the bucket stats op. So in the produced JSON, under "versioning", it will specify "off", "enabled", or "suspended". Signed-off-by: J. Eric Ivancich (cherry picked from commit ea2d7ff92aa23cdd5b7ede41fc6e7ce54d8c0e3b) --- src/rgw/driver/rados/rgw_bucket.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rgw/driver/rados/rgw_bucket.cc b/src/rgw/driver/rados/rgw_bucket.cc index d2b4a6b34b2dc..bfc236e390f2f 100644 --- a/src/rgw/driver/rados/rgw_bucket.cc +++ b/src/rgw/driver/rados/rgw_bucket.cc @@ -1327,6 +1327,7 @@ static int bucket_stats(rgw::sal::Driver* driver, formatter->dump_int("num_shards", bucket->get_info().layout.current_index.layout.normal.num_shards); formatter->dump_string("tenant", bucket->get_tenant()); + formatter->dump_string("versioning", bucket->versioned() ? (bucket->versioning_enabled() ? "enabled" : "suspended") : "off"); formatter->dump_string("zonegroup", bucket->get_info().zonegroup); formatter->dump_string("placement_rule", bucket->get_info().placement_rule.to_str()); ::encode_json("explicit_placement", bucket->get_key().explicit_placement, formatter); -- 2.39.5