Skip to content

Commit 6dd9f82

Browse files
Merge pull request #13245 from rabbitmq/add-cache-cli-to-auth-cache
Add clear cache rabbitmqctl
2 parents 1f9b1ee + dae4967 commit 6dd9f82

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

deps/rabbitmq_auth_backend_cache/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ endef
1919
DEPS = rabbit_common rabbit
2020
TEST_DEPS = rabbitmq_ct_helpers rabbitmq_ct_client_helpers
2121

22+
PLT_APPS += rabbitmqctl
23+
2224
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
2325
DEP_PLUGINS = rabbit_common/mk/rabbitmq-plugin.mk
2426

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
%% This Source Code Form is subject to the terms of the Mozilla Public
2+
%% License, v. 2.0. If a copy of the MPL was not distributed with this
3+
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
%%
5+
%% Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
6+
%%
7+
8+
-module('Elixir.RabbitMQ.CLI.Ctl.Commands.ClearAuthBackendCacheCommand').
9+
10+
-behaviour('Elixir.RabbitMQ.CLI.CommandBehaviour').
11+
12+
-export([
13+
usage/0,
14+
usage_additional/0,
15+
usage_doc_guides/0,
16+
flags/0,
17+
validate/2,
18+
merge_defaults/2,
19+
banner/2,
20+
run/2,
21+
switches/0,
22+
aliases/0,
23+
output/2,
24+
scopes/0,
25+
formatter/0,
26+
help_section/0,
27+
description/0
28+
]).
29+
30+
31+
%%----------------------------------------------------------------------------
32+
%% Callbacks
33+
%%----------------------------------------------------------------------------
34+
scopes() ->
35+
[vmware, ctl].
36+
37+
switches() ->
38+
[].
39+
40+
usage() ->
41+
<<"clear_auth_backend_cache">>.
42+
43+
usage_additional() ->
44+
[].
45+
46+
usage_doc_guides() ->
47+
[].
48+
49+
help_section() ->
50+
{plugin, rabbitmq_auth_backend_cache}.
51+
52+
description() ->
53+
<<"Clears rabbitmq_auth_backend_cache plugin's cache on the target node">>.
54+
55+
flags() ->
56+
[].
57+
58+
validate(_, _) ->
59+
ok.
60+
61+
formatter() ->
62+
'Elixir.RabbitMQ.CLI.Formatters.Table'.
63+
64+
merge_defaults(A, O) ->
65+
{A, O}.
66+
67+
banner(_, _) ->
68+
<<"Will clear rabbitmq_auth_backend_cache plugin's cache on the target node...">>.
69+
70+
run(_Args, #{node := Node}) ->
71+
case rabbit_misc:rpc_call(Node, rabbit_auth_backend_cache, clear_cache_cluster_wide, []) of
72+
{badrpc, _} = Error ->
73+
Error;
74+
Deleted ->
75+
Deleted
76+
end.
77+
78+
aliases() ->
79+
[].
80+
81+
output(Value, _Opts) ->
82+
'Elixir.RabbitMQ.CLI.DefaultOutput':output(Value).
83+

0 commit comments

Comments
 (0)