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-2021 VMware, Inc. or its affiliates.  All rights reserved.
6
7defmodule RabbitMQ.CLI.Diagnostics.Commands.ResetNodeAuthAttemptMetricsCommand do
8  alias RabbitMQ.CLI.Core.DocGuide
9  @behaviour RabbitMQ.CLI.CommandBehaviour
10
11  use RabbitMQ.CLI.Core.MergesNoDefaults
12  use RabbitMQ.CLI.Core.AcceptsNoPositionalArguments
13  use RabbitMQ.CLI.Core.RequiresRabbitAppRunning
14
15  def run([], %{node: node_name}) do
16    :rabbit_misc.rpc_call(node_name, :rabbit_core_metrics, :reset_auth_attempt_metrics, [])
17  end
18
19  def usage, do: "reset_node_auth_attempt_metrics"
20
21  def usage_doc_guides() do
22    [
23      DocGuide.access_control(),
24      DocGuide.monitoring()
25    ]
26  end
27
28  def help_section(), do: :configuration
29
30  def description(), do: "Resets auth attempt metrics on the target node"
31
32  def banner([], %{node: node_name}) do
33    "Reset auth attempt metrics on node #{node_name} ..."
34  end
35
36  use RabbitMQ.CLI.DefaultOutput
37end
38