tuwunel_admin/query/storage/mod.rs
1mod configs;
2mod copy;
3mod debug;
4mod delete;
5mod differences;
6mod duplicates;
7mod list;
8mod r#move;
9mod providers;
10mod show;
11mod sync;
12
13use tuwunel_core::Result;
14
15use crate::admin_command_dispatch;
16
17#[admin_command_dispatch(handler_prefix = "query_storage")]
18#[derive(Debug, clap::Subcommand)]
19pub(crate) enum StorageCommand {
20 /// List provider configurations.
21 Configs,
22
23 /// List provider instances.
24 Providers,
25
26 Debug {
27 /// Use configured provider by name.
28 provider: String,
29 },
30
31 /// Show metadata for an object.
32 Show {
33 /// Use configured provider by name.
34 #[arg(short, long)]
35 provider: Option<String>,
36
37 /// Path to the object.
38 src: String,
39 },
40
41 /// List metadata for all objects.
42 List {
43 /// Use configured provider by name.
44 #[arg(short, long)]
45 provider: Option<String>,
46
47 /// Optionally filter by matching prefix.
48 prefix: Option<String>,
49 },
50
51 /// List objects duplicated between two providers
52 Duplicates {
53 /// The first provider name.
54 src: String,
55
56 /// The second provider name.
57 dst: String,
58 },
59
60 /// List objects duplicated between two providers
61 Differences {
62 /// The first provider name.
63 src: String,
64
65 /// The second provider name.
66 dst: String,
67 },
68
69 /// Copy an object from a source to a destination.
70 Copy {
71 /// Use configured provider by name.
72 #[arg(short, long)]
73 provider: Option<String>,
74
75 /// Overwrite existing destination.
76 #[arg(short, long)]
77 force: bool,
78
79 /// Path to the source.
80 src: String,
81
82 /// Path to the destination.
83 dst: String,
84 },
85
86 /// Move an object from a source to a destination.
87 Move {
88 /// Use configured provider by name.
89 #[arg(short, long)]
90 provider: Option<String>,
91
92 /// Overwrite existing destination.
93 #[arg(short, long)]
94 force: bool,
95
96 /// Path to the source.
97 src: String,
98
99 /// Path to the destination.
100 dst: String,
101 },
102
103 /// Delete an object at the specified location.
104 Delete {
105 /// Use configured provider by name.
106 #[arg(short, long)]
107 provider: Option<String>,
108
109 /// Path to the location to delete. Multiple arguments allowed.
110 src: Vec<String>,
111
112 /// Report successful results in addition to failures.
113 #[arg(short, long)]
114 verbose: bool,
115 },
116
117 /// Transfer objects from a source provider which do not exist on a
118 /// destination provider.
119 Sync {
120 /// Use source configured provider by name.
121 src: String,
122
123 /// Use destination configured provider by name.
124 dst: String,
125 },
126}