Skip to content

Commit

Permalink
0.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Feb 2, 2025
1 parent 788b1af commit 2764a47
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 41 deletions.
31 changes: 29 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
# rabbitmqadmin-ng Change Log

## v0.22.0 (in development)
## v0.23.0 (in development

No (documented) changes yet.


## v0.22.0 (Feb 1, 2025)

### Naming

* `tanzu sds enable` was renamed to `tanzu sds enable_on_node`.

This breaking change only applies to a command specific to
Tanzu RabbitMQ 4.1, a series currently in development.

* `tanzu sds disable` was renamed to `tanzu sds disable_on_node`.

This breaking change only applies to a command specific to
Tanzu RabbitMQ 4.1, a series currently in development.

### Enhancements

* `tanzu sds enable_cluster_wide` is a new command that disables SDS on all cluster nodes.

This command is specific to Tanzu RabbitMQ 4.1, a series currently in development.

* `tanzu sds disable_cluster_wide` is a new command that disables SDS on all cluster nodes.

This command is specific to Tanzu RabbitMQ 4.1, a series currently in development.


No (documented) changes yet

## v0.21.0 (Feb 1, 2025)

Expand Down
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ reqwest = { version = "0.12.12", features = [
"__rustls",
"rustls-tls-native-roots"
]}
rabbitmq_http_client = { version = "0.18.0", features = [
rabbitmq_http_client = { version = "0.19.0", features = [
"core",
"blocking",
"tabled"
Expand Down
20 changes: 14 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,16 +552,24 @@ fn dispatch_tanzu_subcommand(
res_handler: &mut ResultHandler,
) -> ExitCode {
match &pair {
("sds", "status") => {
let result = tanzu_commands::sds_status(client, third_level_args);
("sds", "status_on_node") => {
let result = tanzu_commands::sds_status_on_node(client, third_level_args);
res_handler.schema_definition_sync_status_result(result)
}
("sds", "enable") => {
let result = tanzu_commands::sds_enable(client, third_level_args);
("sds", "enable_cluster_wide") => {
let result = tanzu_commands::sds_enable_cluster_wide(client);
res_handler.no_output_on_success(result)
}
("sds", "disable") => {
let result = tanzu_commands::sds_disable(client, third_level_args);
("sds", "disable_cluster_wide") => {
let result = tanzu_commands::sds_disable_cluster_wide(client);
res_handler.no_output_on_success(result)
}
("sds", "enable_on_node") => {
let result = tanzu_commands::sds_enable_on_node(client, third_level_args);
res_handler.no_output_on_success(result)
}
("sds", "disable_on_node") => {
let result = tanzu_commands::sds_disable_on_node(client, third_level_args);
res_handler.no_output_on_success(result)
}
("wsr", "status") => {
Expand Down
22 changes: 17 additions & 5 deletions src/tanzu_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,32 @@ fn sds_group() -> Command {
.subcommands(sds_subcommands())
}

fn sds_subcommands() -> [Command; 3] {
let status_cmd = Command::new("status")
fn sds_subcommands() -> [Command; 5] {
let status_cmd = Command::new("status_on_node")
.long_about("Reports Schema Definition Sync (SDS) status on the given node")
.arg(Arg::new("node").short('n').long("node").required(false));

let disable_cmd = Command::new("disable")
let disable_on_node_cmd = Command::new("disable_on_node")
.long_about("Stops Schema Definition Sync (SDS) on the given node")
.arg(Arg::new("node").short('n').long("node").required(true));

let enable_cmd = Command::new("enable")
let enable_on_node_cmd = Command::new("enable_on_node")
.long_about("Resumes Schema Definition Sync (SDS) on the given node")
.arg(Arg::new("node").short('n').long("node").required(true));

[status_cmd, disable_cmd, enable_cmd]
let disable_cmd = Command::new("disable_cluster_wide")
.long_about("Stops Schema Definition Sync (SDS) on all cluster nodes");

let enable_cmd = Command::new("enable_cluster_wide")
.long_about("Resumes Schema Definition Sync (SDS) on all cluster nodes");

[
status_cmd,
disable_on_node_cmd,
disable_cmd,
enable_on_node_cmd,
enable_cmd,
]
}

fn wsr_subcommands() -> [Command; 1] {
Expand Down
18 changes: 13 additions & 5 deletions src/tanzu_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,30 @@ use clap::ArgMatches;
use rabbitmq_http_client::blocking_api::Result as ClientResult;
use rabbitmq_http_client::responses::{SchemaDefinitionSyncStatus, WarmStandbyReplicationStatus};

pub fn sds_status(
pub fn sds_status_on_node(
client: APIClient,
command_args: &ArgMatches,
) -> ClientResult<SchemaDefinitionSyncStatus> {
let node = command_args.get_one::<String>("node");
client.schema_definition_sync_status(node.map(|s| s.as_str()))
}

pub fn sds_enable(client: APIClient, command_args: &ArgMatches) -> ClientResult<()> {
pub fn sds_enable_cluster_wide(client: APIClient) -> ClientResult<()> {
client.enable_schema_definition_sync()
}

pub fn sds_disable_cluster_wide(client: APIClient) -> ClientResult<()> {
client.disable_schema_definition_sync()
}

pub fn sds_enable_on_node(client: APIClient, command_args: &ArgMatches) -> ClientResult<()> {
let node = command_args.get_one::<String>("node").unwrap();
client.enable_schema_definition_sync(node)
client.enable_schema_definition_sync_on_node(node)
}

pub fn sds_disable(client: APIClient, command_args: &ArgMatches) -> ClientResult<()> {
pub fn sds_disable_on_node(client: APIClient, command_args: &ArgMatches) -> ClientResult<()> {
let node = command_args.get_one::<String>("node").unwrap();
client.disable_schema_definition_sync(node)
client.disable_schema_definition_sync_on_node(node)
}

pub fn wsr_status(client: APIClient) -> ClientResult<WarmStandbyReplicationStatus> {
Expand Down

0 comments on commit 2764a47

Please sign in to comment.