@@ -41,25 +41,83 @@ The following `rabbitmqadmin` v1 features are not currently implemented:
41
41
42
42
## Usage
43
43
44
- ### Getting Help
44
+ ### Interactive vs. Use in Scripts
45
+
46
+ Like the original version, ` rabbitmqadmin ` v2 is first and foremost built for interactive use
47
+ by humans. Many commands will output formatted tables, for example:
48
+
49
+ ``` shell
50
+ rabbitmqadmin show overview
51
+ ```
52
+
53
+ will output a table that looks like this:
54
+
55
+ ```
56
+ ┌──────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────┐
57
+ │ Overview │
58
+ ├──────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤
59
+ │ key │ value │
60
+ ├──────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤
61
+ │ Product name │ RabbitMQ │
62
+ ├──────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤
63
+ │ Product version │ 4.0.5 │
64
+ ├──────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤
65
+ │ RabbitMQ version │ 4.0.5 │
66
+ ├──────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤
67
+ │ Erlang version │ 26.2.5.6 │
68
+ ├──────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤
69
+ │ Erlang details │ Erlang/OTP 26 [erts-14.2.5.5] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] │
70
+ └──────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────┘
71
+ ```
72
+
73
+ As it is easy to observe, parsing such output in a script will be challenging.
74
+
75
+ For this reason, ` rabbitmqadmin ` v2 can render results in a way that would be much more friendly
76
+ for scripting if the ` --non-interactive ` flag is passed. It is a global flag so it must be
77
+ passed before the command and subcommand name:
78
+
79
+ ``` shell
80
+ rabbitmqadmin --non-interactive show overview
81
+ ```
82
+
83
+ The output of the above command will not include any table borders and will is much easier to parse
84
+ as a result:
85
+
86
+ ```
87
+ key
88
+ Product name RabbitMQ
89
+ Product version 4.0.5
90
+ RabbitMQ version 4.0.5
91
+ Erlang version 26.2.5.6
92
+ Erlang details Erlang/OTP 26 [erts-14.2.5.5] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]
93
+ ```
94
+
95
+ ### Exploring the CLI with --help
45
96
46
97
To learn about what command groups and specific commands are available, run
47
98
48
99
``` shell
49
100
rabbitmqadmin --help
50
101
```
51
102
52
- Note that in this version, ** global flags must precede the command category (e.g. ` list ` ) and the command itself ** :
103
+ This flag can be appended to a command or subcommand to get command-specific documentation :
53
104
54
105
``` shell
55
- rabbitmqadmin --vhost " events" declare queue --name " target.quorum.queue.name" --type " quorum" --durable true
106
+ rabbitmqadmin declare queue --help
107
+ # => creates or declares things
108
+ # =>
109
+ # => Usage: rabbitmqadmin declare [object]
110
+ # => ...
56
111
```
57
112
58
- The same command will display global flags. To learn about a specific command, append
59
- ` --help ` to it:
113
+ And with a specific subcommand:
60
114
61
- ``` shell
115
+ ``` shell
62
116
rabbitmqadmin declare queue --help
117
+ # => declares a queue
118
+ # =>
119
+ # => Usage: rabbitmqadmin declare queue [OPTIONS] --name <name>
120
+ # => ...
63
121
```
64
122
65
123
### Retrieving Basic Node Information
@@ -68,6 +126,8 @@ rabbitmqadmin declare queue --help
68
126
rabbitmqadmin show overview
69
127
```
70
128
129
+ will display essential node information in tabular form.
130
+
71
131
### Retrieving Connection, Queue/Stream, Channel Churn Information
72
132
73
133
Helps assess connection, queue/stream, channel [ churn metrics] ( https://www.rabbitmq.com/docs/connections#high-connection-churn ) in the cluster.
0 commit comments