]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/notification: Filter topic list based on uid on radosgw-admin 53073/head
authorkchheda3 <kchheda3@bloomberg.net>
Mon, 21 Aug 2023 18:42:07 +0000 (00:12 +0530)
committerkchheda3 <kchheda3@bloomberg.net>
Tue, 5 Sep 2023 14:22:54 +0000 (10:22 -0400)
Signed-off-by: kchheda3 <kchheda3@bloomberg.net>
doc/radosgw/notifications.rst
src/rgw/rgw_admin.cc

index 1cc538432f3dce16d2ffd241c8d6e53250b5e3ee..7f660dd76a3f176817ed8f34ee5b85a52d60b042 100644 (file)
@@ -76,7 +76,7 @@ following command:
 
 .. prompt:: bash #
 
-   radosgw-admin topic list [--tenant={tenant}]
+   radosgw-admin topic list [--tenant={tenant}]  [--uid={user}]
 
 
 Fetch the configuration of a specific topic by running the following command:
index 15bdaba87a56e0b201ad24f113bc6725f2f1b450..e47a3b1d470a2f0723da1e07022c351e650cfba2 100644 (file)
@@ -10511,6 +10511,16 @@ next:
       cerr << "ERROR: could not get topics: " << cpp_strerror(-ret) << std::endl;
       return -ret;
     }
+    if (!rgw::sal::User::empty(user)) {
+      for (auto it = result.topics.cbegin(); it != result.topics.cend();) {
+        const auto& topic = it->second;
+        if (user->get_id() != topic.user) {
+          result.topics.erase(it++);
+        } else {
+          ++it;
+        }
+      }
+    }
     encode_json("result", result, formatter.get());
     formatter->flush(cout);
   }