admin cmds
This commit is contained in:
1 parent
5e6e2d6d2e
commit
3dfc2b4832
7 files changed
+403
-69
No files matched your search
@@ -26,6 +26,12 @@ pub enum Command {
|
||||
InitConfig(InitConfigArgs),
|
||||
/// Create a new enroll token for provisioning a router.
|
||||
IssueEnrollToken(IssueEnrollTokenArgs),
|
||||
/// List current enroll tokens and their expiration status.
|
||||
ListEnrollTokens(ListEnrollTokensArgs),
|
||||
/// Revoke a specific enroll token.
|
||||
RevokeEnrollToken(RevokeEnrollTokenArgs),
|
||||
/// Print state backend stats.
|
||||
StateStats(StateStatsArgs),
|
||||
/// Send SIGHUP to an already-running daemon.
|
||||
Reload(ReloadArgs),
|
||||
}
|
||||
@@ -123,6 +129,54 @@ pub struct IssueEnrollTokenArgs {
|
||||
pub ttl_seconds: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
pub struct ListEnrollTokensArgs {
|
||||
#[arg(long, default_value = DEFAULT_CONFIG_FILE)]
|
||||
pub config_file: PathBuf,
|
||||
|
||||
#[arg(long)]
|
||||
pub state_file: Option<PathBuf>,
|
||||
|
||||
#[arg(long)]
|
||||
pub data_dir: Option<PathBuf>,
|
||||
|
||||
#[arg(long)]
|
||||
pub include_expired: bool,
|
||||
|
||||
#[arg(long)]
|
||||
pub json: bool,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
pub struct RevokeEnrollTokenArgs {
|
||||
#[arg(long, default_value = DEFAULT_CONFIG_FILE)]
|
||||
pub config_file: PathBuf,
|
||||
|
||||
#[arg(long)]
|
||||
pub state_file: Option<PathBuf>,
|
||||
|
||||
#[arg(long)]
|
||||
pub data_dir: Option<PathBuf>,
|
||||
|
||||
#[arg(long)]
|
||||
pub token: String,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
pub struct StateStatsArgs {
|
||||
#[arg(long, default_value = DEFAULT_CONFIG_FILE)]
|
||||
pub config_file: PathBuf,
|
||||
|
||||
#[arg(long)]
|
||||
pub state_file: Option<PathBuf>,
|
||||
|
||||
#[arg(long)]
|
||||
pub data_dir: Option<PathBuf>,
|
||||
|
||||
#[arg(long)]
|
||||
pub json: bool,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
pub struct ReloadArgs {
|
||||
#[arg(long, default_value = DEFAULT_PID_FILE)]
|
||||
|
||||
Reference in new issue
Block a user