Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ All notable changes to this project will be documented in this file.

## Unreleased

- cli: `config set` accepts `--geo-program-id`; `config get` and `config set` print Geolocation Program ID
- cli: `doublezero geolocation probe ...` mirrors `doublezero-geolocation probe ...`; new `--geo-program-id` global flag
- CLI
- cli: `doublezero geolocation` `probe ...` and `user ...` mirrors `doublezero-geolocation` versions; new `--geo-program-id` global flag, `config get/set` include Geolocation Program ID.
- Drop the activator-only pollers from `doublezero` (user and multicastgroup activation waits). The `--wait` flag on `user create`, `user create-subscribe`, `user subscribe`, `multicastgroup create`, and `multicastgroup update` now fetches the post-create state once instead of polling — creates are atomic to `Activated` post-RFC-11, so the wait loop was watching a transition that no longer happens ([#3614](https://github.com/malbeclabs/doublezero/issues/3614))
- Trim the `Rejected` status arm from the device and link activation pollers; `Rejected` was itself an activator-driven transition ([#3614](https://github.com/malbeclabs/doublezero/issues/3614))
- Client
Expand Down
4 changes: 4 additions & 0 deletions client/doublezero/src/cli/geolocation/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use clap::{Args, Subcommand};

pub mod probe;
pub mod user;

use probe::ProbeCliCommand;
use user::UserCliCommand;

#[derive(Args, Debug)]
pub struct GeolocationCliCommand {
Expand All @@ -14,4 +16,6 @@ pub struct GeolocationCliCommand {
pub enum GeolocationCommands {
/// Manage geolocation probes
Probe(ProbeCliCommand),
/// Manage geolocation users and targets
User(UserCliCommand),
}
36 changes: 36 additions & 0 deletions client/doublezero/src/cli/geolocation/user.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
use clap::{Args, Subcommand};
use doublezero_cli::geolocation::user::{
add_target::AddTargetCliCommand, create::CreateGeolocationUserCliCommand,
delete::DeleteGeolocationUserCliCommand, get::GetGeolocationUserCliCommand,
list::ListGeolocationUserCliCommand, remove_target::RemoveTargetCliCommand,
set_result_destination::SetResultDestinationCliCommand,
update::UpdateGeolocationUserCliCommand, update_payment_status::UpdatePaymentStatusCliCommand,
};

#[derive(Args, Debug)]
pub struct UserCliCommand {
#[command(subcommand)]
pub command: UserCommands,
}

#[derive(Subcommand, Debug)]
pub enum UserCommands {
/// Create a new geolocation user
Create(CreateGeolocationUserCliCommand),
/// Delete a geolocation user
Delete(DeleteGeolocationUserCliCommand),
/// Update a geolocation user's payment token account
Update(UpdateGeolocationUserCliCommand),
/// Get details of a specific user
Get(GetGeolocationUserCliCommand),
/// List all geolocation users
List(ListGeolocationUserCliCommand),
/// Add a target to a user
AddTarget(AddTargetCliCommand),
/// Remove a target from a user
RemoveTarget(RemoveTargetCliCommand),
/// Set result destination for geolocation results
SetResultDestination(SetResultDestinationCliCommand),
/// Update payment status (foundation-only)
UpdatePayment(UpdatePaymentStatusCliCommand),
}
17 changes: 16 additions & 1 deletion client/doublezero/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ use crate::cli::{
config::ConfigCommands,
device::{DeviceCommands, InterfaceCommands},
exchange::ExchangeCommands,
geolocation::{probe::ProbeCommands, GeolocationCommands},
geolocation::{
probe::ProbeCommands, user::UserCommands as GeoUserCommands, GeolocationCommands,
},
globalconfig::{
AirdropCommands, AuthorityCommands, FeatureFlagsCommands, FoundationAllowlistCommands,
GlobalConfigCommands, QaAllowlistCommands,
Expand Down Expand Up @@ -373,6 +375,19 @@ async fn main() -> eyre::Result<()> {
ProbeCommands::AddParent(args) => args.execute(&geo_cli, &mut handle),
ProbeCommands::RemoveParent(args) => args.execute(&geo_cli, &mut handle),
},
GeolocationCommands::User(command) => match command.command {
GeoUserCommands::Create(args) => args.execute(&geo_cli, &mut handle),
GeoUserCommands::Delete(args) => args.execute(&geo_cli, &mut handle),
GeoUserCommands::Update(args) => args.execute(&geo_cli, &mut handle),
GeoUserCommands::Get(args) => args.execute(&geo_cli, &mut handle),
GeoUserCommands::List(args) => args.execute(&geo_cli, &mut handle),
GeoUserCommands::AddTarget(args) => args.execute(&geo_cli, &mut handle),
GeoUserCommands::RemoveTarget(args) => args.execute(&geo_cli, &mut handle),
GeoUserCommands::SetResultDestination(args) => {
args.execute(&geo_cli, &mut handle)
}
GeoUserCommands::UpdatePayment(args) => args.execute(&geo_cli, &mut handle),
},
}
}

Expand Down
Loading