File tree Expand file tree Collapse file tree 5 files changed +44
-2
lines changed Expand file tree Collapse file tree 5 files changed +44
-2
lines changed Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ pub fn parser() -> Command {
253
253
] )
254
254
}
255
255
256
- fn list_subcommands ( ) -> [ Command ; 17 ] {
256
+ fn list_subcommands ( ) -> [ Command ; 18 ] {
257
257
// duplicate this very common global argument so that
258
258
// it can be passed as the end of argument list
259
259
let vhost_arg = Arg :: new ( "vhost" )
@@ -360,6 +360,12 @@ fn list_subcommands() -> [Command; 17] {
360
360
"<bold>Doc guide</bold>: {}" ,
361
361
USER_LIMIT_GUIDE_URL
362
362
) ) ,
363
+ Command :: new ( "feature_flags" )
364
+ . long_about ( "Lists feature flags and their cluster state" )
365
+ . after_long_help ( color_print:: cformat!(
366
+ "<bold>Doc guide</bold>: {}" ,
367
+ FEATURE_FLAG_GUIDE_URL
368
+ ) ) ,
363
369
Command :: new ( "deprecated_features" )
364
370
. long_about ( "Lists all deprecated features" )
365
371
. after_long_help ( color_print:: cformat!(
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ use rabbitmq_http_client::requests::EnforcedLimitParams;
28
28
use crate :: constants:: DEFAULT_QUEUE_TYPE ;
29
29
use rabbitmq_http_client:: commons:: BindingDestinationType ;
30
30
use rabbitmq_http_client:: commons:: QueueType ;
31
- use rabbitmq_http_client:: responses:: Overview ;
31
+ use rabbitmq_http_client:: responses:: { FeatureFlagList , Overview } ;
32
32
use rabbitmq_http_client:: { password_hashing, requests, responses} ;
33
33
34
34
type APIClient < ' a > = Client < & ' a str , & ' a str , & ' a str > ;
@@ -122,6 +122,10 @@ pub fn list_parameters(
122
122
}
123
123
}
124
124
125
+ pub fn list_feature_flags ( client : APIClient ) -> ClientResult < FeatureFlagList > {
126
+ client. list_feature_flags ( )
127
+ }
128
+
125
129
pub fn list_deprecated_features (
126
130
client : APIClient ,
127
131
) -> ClientResult < responses:: DeprecatedFeatureList > {
Original file line number Diff line number Diff line change @@ -232,6 +232,10 @@ fn dispatch_subcommand(
232
232
let result = commands:: list_exchanges ( client, & vhost) ;
233
233
res_handler. tabular_result ( result)
234
234
}
235
+ ( "list" , "feature_flags" ) => {
236
+ let result = commands:: list_feature_flags ( client) ;
237
+ res_handler. tabular_result ( result. map ( |val| val. 0 ) )
238
+ }
235
239
( "list" , "deprecated_features" ) => {
236
240
let result = commands:: list_deprecated_features ( client) ;
237
241
res_handler. tabular_result ( result. map ( |val| val. 0 ) )
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ pub(crate) const BLUE_GREEN_UPGRADE_GUIDE_URL: &str =
34
34
pub ( crate ) const MONITORING_GUIDE_URL : & str = "https://rabbitmq.com/docs/monitoring" ;
35
35
pub ( crate ) const HEALTH_CHECK_GUIDE_URL : & str =
36
36
"https://rabbitmq.com/docs/monitoring#health-checks" ;
37
+ pub ( crate ) const FEATURE_FLAG_GUIDE_URL : & str = "https://rabbitmq.com/docs/feature-flags" ;
37
38
pub ( crate ) const DEPRECATED_FEATURE_GUIDE_URL : & str =
38
39
"https://rabbitmq.com/docs/deprecated-features" ;
39
40
pub ( crate ) const ACCESS_CONTROL_GUIDE_URL : & str = "https://rabbitmq.com/docs/access-control" ;
Original file line number Diff line number Diff line change
1
+ // Copyright (C) 2023-2024 RabbitMQ Core Team ([email protected] )
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ use predicates:: prelude:: * ;
16
+
17
+ mod test_helpers;
18
+ use crate :: test_helpers:: * ;
19
+
20
+ #[ test]
21
+ fn test_list_feature_flags ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
22
+ run_succeeds ( [ "list" , "feature_flags" ] ) . stdout (
23
+ predicate:: str:: contains ( "rabbitmq_4.0.0" ) . and ( predicate:: str:: contains ( "khepri_db" ) ) ,
24
+ ) ;
25
+
26
+ Ok ( ( ) )
27
+ }
You can’t perform that action at this time.
0 commit comments