]>
Commit | Line | Data |
---|---|---|
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- | |
2 | // vim: ts=8 sw=2 smarttab | |
3 | /* | |
4 | * Ceph - scalable distributed file system | |
5 | * | |
6 | * Copyright (C) 2013 Inktank Storage, Inc. | |
7 | * Copyright (C) 2013,2014 Cloudwatt <libre.licensing@cloudwatt.com> | |
8 | * | |
9 | * Author: Loic Dachary <loic@dachary.org> | |
10 | * | |
11 | * This is free software; you can redistribute it and/or | |
12 | * modify it under the terms of the GNU Lesser General Public | |
13 | * License version 2.1, as published by the Free Software | |
14 | * Foundation. See file COPYING. | |
15 | * | |
16 | */ | |
17 | ||
18 | /* no guard; may be included multiple times */ | |
19 | ||
20 | /* | |
21 | * Define commands that are reported by the monitor's | |
22 | * "get_command_descriptions" command, and parsed by the Python | |
23 | * frontend 'ceph' (and perhaps by other frontends, such as a RESTful | |
24 | * server). The format is: | |
25 | * | |
26 | * COMMAND(signature, helpstring, modulename, req perms, availability) | |
27 | * where: | |
28 | * signature: describes the command and its parameters (more below) | |
29 | * helpstring: displays in CLI help, API help (nice if it refers to | |
30 | * parameter names from signature, 40-a few hundred chars) | |
31 | * modulename: the monitor module or daemon this applies to: | |
32 | * mds, osd, pg (osd), mon, auth, log, config-key, mgr | |
33 | * req perms: required permission in that modulename space to execute command | |
34 | * this also controls what type of REST command is accepted | |
35 | * availability: cli, rest, or both | |
36 | * | |
37 | * The commands describe themselves completely enough for the separate | |
38 | * frontend(s) to be able to accept user input and validate it against | |
39 | * the command descriptions, and generate a JSON object that contains | |
40 | * key:value mappings of parameter names to validated parameter values. | |
41 | * | |
42 | * 'signature' is a space-separated list of individual command descriptors; | |
43 | * each descriptor is either a literal string, which can contain no spaces or | |
44 | * '=' signs (for instance, in "pg stat", both "pg" and "stat" are literal | |
45 | * strings representing one descriptor each), or a list of key=val[,key=val...] | |
46 | * which also includes no spaces. | |
47 | * | |
48 | * The key=val form describes a non-literal parameter. Each will have at | |
49 | * least a name= and type=, and each type can have its own type-specific | |
50 | * parameters. The parser is the arbiter of these types and their | |
51 | * interpretation. A few more non-type-specific key=val pairs exist: | |
52 | * | |
53 | * req=false marks an optional parameter (default for req is 'true') | |
54 | * n=<n> is a repeat count for how many of this argument must be supplied. | |
55 | * n=1 is the default. | |
56 | * n=N is a special case that means "1 or more". | |
57 | * | |
58 | * A perhaps-incomplete list of types: | |
59 | * | |
60 | * CephInt: Optional: range=min[|max] | |
61 | * CephFloat: Optional range | |
62 | * CephString: optional badchars | |
63 | * CephSocketpath: validation involves "is it S_ISSOCK" | |
64 | * CephIPAddr: v4 or v6 addr with optional port, syntax validated | |
65 | * CephEntityAddr: CephIPAddr + optional '/nonce' | |
66 | * CephPoolname: Plainold string | |
67 | * CephObjectname: Another plainold string | |
68 | * CephPgid: n.xxx where n is an int > 0, xxx is a hex number > 0 | |
69 | * CephName: daemon name, '*' or '<type>.<id>' (id must be int for type osd) | |
70 | * CephOsdName: osd name, '*' or '<id> or 'osd.<id>' (id must be int) | |
71 | * CephChoices: strings="foo|bar" means this param can be either | |
72 | * CephFilepath: openable file | |
73 | * CephFragment: cephfs 'fragID': val/bits, val in hex 0xnnn, bits in dec | |
74 | * CephUUID: uuid in text matching Python uuid.UUID() | |
75 | * CephPrefix: special type assigned to literals | |
76 | * | |
77 | * Example: | |
78 | * | |
79 | * COMMAND("auth add " \ | |
80 | * "name=entity,type=CephString " \ | |
81 | * "name=caps,type=CephString,n=N,req=false", \ | |
82 | * "add auth info for <name> from input file, or random key " \ | |
83 | * "if no input given, and/or any caps specified in the command") | |
84 | * | |
85 | * defines a command "auth add" that takes a required argument "entity" | |
86 | * of type "CephString", and from 1 to N arguments named "caps" of type | |
87 | * CephString, at least one of which is required. The front end will | |
88 | * validate user input against this description. Let's say the user | |
89 | * enters auth add client.admin 'mon rwx' 'osd *'. The result will be a | |
90 | * JSON object like {"prefix":"auth add", "entity":"client.admin", | |
91 | * "caps":["mon rwx", "osd *"]}. | |
92 | * Note that | |
93 | * - string literals are accumulated into 'prefix' | |
94 | * - n=1 descriptors are given normal string or int object values | |
95 | * - n=N descriptors are given array values | |
96 | * | |
97 | * NOTE: be careful with spaces. Each descriptor must be separated by | |
98 | * one space, no other characters, so if you split lines as above, be | |
99 | * sure to close and reopen the quotes, and be careful to include the ' | |
100 | * separating spaces in the quoted string. | |
101 | * | |
102 | * The monitor marshals this JSON into a std::map<string, cmd_vartype> | |
103 | * where cmd_vartype is a boost::variant type-enforcing discriminated | |
104 | * type, so the monitor is expected to know the type of each argument. | |
105 | * See cmdparse.cc/h for more details. | |
106 | * | |
107 | * The flag parameter for COMMAND_WITH_FLAGS macro must be passed using | |
108 | * FLAG(f), where 'f' may be one of the following: | |
109 | * | |
110 | * NONE - no flag assigned | |
111 | * NOFORWARD - command may not be forwarded | |
112 | * OBSOLETE - command is considered obsolete | |
113 | * DEPRECATED - command is considered deprecated | |
114 | * MGR - command goes to ceph-mgr (for luminous+) | |
115 | * | |
116 | * A command should always be first considered DEPRECATED before being | |
117 | * considered OBSOLETE, giving due consideration to users and conforming | |
118 | * to any guidelines regarding deprecating commands. | |
119 | */ | |
120 | ||
121 | /* | |
122 | * pg commands PGMonitor.cc | |
123 | */ | |
124 | ||
125 | // note: this should be replaced shortly! | |
126 | COMMAND_WITH_FLAG("pg force_create_pg name=pgid,type=CephPgid", \ | |
127 | "force creation of pg <pgid>", "pg", "rw", "cli,rest", | |
128 | FLAG(DEPRECATED)) | |
129 | COMMAND_WITH_FLAG("pg set_full_ratio name=ratio,type=CephFloat,range=0.0|1.0", \ | |
130 | "set ratio at which pgs are considered full", \ | |
131 | "pg", "rw", "cli,rest", FLAG(DEPRECATED)) | |
132 | COMMAND_WITH_FLAG("pg set_nearfull_ratio " \ | |
133 | "name=ratio,type=CephFloat,range=0.0|1.0", \ | |
134 | "set ratio at which pgs are considered nearly full", \ | |
135 | "pg", "rw", "cli,rest", FLAG(DEPRECATED)) | |
136 | ||
137 | COMMAND("pg map name=pgid,type=CephPgid", "show mapping of pg to osds", \ | |
138 | "pg", "r", "cli,rest") | |
139 | COMMAND("osd last-stat-seq name=id,type=CephOsdName", \ | |
140 | "get the last pg stats sequence number reported for this osd", \ | |
141 | "osd", "r", "cli,rest") | |
142 | ||
143 | /* | |
144 | * auth commands AuthMonitor.cc | |
145 | */ | |
146 | ||
147 | COMMAND("auth export name=entity,type=CephString,req=false", \ | |
148 | "write keyring for requested entity, or master keyring if none given", \ | |
149 | "auth", "rx", "cli,rest") | |
150 | COMMAND("auth get name=entity,type=CephString", \ | |
151 | "write keyring file with requested key", "auth", "rx", "cli,rest") | |
152 | COMMAND("auth get-key name=entity,type=CephString", "display requested key", \ | |
153 | "auth", "rx", "cli,rest") | |
154 | COMMAND("auth print-key name=entity,type=CephString", "display requested key", \ | |
155 | "auth", "rx", "cli,rest") | |
156 | COMMAND("auth print_key name=entity,type=CephString", "display requested key", \ | |
157 | "auth", "rx", "cli,rest") | |
158 | COMMAND_WITH_FLAG("auth list", "list authentication state", "auth", "rx", "cli,rest", | |
159 | FLAG(DEPRECATED)) | |
160 | COMMAND("auth ls", "list authentication state", "auth", "rx", "cli,rest") | |
161 | COMMAND("auth import", "auth import: read keyring file from -i <file>", \ | |
162 | "auth", "rwx", "cli,rest") | |
163 | COMMAND("auth add " \ | |
164 | "name=entity,type=CephString " \ | |
165 | "name=caps,type=CephString,n=N,req=false", \ | |
166 | "add auth info for <entity> from input file, or random key if no " \ | |
167 | "input is given, and/or any caps specified in the command", | |
168 | "auth", "rwx", "cli,rest") | |
169 | COMMAND("auth get-or-create-key " \ | |
170 | "name=entity,type=CephString " \ | |
171 | "name=caps,type=CephString,n=N,req=false", \ | |
172 | "get, or add, key for <name> from system/caps pairs specified in the command. If key already exists, any given caps must match the existing caps for that key.", \ | |
173 | "auth", "rwx", "cli,rest") | |
174 | COMMAND("auth get-or-create " \ | |
175 | "name=entity,type=CephString " \ | |
176 | "name=caps,type=CephString,n=N,req=false", \ | |
177 | "add auth info for <entity> from input file, or random key if no input given, and/or any caps specified in the command", \ | |
178 | "auth", "rwx", "cli,rest") | |
179 | COMMAND("fs authorize " \ | |
180 | "name=filesystem,type=CephString " \ | |
181 | "name=entity,type=CephString " \ | |
182 | "name=caps,type=CephString,n=N", \ | |
183 | "add auth for <entity> to access file system <filesystem> based on following directory and permissions pairs", \ | |
184 | "auth", "rwx", "cli,rest") | |
185 | COMMAND("auth caps " \ | |
186 | "name=entity,type=CephString " \ | |
187 | "name=caps,type=CephString,n=N", \ | |
188 | "update caps for <name> from caps specified in the command", \ | |
189 | "auth", "rwx", "cli,rest") | |
190 | COMMAND("auth del " \ | |
191 | "name=entity,type=CephString", \ | |
192 | "delete all caps for <name>", \ | |
193 | "auth", "rwx", "cli,rest") | |
194 | COMMAND("auth rm " \ | |
195 | "name=entity,type=CephString", \ | |
196 | "remove all caps for <name>", \ | |
197 | "auth", "rwx", "cli,rest") | |
198 | ||
199 | /* | |
200 | * Monitor commands (Monitor.cc) | |
201 | */ | |
202 | COMMAND_WITH_FLAG("compact", "cause compaction of monitor's leveldb storage", \ | |
203 | "mon", "rw", "cli,rest", \ | |
204 | FLAG(NOFORWARD)|FLAG(DEPRECATED)) | |
205 | COMMAND_WITH_FLAG("scrub", "scrub the monitor stores", \ | |
206 | "mon", "rw", "cli,rest", \ | |
207 | FLAG(DEPRECATED)) | |
208 | COMMAND("fsid", "show cluster FSID/UUID", "mon", "r", "cli,rest") | |
209 | COMMAND("log name=logtext,type=CephString,n=N", \ | |
210 | "log supplied text to the monitor log", "mon", "rw", "cli,rest") | |
211 | COMMAND("log last " | |
212 | "name=num,type=CephInt,range=1,req=false " | |
213 | "name=level,type=CephChoices,strings=debug|info|sec|warn|error,req=false " | |
214 | "name=channel,type=CephChoices,strings=*|cluster|audit,req=false", \ | |
215 | "print last few lines of the cluster log", \ | |
216 | "mon", "r", "cli,rest") | |
217 | COMMAND_WITH_FLAG("injectargs " \ | |
218 | "name=injected_args,type=CephString,n=N", \ | |
219 | "inject config arguments into monitor", "mon", "rw", "cli,rest", | |
220 | FLAG(NOFORWARD)) | |
221 | COMMAND("config set " \ | |
222 | "name=key,type=CephString name=value,type=CephString", | |
223 | "Set a configuration option at runtime (not persistent)", | |
224 | "mon", "rw", "cli,rest") | |
225 | COMMAND("status", "show cluster status", "mon", "r", "cli,rest") | |
226 | COMMAND("health name=detail,type=CephChoices,strings=detail,req=false", \ | |
227 | "show cluster health", "mon", "r", "cli,rest") | |
228 | COMMAND("time-sync-status", "show time sync status", "mon", "r", "cli,rest") | |
229 | COMMAND("df name=detail,type=CephChoices,strings=detail,req=false", \ | |
230 | "show cluster free space stats", "mon", "r", "cli,rest") | |
231 | COMMAND("report name=tags,type=CephString,n=N,req=false", \ | |
232 | "report full status of cluster, optional title tag strings", \ | |
233 | "mon", "r", "cli,rest") | |
234 | COMMAND("features", "report of connected features", \ | |
235 | "mon", "r", "cli,rest") | |
236 | COMMAND("quorum_status", "report status of monitor quorum", \ | |
237 | "mon", "r", "cli,rest") | |
238 | ||
239 | COMMAND_WITH_FLAG("mon_status", "report status of monitors", "mon", "r", "cli,rest", | |
240 | FLAG(NOFORWARD)) | |
241 | COMMAND_WITH_FLAG("sync force " \ | |
242 | "name=validate1,type=CephChoices,strings=--yes-i-really-mean-it,req=false " \ | |
243 | "name=validate2,type=CephChoices,strings=--i-know-what-i-am-doing,req=false", \ | |
244 | "force sync of and clear monitor store", \ | |
245 | "mon", "rw", "cli,rest", \ | |
246 | FLAG(NOFORWARD)|FLAG(DEPRECATED)) | |
247 | COMMAND_WITH_FLAG("heap " \ | |
248 | "name=heapcmd,type=CephChoices,strings=dump|start_profiler|stop_profiler|release|stats", \ | |
249 | "show heap usage info (available only if compiled with tcmalloc)", \ | |
250 | "mon", "rw", "cli,rest", FLAG(NOFORWARD)) | |
251 | COMMAND("quorum name=quorumcmd,type=CephChoices,strings=enter|exit,n=1", \ | |
252 | "enter or exit quorum", "mon", "rw", "cli,rest") | |
253 | COMMAND("tell " \ | |
254 | "name=target,type=CephName " \ | |
255 | "name=args,type=CephString,n=N", \ | |
256 | "send a command to a specific daemon", "mon", "rw", "cli,rest") | |
257 | COMMAND_WITH_FLAG("version", "show mon daemon version", "mon", "r", "cli,rest", | |
258 | FLAG(NOFORWARD)) | |
259 | ||
260 | COMMAND("node ls " \ | |
261 | "name=type,type=CephChoices,strings=all|osd|mon|mds,req=false", | |
262 | "list all nodes in cluster [type]", "mon", "r", "cli,rest") | |
263 | /* | |
264 | * Monitor-specific commands under module 'mon' | |
265 | */ | |
266 | COMMAND_WITH_FLAG("mon compact", \ | |
267 | "cause compaction of monitor's leveldb storage", \ | |
268 | "mon", "rw", "cli,rest", \ | |
269 | FLAG(NOFORWARD)) | |
270 | COMMAND_WITH_FLAG("mon scrub", | |
271 | "scrub the monitor stores", \ | |
272 | "mon", "rw", "cli,rest", \ | |
273 | FLAG(NONE)) | |
274 | COMMAND_WITH_FLAG("mon sync force " \ | |
275 | "name=validate1,type=CephChoices,strings=--yes-i-really-mean-it,req=false " \ | |
276 | "name=validate2,type=CephChoices,strings=--i-know-what-i-am-doing,req=false", \ | |
277 | "force sync of and clear monitor store", \ | |
278 | "mon", "rw", "cli,rest", \ | |
279 | FLAG(NOFORWARD)) | |
280 | COMMAND("mon metadata name=id,type=CephString,req=false", | |
281 | "fetch metadata for mon <id>", | |
282 | "mon", "r", "cli,rest") | |
283 | COMMAND("mon count-metadata name=property,type=CephString", | |
284 | "count mons by metadata field property", | |
285 | "mon", "r", "cli,rest") | |
286 | COMMAND("mon versions", | |
287 | "check running versions of monitors", | |
288 | "mon", "r", "cli,rest") | |
289 | COMMAND("versions", | |
290 | "check running versions of ceph daemons", | |
291 | "mon", "r", "cli,rest") | |
292 | ||
293 | ||
294 | ||
295 | /* | |
296 | * MDS commands (MDSMonitor.cc) | |
297 | */ | |
298 | ||
299 | COMMAND("mds stat", "show MDS status", "mds", "r", "cli,rest") | |
300 | COMMAND_WITH_FLAG("mds dump " | |
301 | "name=epoch,type=CephInt,req=false,range=0", \ | |
302 | "dump legacy MDS cluster info, optionally from epoch", | |
303 | "mds", "r", "cli,rest", FLAG(DEPRECATED)) | |
304 | COMMAND("fs dump " | |
305 | "name=epoch,type=CephInt,req=false,range=0", \ | |
306 | "dump all CephFS status, optionally from epoch", "mds", "r", "cli,rest") | |
307 | COMMAND_WITH_FLAG("mds getmap " \ | |
308 | "name=epoch,type=CephInt,req=false,range=0", \ | |
309 | "get MDS map, optionally from epoch", "mds", "r", "cli,rest", FLAG(DEPRECATED)) | |
310 | COMMAND("mds metadata name=who,type=CephString,req=false", | |
311 | "fetch metadata for mds <who>", | |
312 | "mds", "r", "cli,rest") | |
313 | COMMAND("mds count-metadata name=property,type=CephString", | |
314 | "count MDSs by metadata field property", | |
315 | "mds", "r", "cli,rest") | |
316 | COMMAND("mds versions", | |
317 | "check running versions of MDSs", | |
318 | "mds", "r", "cli,rest") | |
319 | COMMAND_WITH_FLAG("mds tell " \ | |
320 | "name=who,type=CephString " \ | |
321 | "name=args,type=CephString,n=N", \ | |
322 | "send command to particular mds", "mds", "rw", "cli,rest", FLAG(OBSOLETE)) | |
323 | COMMAND("mds compat show", "show mds compatibility settings", \ | |
324 | "mds", "r", "cli,rest") | |
325 | COMMAND_WITH_FLAG("mds stop name=who,type=CephString", "stop mds", \ | |
326 | "mds", "rw", "cli,rest", FLAG(DEPRECATED)) | |
327 | COMMAND("mds deactivate name=who,type=CephString", | |
328 | "clean up specified MDS rank (use with `set max_mds` to shrink cluster)", \ | |
329 | "mds", "rw", "cli,rest") | |
330 | COMMAND_WITH_FLAG("mds set_max_mds " \ | |
331 | "name=maxmds,type=CephInt,range=0", \ | |
332 | "set max MDS index", "mds", "rw", "cli,rest", FLAG(DEPRECATED)) | |
333 | COMMAND_WITH_FLAG("mds set " \ | |
334 | "name=var,type=CephChoices,strings=max_mds|max_file_size" | |
335 | "|allow_new_snaps|inline_data|allow_multimds|allow_dirfrags " \ | |
336 | "name=val,type=CephString " \ | |
337 | "name=confirm,type=CephString,req=false", \ | |
338 | "set mds parameter <var> to <val>", "mds", "rw", "cli,rest", FLAG(DEPRECATED)) | |
339 | // arbitrary limit 0-20 below; worth standing on head to make it | |
340 | // relate to actual state definitions? | |
341 | // #include "include/ceph_fs.h" | |
342 | COMMAND("mds set_state " \ | |
343 | "name=gid,type=CephInt,range=0 " \ | |
344 | "name=state,type=CephInt,range=0|20", \ | |
345 | "set mds state of <gid> to <numeric-state>", "mds", "rw", "cli,rest") | |
346 | COMMAND("mds fail name=who,type=CephString", \ | |
347 | "Mark MDS failed: trigger a failover if a standby is available", | |
348 | "mds", "rw", "cli,rest") | |
349 | COMMAND("mds repaired name=rank,type=CephString", \ | |
350 | "mark a damaged MDS rank as no longer damaged", "mds", "rw", "cli,rest") | |
351 | COMMAND("mds rm " \ | |
352 | "name=gid,type=CephInt,range=0", \ | |
353 | "remove nonactive mds", "mds", "rw", "cli,rest") | |
354 | COMMAND("mds rmfailed name=who,type=CephString name=confirm,type=CephString,req=false", \ | |
355 | "remove failed mds", "mds", "rw", "cli,rest") | |
356 | COMMAND_WITH_FLAG("mds cluster_down", "take MDS cluster down", "mds", "rw", "cli,rest", FLAG(DEPRECATED)) | |
357 | COMMAND_WITH_FLAG("mds cluster_up", "bring MDS cluster up", "mds", "rw", "cli,rest", FLAG(DEPRECATED)) | |
358 | COMMAND("mds compat rm_compat " \ | |
359 | "name=feature,type=CephInt,range=0", \ | |
360 | "remove compatible feature", "mds", "rw", "cli,rest") | |
361 | COMMAND("mds compat rm_incompat " \ | |
362 | "name=feature,type=CephInt,range=0", \ | |
363 | "remove incompatible feature", "mds", "rw", "cli,rest") | |
364 | COMMAND_WITH_FLAG("mds add_data_pool " \ | |
365 | "name=pool,type=CephString", \ | |
366 | "add data pool <pool>", "mds", "rw", "cli,rest", FLAG(DEPRECATED)) | |
367 | COMMAND_WITH_FLAG("mds remove_data_pool " \ | |
368 | "name=pool,type=CephString", \ | |
369 | "remove data pool <pool>", "mds", "rw", "cli,rest", FLAG(DEPRECATED)) | |
370 | COMMAND_WITH_FLAG("mds rm_data_pool " \ | |
371 | "name=pool,type=CephString", \ | |
372 | "remove data pool <pool>", "mds", "rw", "cli,rest", FLAG(DEPRECATED)) | |
373 | COMMAND_WITH_FLAG("mds newfs " \ | |
374 | "name=metadata,type=CephInt,range=0 " \ | |
375 | "name=data,type=CephInt,range=0 " \ | |
376 | "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
377 | "make new filesystem using pools <metadata> and <data>", \ | |
378 | "mds", "rw", "cli,rest", FLAG(OBSOLETE)) | |
379 | COMMAND("fs new " \ | |
380 | "name=fs_name,type=CephString " \ | |
381 | "name=metadata,type=CephString " \ | |
382 | "name=data,type=CephString " \ | |
383 | "name=force,type=CephChoices,strings=--force,req=false " \ | |
384 | "name=sure,type=CephChoices,strings=--allow-dangerous-metadata-overlay,req=false", \ | |
385 | "make new filesystem using named pools <metadata> and <data>", \ | |
386 | "fs", "rw", "cli,rest") | |
387 | COMMAND("fs rm " \ | |
388 | "name=fs_name,type=CephString " \ | |
389 | "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
390 | "disable the named filesystem", \ | |
391 | "fs", "rw", "cli,rest") | |
392 | COMMAND("fs reset " \ | |
393 | "name=fs_name,type=CephString " \ | |
394 | "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
395 | "disaster recovery only: reset to a single-MDS map", \ | |
396 | "fs", "rw", "cli,rest") | |
397 | COMMAND("fs ls ", \ | |
398 | "list filesystems", \ | |
399 | "fs", "r", "cli,rest") | |
400 | COMMAND("fs get name=fs_name,type=CephString", \ | |
401 | "get info about one filesystem", \ | |
402 | "fs", "r", "cli,rest") | |
403 | COMMAND("fs set " \ | |
404 | "name=fs_name,type=CephString " \ | |
405 | "name=var,type=CephChoices,strings=max_mds|max_file_size" | |
406 | "|allow_new_snaps|inline_data|cluster_down|allow_multimds|allow_dirfrags|balancer" \ | |
407 | "|standby_count_wanted " \ | |
408 | "name=val,type=CephString " \ | |
409 | "name=confirm,type=CephString,req=false", \ | |
410 | "set mds parameter <var> to <val>", "mds", "rw", "cli,rest") | |
411 | COMMAND("fs flag set name=flag_name,type=CephChoices,strings=enable_multiple " | |
412 | "name=val,type=CephString " \ | |
413 | "name=confirm,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
414 | "Set a global CephFS flag", \ | |
415 | "fs", "rw", "cli,rest") | |
416 | COMMAND("fs add_data_pool name=fs_name,type=CephString " \ | |
417 | "name=pool,type=CephString", \ | |
418 | "add data pool <pool>", "mds", "rw", "cli,rest") | |
419 | COMMAND("fs rm_data_pool name=fs_name,type=CephString " \ | |
420 | "name=pool,type=CephString", \ | |
421 | "remove data pool <pool>", "mds", "rw", "cli,rest") | |
422 | COMMAND_WITH_FLAG("fs set_default name=fs_name,type=CephString", \ | |
423 | "set the default to the named filesystem", \ | |
424 | "fs", "rw", "cli,rest", \ | |
425 | FLAG(DEPRECATED)) | |
426 | COMMAND("fs set-default name=fs_name,type=CephString", \ | |
427 | "set the default to the named filesystem", \ | |
428 | "fs", "rw", "cli,rest") | |
429 | ||
430 | /* | |
431 | * Monmap commands | |
432 | */ | |
433 | COMMAND("mon dump " \ | |
434 | "name=epoch,type=CephInt,range=0,req=false", \ | |
435 | "dump formatted monmap (optionally from epoch)", \ | |
436 | "mon", "r", "cli,rest") | |
437 | COMMAND("mon stat", "summarize monitor status", "mon", "r", "cli,rest") | |
438 | COMMAND("mon getmap " \ | |
439 | "name=epoch,type=CephInt,range=0,req=false", \ | |
440 | "get monmap", "mon", "r", "cli,rest") | |
441 | COMMAND("mon add " \ | |
442 | "name=name,type=CephString " \ | |
443 | "name=addr,type=CephIPAddr", \ | |
444 | "add new monitor named <name> at <addr>", "mon", "rw", "cli,rest") | |
445 | COMMAND("mon remove " \ | |
446 | "name=name,type=CephString", \ | |
447 | "remove monitor named <name>", "mon", "rw", "cli,rest") | |
448 | COMMAND("mon rm " \ | |
449 | "name=name,type=CephString", \ | |
450 | "remove monitor named <name>", "mon", "rw", "cli,rest") | |
451 | COMMAND("mon feature ls " \ | |
452 | "name=with_value,type=CephChoices,strings=--with-value,req=false", \ | |
453 | "list available mon map features to be set/unset", \ | |
454 | "mon", "r", "cli,rest") | |
455 | COMMAND("mon feature set " \ | |
456 | "name=feature_name,type=CephString " \ | |
457 | "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
458 | "set provided feature on mon map", \ | |
459 | "mon", "rw", "cli,rest") | |
460 | ||
461 | /* | |
462 | * OSD commands | |
463 | */ | |
464 | COMMAND("osd stat", "print summary of OSD map", "osd", "r", "cli,rest") | |
465 | COMMAND("osd dump " \ | |
466 | "name=epoch,type=CephInt,range=0,req=false", | |
467 | "print summary of OSD map", "osd", "r", "cli,rest") | |
468 | COMMAND("osd tree " \ | |
469 | "name=epoch,type=CephInt,range=0,req=false " \ | |
470 | "name=states,type=CephChoices,strings=up|down|in|out|destroyed,n=N,req=false", \ | |
471 | "print OSD tree", "osd", "r", "cli,rest") | |
472 | COMMAND("osd ls " \ | |
473 | "name=epoch,type=CephInt,range=0,req=false", \ | |
474 | "show all OSD ids", "osd", "r", "cli,rest") | |
475 | COMMAND("osd getmap " \ | |
476 | "name=epoch,type=CephInt,range=0,req=false", \ | |
477 | "get OSD map", "osd", "r", "cli,rest") | |
478 | COMMAND("osd getcrushmap " \ | |
479 | "name=epoch,type=CephInt,range=0,req=false", \ | |
480 | "get CRUSH map", "osd", "r", "cli,rest") | |
481 | COMMAND("osd getmaxosd", "show largest OSD id", "osd", "r", "cli,rest") | |
482 | COMMAND("osd ls-tree " \ | |
483 | "name=epoch,type=CephInt,range=0,req=false " | |
484 | "name=name,type=CephString,req=true", \ | |
485 | "show OSD ids under bucket <name> in the CRUSH map", \ | |
486 | "osd", "r", "cli,rest") | |
487 | COMMAND("osd find " \ | |
488 | "name=id,type=CephOsdName", \ | |
489 | "find osd <id> in the CRUSH map and show its location", \ | |
490 | "osd", "r", "cli,rest") | |
491 | COMMAND("osd metadata " \ | |
492 | "name=id,type=CephOsdName,req=false", \ | |
493 | "fetch metadata for osd {id} (default all)", \ | |
494 | "osd", "r", "cli,rest") | |
495 | COMMAND("osd count-metadata name=property,type=CephString", | |
496 | "count OSDs by metadata field property", | |
497 | "osd", "r", "cli,rest") | |
498 | COMMAND("osd versions", \ | |
499 | "check running versions of OSDs", | |
500 | "osd", "r", "cli,rest") | |
501 | COMMAND("osd map " \ | |
502 | "name=pool,type=CephPoolname " \ | |
503 | "name=object,type=CephObjectname " \ | |
504 | "name=nspace,type=CephString,req=false", \ | |
505 | "find pg for <object> in <pool> with [namespace]", "osd", "r", "cli,rest") | |
506 | COMMAND("osd lspools " \ | |
507 | "name=auid,type=CephInt,req=false", \ | |
508 | "list pools", "osd", "r", "cli,rest") | |
509 | COMMAND_WITH_FLAG("osd crush rule list", "list crush rules", "osd", "r", "cli,rest", | |
510 | FLAG(DEPRECATED)) | |
511 | COMMAND("osd crush rule ls", "list crush rules", "osd", "r", "cli,rest") | |
512 | COMMAND("osd crush rule dump " \ | |
513 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.],req=false", \ | |
514 | "dump crush rule <name> (default all)", \ | |
515 | "osd", "r", "cli,rest") | |
516 | COMMAND("osd crush dump", \ | |
517 | "dump crush map", \ | |
518 | "osd", "r", "cli,rest") | |
519 | COMMAND("osd setcrushmap name=prior_version,type=CephInt,req=false", \ | |
520 | "set crush map from input file", \ | |
521 | "osd", "rw", "cli,rest") | |
522 | COMMAND("osd crush set name=prior_version,type=CephInt,req=false", \ | |
523 | "set crush map from input file", \ | |
524 | "osd", "rw", "cli,rest") | |
525 | COMMAND("osd crush add-bucket " \ | |
526 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
527 | "name=type,type=CephString", \ | |
528 | "add no-parent (probably root) crush bucket <name> of type <type>", \ | |
529 | "osd", "rw", "cli,rest") | |
530 | COMMAND("osd crush rename-bucket " \ | |
531 | "name=srcname,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
532 | "name=dstname,type=CephString,goodchars=[A-Za-z0-9-_.]", \ | |
533 | "rename bucket <srcname> to <dstname>", \ | |
534 | "osd", "rw", "cli,rest") | |
535 | COMMAND("osd crush set " \ | |
536 | "name=id,type=CephOsdName " \ | |
537 | "name=weight,type=CephFloat,range=0.0 " \ | |
538 | "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]", \ | |
539 | "update crushmap position and weight for <name> to <weight> with location <args>", \ | |
540 | "osd", "rw", "cli,rest") | |
541 | COMMAND("osd crush add " \ | |
542 | "name=id,type=CephOsdName " \ | |
543 | "name=weight,type=CephFloat,range=0.0 " \ | |
544 | "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]", \ | |
545 | "add or update crushmap position and weight for <name> with <weight> and location <args>", \ | |
546 | "osd", "rw", "cli,rest") | |
547 | COMMAND("osd crush set-device-class " \ | |
548 | "name=class,type=CephString " \ | |
549 | "name=ids,type=CephString,n=N", \ | |
550 | "set the <class> of the osd(s) <id> [<id>...]," \ | |
551 | "or use <all|any|*> to set all.", \ | |
552 | "osd", "rw", "cli,rest") | |
553 | COMMAND("osd crush rm-device-class " \ | |
554 | "name=ids,type=CephString,n=N", \ | |
555 | "remove class of the osd(s) <id> [<id>...]," \ | |
556 | "or use <all|any|*> to remove all.", \ | |
557 | "osd", "rw", "cli,rest") | |
558 | COMMAND("osd crush create-or-move " \ | |
559 | "name=id,type=CephOsdName " \ | |
560 | "name=weight,type=CephFloat,range=0.0 " \ | |
561 | "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]", \ | |
562 | "create entry or move existing entry for <name> <weight> at/to location <args>", \ | |
563 | "osd", "rw", "cli,rest") | |
564 | COMMAND("osd crush move " \ | |
565 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
566 | "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]", \ | |
567 | "move existing entry for <name> to location <args>", \ | |
568 | "osd", "rw", "cli,rest") | |
569 | COMMAND("osd crush swap-bucket " \ | |
570 | "name=source,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
571 | "name=dest,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
572 | "name=force,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
573 | "swap existing bucket contents from (orphan) bucket <source> and <target>", \ | |
574 | "osd", "rw", "cli,rest") | |
575 | COMMAND("osd crush link " \ | |
576 | "name=name,type=CephString " \ | |
577 | "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]", \ | |
578 | "link existing entry for <name> under location <args>", \ | |
579 | "osd", "rw", "cli,rest") | |
580 | COMMAND("osd crush rm " \ | |
581 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
582 | "name=ancestor,type=CephString,req=false,goodchars=[A-Za-z0-9-_.]", \ | |
583 | "remove <name> from crush map (everywhere, or just at <ancestor>)",\ | |
584 | "osd", "rw", "cli,rest") | |
585 | COMMAND("osd crush remove " \ | |
586 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
587 | "name=ancestor,type=CephString,req=false,goodchars=[A-Za-z0-9-_.]", \ | |
588 | "remove <name> from crush map (everywhere, or just at <ancestor>)", \ | |
589 | "osd", "rw", "cli,rest") | |
590 | COMMAND("osd crush unlink " \ | |
591 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
592 | "name=ancestor,type=CephString,req=false,goodchars=[A-Za-z0-9-_.]", \ | |
593 | "unlink <name> from crush map (everywhere, or just at <ancestor>)", \ | |
594 | "osd", "rw", "cli,rest") | |
595 | COMMAND("osd crush reweight-all", | |
596 | "recalculate the weights for the tree to ensure they sum correctly", | |
597 | "osd", "rw", "cli,rest") | |
598 | COMMAND("osd crush reweight " \ | |
599 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
600 | "name=weight,type=CephFloat,range=0.0", \ | |
601 | "change <name>'s weight to <weight> in crush map", \ | |
602 | "osd", "rw", "cli,rest") | |
603 | COMMAND("osd crush reweight-subtree " \ | |
604 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
605 | "name=weight,type=CephFloat,range=0.0", \ | |
606 | "change all leaf items beneath <name> to <weight> in crush map", \ | |
607 | "osd", "rw", "cli,rest") | |
608 | COMMAND("osd crush tunables " \ | |
609 | "name=profile,type=CephChoices,strings=legacy|argonaut|bobtail|firefly|hammer|jewel|optimal|default", \ | |
610 | "set crush tunables values to <profile>", "osd", "rw", "cli,rest") | |
611 | COMMAND("osd crush set-tunable " \ | |
612 | "name=tunable,type=CephChoices,strings=straw_calc_version " \ | |
613 | "name=value,type=CephInt", | |
614 | "set crush tunable <tunable> to <value>", | |
615 | "osd", "rw", "cli,rest") | |
616 | COMMAND("osd crush get-tunable " \ | |
617 | "name=tunable,type=CephChoices,strings=straw_calc_version", | |
618 | "get crush tunable <tunable>", | |
619 | "osd", "r", "cli,rest") | |
620 | COMMAND("osd crush show-tunables", \ | |
621 | "show current crush tunables", "osd", "r", "cli,rest") | |
622 | COMMAND("osd crush rule create-simple " \ | |
623 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
624 | "name=root,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
625 | "name=type,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
626 | "name=mode,type=CephChoices,strings=firstn|indep,req=false", | |
627 | "create crush rule <name> to start from <root>, replicate across buckets of type <type>, using a choose mode of <firstn|indep> (default firstn; indep best for erasure pools)", \ | |
628 | "osd", "rw", "cli,rest") | |
629 | COMMAND("osd crush rule create-replicated " \ | |
630 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
631 | "name=root,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
632 | "name=type,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
633 | "name=class,type=CephString,goodchars=[A-Za-z0-9-_.],req=false", | |
634 | "create crush rule <name> for replicated pool to start from <root>, replicate across buckets of type <type>, using a choose mode of <firstn|indep> (default firstn; indep best for erasure pools)", \ | |
635 | "osd", "rw", "cli,rest") | |
636 | COMMAND("osd crush rule create-erasure " \ | |
637 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
638 | "name=profile,type=CephString,req=false,goodchars=[A-Za-z0-9-_.=]", \ | |
639 | "create crush rule <name> for erasure coded pool created with <profile> (default default)", \ | |
640 | "osd", "rw", "cli,rest") | |
641 | COMMAND("osd crush rule rm " \ | |
642 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] ", \ | |
643 | "remove crush rule <name>", "osd", "rw", "cli,rest") | |
644 | COMMAND("osd crush tree " | |
645 | "name=shadow,type=CephChoices,strings=--show-shadow,req=false", \ | |
646 | "dump crush buckets and items in a tree view", | |
647 | "osd", "r", "cli,rest") | |
648 | COMMAND("osd crush ls name=node,type=CephString,goodchars=goodchars=[A-Za-z0-9-_.]", | |
649 | "list items beneath a node in the CRUSH tree", | |
650 | "osd", "r", "cli,rest") | |
651 | COMMAND("osd crush class ls", \ | |
652 | "list all crush device classes", \ | |
653 | "osd", "r", "cli,rest") | |
654 | COMMAND("osd crush class ls-osd " \ | |
655 | "name=class,type=CephString,goodchars=[A-Za-z0-9-_]", \ | |
656 | "list all osds belonging to the specific <class>", \ | |
657 | "osd", "r", "cli,rest") | |
658 | COMMAND("osd crush weight-set ls", | |
659 | "list crush weight sets", | |
660 | "osd", "r", "cli,rest") | |
661 | COMMAND("osd crush weight-set dump", | |
662 | "dump crush weight sets", | |
663 | "osd", "r", "cli,rest") | |
664 | COMMAND("osd crush weight-set create-compat", | |
665 | "create a default backward-compatible weight-set", | |
666 | "osd", "rw", "cli,rest") | |
667 | COMMAND("osd crush weight-set create " \ | |
668 | "name=pool,type=CephPoolname "\ | |
669 | "name=mode,type=CephChoices,strings=flat|positional", | |
670 | "create a weight-set for a given pool", | |
671 | "osd", "rw", "cli,rest") | |
672 | COMMAND("osd crush weight-set rm name=pool,type=CephPoolname", | |
673 | "remove the weight-set for a given pool", | |
674 | "osd", "rw", "cli,rest") | |
675 | COMMAND("osd crush weight-set rm-compat", | |
676 | "remove the backward-compatible weight-set", | |
677 | "osd", "rw", "cli,rest") | |
678 | COMMAND("osd crush weight-set reweight " \ | |
679 | "name=pool,type=CephPoolname " \ | |
680 | "name=item,type=CephString " \ | |
681 | "name=weight,type=CephFloat,range=0.0,n=N", | |
682 | "set weight for an item (bucket or osd) in a pool's weight-set", | |
683 | "osd", "rw", "cli,rest") | |
684 | COMMAND("osd crush weight-set reweight-compat " \ | |
685 | "name=item,type=CephString " \ | |
686 | "name=weight,type=CephFloat,range=0.0,n=N", | |
687 | "set weight for an item (bucket or osd) in the backward-compatible weight-set", | |
688 | "osd", "rw", "cli,rest") | |
689 | COMMAND("osd setmaxosd " \ | |
690 | "name=newmax,type=CephInt,range=0", \ | |
691 | "set new maximum osd value", "osd", "rw", "cli,rest") | |
692 | COMMAND("osd set-full-ratio " \ | |
693 | "name=ratio,type=CephFloat,range=0.0|1.0", \ | |
694 | "set usage ratio at which OSDs are marked full", | |
695 | "osd", "rw", "cli,rest") | |
696 | COMMAND("osd set-backfillfull-ratio " \ | |
697 | "name=ratio,type=CephFloat,range=0.0|1.0", \ | |
698 | "set usage ratio at which OSDs are marked too full to backfill", | |
699 | "osd", "rw", "cli,rest") | |
700 | COMMAND("osd set-nearfull-ratio " \ | |
701 | "name=ratio,type=CephFloat,range=0.0|1.0", \ | |
702 | "set usage ratio at which OSDs are marked near-full", | |
703 | "osd", "rw", "cli,rest") | |
704 | COMMAND("osd set-require-min-compat-client " \ | |
705 | "name=version,type=CephString " \ | |
706 | "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
707 | "set the minimum client version we will maintain compatibility with", | |
708 | "osd", "rw", "cli,rest") | |
709 | COMMAND("osd pause", "pause osd", "osd", "rw", "cli,rest") | |
710 | COMMAND("osd unpause", "unpause osd", "osd", "rw", "cli,rest") | |
711 | COMMAND("osd erasure-code-profile set " \ | |
712 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
713 | "name=profile,type=CephString,n=N,req=false", \ | |
714 | "create erasure code profile <name> with [<key[=value]> ...] pairs. Add a --force at the end to override an existing profile (VERY DANGEROUS)", \ | |
715 | "osd", "rw", "cli,rest") | |
716 | COMMAND("osd erasure-code-profile get " \ | |
717 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.]", \ | |
718 | "get erasure code profile <name>", \ | |
719 | "osd", "r", "cli,rest") | |
720 | COMMAND("osd erasure-code-profile rm " \ | |
721 | "name=name,type=CephString,goodchars=[A-Za-z0-9-_.]", \ | |
722 | "remove erasure code profile <name>", \ | |
723 | "osd", "rw", "cli,rest") | |
724 | COMMAND("osd erasure-code-profile ls", \ | |
725 | "list all erasure code profiles", \ | |
726 | "osd", "r", "cli,rest") | |
727 | COMMAND("osd set " \ | |
728 | "name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent|sortbitwise|recovery_deletes|require_jewel_osds|require_kraken_osds", \ | |
729 | "set <key>", "osd", "rw", "cli,rest") | |
730 | COMMAND("osd unset " \ | |
731 | "name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent", \ | |
732 | "unset <key>", "osd", "rw", "cli,rest") | |
733 | COMMAND("osd require-osd-release "\ | |
734 | "name=release,type=CephChoices,strings=luminous", | |
735 | "set the minimum allowed OSD release to participate in the cluster", | |
736 | "osd", "rw", "cli,rest") | |
737 | COMMAND("osd cluster_snap", "take cluster snapshot (disabled)", \ | |
738 | "osd", "r", "") | |
739 | COMMAND("osd down " \ | |
740 | "type=CephString,name=ids,n=N", \ | |
741 | "set osd(s) <id> [<id>...] down, " \ | |
742 | "or use <any|all|*> to set all osds down", \ | |
743 | "osd", "rw", "cli,rest") | |
744 | COMMAND("osd out " \ | |
745 | "name=ids,type=CephString,n=N", \ | |
746 | "set osd(s) <id> [<id>...] out, " \ | |
747 | "or use <any|all|*> to set all osds out", \ | |
748 | "osd", "rw", "cli,rest") | |
749 | COMMAND("osd in " \ | |
750 | "name=ids,type=CephString,n=N", \ | |
751 | "set osd(s) <id> [<id>...] in, " | |
752 | "can use <any|all|*> to automatically set all previously out osds in", \ | |
753 | "osd", "rw", "cli,rest") | |
754 | COMMAND("osd rm " \ | |
755 | "name=ids,type=CephString,n=N", \ | |
756 | "remove osd(s) <id> [<id>...], " | |
757 | "or use <any|all|*> to remove all osds", \ | |
758 | "osd", "rw", "cli,rest") | |
759 | COMMAND("osd add-noup " \ | |
760 | "name=ids,type=CephString,n=N", \ | |
761 | "mark osd(s) <id> [<id>...] as noup, " \ | |
762 | "or use <all|any|*> to mark all osds as noup", \ | |
763 | "osd", "rw", "cli,rest") | |
764 | COMMAND("osd add-nodown " \ | |
765 | "name=ids,type=CephString,n=N", \ | |
766 | "mark osd(s) <id> [<id>...] as nodown, " \ | |
767 | "or use <all|any|*> to mark all osds as nodown", \ | |
768 | "osd", "rw", "cli,rest") | |
769 | COMMAND("osd add-noin " \ | |
770 | "name=ids,type=CephString,n=N", \ | |
771 | "mark osd(s) <id> [<id>...] as noin, " \ | |
772 | "or use <all|any|*> to mark all osds as noin", \ | |
773 | "osd", "rw", "cli,rest") | |
774 | COMMAND("osd add-noout " \ | |
775 | "name=ids,type=CephString,n=N", \ | |
776 | "mark osd(s) <id> [<id>...] as noout, " \ | |
777 | "or use <all|any|*> to mark all osds as noout", \ | |
778 | "osd", "rw", "cli,rest") | |
779 | COMMAND("osd rm-noup " \ | |
780 | "name=ids,type=CephString,n=N", \ | |
781 | "allow osd(s) <id> [<id>...] to be marked up " \ | |
782 | "(if they are currently marked as noup), " \ | |
783 | "can use <all|any|*> to automatically filter out all noup osds", \ | |
784 | "osd", "rw", "cli,rest") | |
785 | COMMAND("osd rm-nodown " \ | |
786 | "name=ids,type=CephString,n=N", \ | |
787 | "allow osd(s) <id> [<id>...] to be marked down " \ | |
788 | "(if they are currently marked as nodown), " \ | |
789 | "can use <all|any|*> to automatically filter out all nodown osds", \ | |
790 | "osd", "rw", "cli,rest") | |
791 | COMMAND("osd rm-noin " \ | |
792 | "name=ids,type=CephString,n=N", \ | |
793 | "allow osd(s) <id> [<id>...] to be marked in " \ | |
794 | "(if they are currently marked as noin), " \ | |
795 | "can use <all|any|*> to automatically filter out all noin osds", \ | |
796 | "osd", "rw", "cli,rest") | |
797 | COMMAND("osd rm-noout " \ | |
798 | "name=ids,type=CephString,n=N", \ | |
799 | "allow osd(s) <id> [<id>...] to be marked out " \ | |
800 | "(if they are currently marked as noout), " \ | |
801 | "can use <all|any|*> to automatically filter out all noout osds", \ | |
802 | "osd", "rw", "cli,rest") | |
803 | COMMAND("osd reweight " \ | |
804 | "name=id,type=CephOsdName " \ | |
805 | "type=CephFloat,name=weight,range=0.0|1.0", \ | |
806 | "reweight osd to 0.0 < <weight> < 1.0", "osd", "rw", "cli,rest") | |
807 | COMMAND("osd reweightn " \ | |
808 | "name=weights,type=CephString", | |
809 | "reweight osds with {<id>: <weight>,...})", | |
810 | "osd", "rw", "cli,rest") | |
811 | COMMAND("osd force-create-pg " \ | |
812 | "name=pgid,type=CephPgid ", | |
813 | "force creation of pg <pgid>", | |
814 | "osd", "rw", "cli,rest") | |
815 | COMMAND("osd pg-temp " \ | |
816 | "name=pgid,type=CephPgid " \ | |
817 | "name=id,type=CephOsdName,n=N,req=false", \ | |
818 | "set pg_temp mapping pgid:[<id> [<id>...]] (developers only)", \ | |
819 | "osd", "rw", "cli,rest") | |
820 | COMMAND("osd pg-upmap " \ | |
821 | "name=pgid,type=CephPgid " \ | |
822 | "name=id,type=CephOsdName,n=N", \ | |
823 | "set pg_upmap mapping <pgid>:[<id> [<id>...]] (developers only)", \ | |
824 | "osd", "rw", "cli,rest") | |
825 | COMMAND("osd rm-pg-upmap " \ | |
826 | "name=pgid,type=CephPgid", \ | |
827 | "clear pg_upmap mapping for <pgid> (developers only)", \ | |
828 | "osd", "rw", "cli,rest") | |
829 | COMMAND("osd pg-upmap-items " \ | |
830 | "name=pgid,type=CephPgid " \ | |
831 | "name=id,type=CephOsdName,n=N", \ | |
832 | "set pg_upmap_items mapping <pgid>:{<id> to <id>, [...]} (developers only)", \ | |
833 | "osd", "rw", "cli,rest") | |
834 | COMMAND("osd rm-pg-upmap-items " \ | |
835 | "name=pgid,type=CephPgid", \ | |
836 | "clear pg_upmap_items mapping for <pgid> (developers only)", \ | |
837 | "osd", "rw", "cli,rest") | |
838 | COMMAND("osd primary-temp " \ | |
839 | "name=pgid,type=CephPgid " \ | |
840 | "name=id,type=CephOsdName", \ | |
841 | "set primary_temp mapping pgid:<id>|-1 (developers only)", \ | |
842 | "osd", "rw", "cli,rest") | |
843 | COMMAND("osd primary-affinity " \ | |
844 | "name=id,type=CephOsdName " \ | |
845 | "type=CephFloat,name=weight,range=0.0|1.0", \ | |
846 | "adjust osd primary-affinity from 0.0 <= <weight> <= 1.0", \ | |
847 | "osd", "rw", "cli,rest") | |
848 | COMMAND("osd destroy " \ | |
849 | "name=id,type=CephOsdName " \ | |
850 | "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
851 | "mark osd as being destroyed. Keeps the ID intact (allowing reuse), " \ | |
852 | "but removes cephx keys, config-key data and lockbox keys, "\ | |
853 | "rendering data permanently unreadable.", \ | |
854 | "osd", "rw", "cli,rest") | |
855 | COMMAND("osd purge " \ | |
856 | "name=id,type=CephOsdName " \ | |
857 | "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
858 | "purge all osd data from the monitors. Combines `osd destroy`, " \ | |
859 | "`osd rm`, and `osd crush rm`.", \ | |
860 | "osd", "rw", "cli,rest") | |
861 | COMMAND("osd lost " \ | |
862 | "name=id,type=CephOsdName " \ | |
863 | "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
864 | "mark osd as permanently lost. THIS DESTROYS DATA IF NO MORE REPLICAS EXIST, BE CAREFUL", \ | |
865 | "osd", "rw", "cli,rest") | |
866 | COMMAND_WITH_FLAG("osd create " \ | |
867 | "name=uuid,type=CephUUID,req=false " \ | |
868 | "name=id,type=CephOsdName,req=false", \ | |
869 | "create new osd (with optional UUID and ID)", "osd", "rw", "cli,rest", | |
870 | FLAG(DEPRECATED)) | |
871 | COMMAND("osd new " \ | |
872 | "name=uuid,type=CephUUID,req=true " \ | |
873 | "name=id,type=CephOsdName,req=false", \ | |
874 | "Create a new OSD. If supplied, the `id` to be replaced needs to " \ | |
875 | "exist and have been previously destroyed. " \ | |
876 | "Reads secrets from JSON file via `-i <file>` (see man page).", \ | |
877 | "osd", "rw", "cli,rest") | |
878 | COMMAND("osd blacklist " \ | |
879 | "name=blacklistop,type=CephChoices,strings=add|rm " \ | |
880 | "name=addr,type=CephEntityAddr " \ | |
881 | "name=expire,type=CephFloat,range=0.0,req=false", \ | |
882 | "add (optionally until <expire> seconds from now) or remove <addr> from blacklist", \ | |
883 | "osd", "rw", "cli,rest") | |
884 | COMMAND("osd blacklist ls", "show blacklisted clients", "osd", "r", "cli,rest") | |
885 | COMMAND("osd blacklist clear", "clear all blacklisted clients", "osd", "rw", | |
886 | "cli,rest") | |
887 | COMMAND("osd pool mksnap " \ | |
888 | "name=pool,type=CephPoolname " \ | |
889 | "name=snap,type=CephString", \ | |
890 | "make snapshot <snap> in <pool>", "osd", "rw", "cli,rest") | |
891 | COMMAND("osd pool rmsnap " \ | |
892 | "name=pool,type=CephPoolname " \ | |
893 | "name=snap,type=CephString", \ | |
894 | "remove snapshot <snap> from <pool>", "osd", "rw", "cli,rest") | |
895 | COMMAND("osd pool ls " \ | |
896 | "name=detail,type=CephChoices,strings=detail,req=false", \ | |
897 | "list pools", "osd", "r", "cli,rest") | |
898 | COMMAND("osd pool create " \ | |
899 | "name=pool,type=CephPoolname " \ | |
900 | "name=pg_num,type=CephInt,range=0 " \ | |
901 | "name=pgp_num,type=CephInt,range=0,req=false " \ | |
902 | "name=pool_type,type=CephChoices,strings=replicated|erasure,req=false " \ | |
903 | "name=erasure_code_profile,type=CephString,req=false,goodchars=[A-Za-z0-9-_.] " \ | |
904 | "name=rule,type=CephString,req=false " \ | |
905 | "name=expected_num_objects,type=CephInt,req=false", \ | |
906 | "create pool", "osd", "rw", "cli,rest") | |
907 | COMMAND("osd pool delete " \ | |
908 | "name=pool,type=CephPoolname " \ | |
909 | "name=pool2,type=CephPoolname,req=false " \ | |
910 | "name=sure,type=CephString,req=false", \ | |
911 | "delete pool", \ | |
912 | "osd", "rw", "cli,rest") | |
913 | COMMAND("osd pool rm " \ | |
914 | "name=pool,type=CephPoolname " \ | |
915 | "name=pool2,type=CephPoolname,req=false " \ | |
916 | "name=sure,type=CephString,req=false", \ | |
917 | "remove pool", \ | |
918 | "osd", "rw", "cli,rest") | |
919 | COMMAND("osd pool rename " \ | |
920 | "name=srcpool,type=CephPoolname " \ | |
921 | "name=destpool,type=CephPoolname", \ | |
922 | "rename <srcpool> to <destpool>", "osd", "rw", "cli,rest") | |
923 | COMMAND("osd pool get " \ | |
924 | "name=pool,type=CephPoolname " \ | |
925 | "name=var,type=CephChoices,strings=size|min_size|crash_replay_interval|pg_num|pgp_num|crush_rule|hashpspool|nodelete|nopgchange|nosizechange|write_fadvise_dontneed|noscrub|nodeep-scrub|hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|use_gmt_hitset|auid|target_max_objects|target_max_bytes|cache_target_dirty_ratio|cache_target_dirty_high_ratio|cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age|erasure_code_profile|min_read_recency_for_promote|all|min_write_recency_for_promote|fast_read|hit_set_grade_decay_rate|hit_set_search_last_n|scrub_min_interval|scrub_max_interval|deep_scrub_interval|recovery_priority|recovery_op_priority|scrub_priority|compression_mode|compression_algorithm|compression_required_ratio|compression_max_blob_size|compression_min_blob_size|csum_type|csum_min_block|csum_max_block", \ | |
926 | "get pool parameter <var>", "osd", "r", "cli,rest") | |
927 | COMMAND("osd pool set " \ | |
928 | "name=pool,type=CephPoolname " \ | |
929 | "name=var,type=CephChoices,strings=size|min_size|crash_replay_interval|pg_num|pgp_num|crush_rule|hashpspool|nodelete|nopgchange|nosizechange|write_fadvise_dontneed|noscrub|nodeep-scrub|hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|use_gmt_hitset|target_max_bytes|target_max_objects|cache_target_dirty_ratio|cache_target_dirty_high_ratio|cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age|auid|min_read_recency_for_promote|min_write_recency_for_promote|fast_read|hit_set_grade_decay_rate|hit_set_search_last_n|scrub_min_interval|scrub_max_interval|deep_scrub_interval|recovery_priority|recovery_op_priority|scrub_priority|compression_mode|compression_algorithm|compression_required_ratio|compression_max_blob_size|compression_min_blob_size|csum_type|csum_min_block|csum_max_block|allow_ec_overwrites " \ | |
930 | "name=val,type=CephString " \ | |
931 | "name=force,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
932 | "set pool parameter <var> to <val>", "osd", "rw", "cli,rest") | |
933 | // 'val' is a CephString because it can include a unit. Perhaps | |
934 | // there should be a Python type for validation/conversion of strings | |
935 | // with units. | |
936 | COMMAND("osd pool set-quota " \ | |
937 | "name=pool,type=CephPoolname " \ | |
938 | "name=field,type=CephChoices,strings=max_objects|max_bytes " \ | |
939 | "name=val,type=CephString", | |
940 | "set object or byte limit on pool", "osd", "rw", "cli,rest") | |
941 | COMMAND("osd pool get-quota " \ | |
942 | "name=pool,type=CephPoolname ", | |
943 | "obtain object or byte limits for pool", | |
944 | "osd", "r", "cli,rest") | |
945 | COMMAND("osd pool application enable " \ | |
946 | "name=pool,type=CephPoolname " \ | |
947 | "name=app,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
948 | "name=force,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
949 | "enable use of an application <app> [cephfs,rbd,rgw] on pool <poolname>", | |
950 | "osd", "rw", "cli,rest") | |
951 | COMMAND("osd pool application disable " \ | |
952 | "name=pool,type=CephPoolname " \ | |
953 | "name=app,type=CephString " \ | |
954 | "name=force,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
955 | "disables use of an application <app> on pool <poolname>", | |
956 | "osd", "rw", "cli,rest") | |
957 | COMMAND("osd pool application set " \ | |
958 | "name=pool,type=CephPoolname " \ | |
959 | "name=app,type=CephString " \ | |
960 | "name=key,type=CephString,goodchars=[A-Za-z0-9-_.] " \ | |
961 | "name=value,type=CephString,goodchars=[A-Za-z0-9-_.=]", | |
962 | "sets application <app> metadata key <key> to <value> on pool <poolname>", | |
963 | "osd", "rw", "cli,rest") | |
964 | COMMAND("osd pool application rm " \ | |
965 | "name=pool,type=CephPoolname " \ | |
966 | "name=app,type=CephString " \ | |
967 | "name=key,type=CephString", | |
968 | "removes application <app> metadata key <key> on pool <poolname>", | |
969 | "osd", "rw", "cli,rest") | |
970 | COMMAND("osd utilization", | |
971 | "get basic pg distribution stats", | |
972 | "osd", "r", "cli,rest") | |
973 | ||
974 | // tiering | |
975 | COMMAND("osd tier add " \ | |
976 | "name=pool,type=CephPoolname " \ | |
977 | "name=tierpool,type=CephPoolname " \ | |
978 | "name=force_nonempty,type=CephChoices,strings=--force-nonempty,req=false", | |
979 | "add the tier <tierpool> (the second one) to base pool <pool> (the first one)", \ | |
980 | "osd", "rw", "cli,rest") | |
981 | COMMAND("osd tier remove " \ | |
982 | "name=pool,type=CephPoolname " \ | |
983 | "name=tierpool,type=CephPoolname", | |
984 | "remove the tier <tierpool> (the second one) from base pool <pool> (the first one)", \ | |
985 | "osd", "rw", "cli,rest") | |
986 | COMMAND("osd tier rm " \ | |
987 | "name=pool,type=CephPoolname " \ | |
988 | "name=tierpool,type=CephPoolname", | |
989 | "remove the tier <tierpool> (the second one) from base pool <pool> (the first one)", \ | |
990 | "osd", "rw", "cli,rest") | |
991 | COMMAND("osd tier cache-mode " \ | |
992 | "name=pool,type=CephPoolname " \ | |
993 | "name=mode,type=CephChoices,strings=none|writeback|forward|readonly|readforward|proxy|readproxy " \ | |
994 | "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ | |
995 | "specify the caching mode for cache tier <pool>", "osd", "rw", "cli,rest") | |
996 | COMMAND("osd tier set-overlay " \ | |
997 | "name=pool,type=CephPoolname " \ | |
998 | "name=overlaypool,type=CephPoolname", \ | |
999 | "set the overlay pool for base pool <pool> to be <overlaypool>", "osd", "rw", "cli,rest") | |
1000 | COMMAND("osd tier remove-overlay " \ | |
1001 | "name=pool,type=CephPoolname ", \ | |
1002 | "remove the overlay pool for base pool <pool>", "osd", "rw", "cli,rest") | |
1003 | COMMAND("osd tier rm-overlay " \ | |
1004 | "name=pool,type=CephPoolname ", \ | |
1005 | "remove the overlay pool for base pool <pool>", "osd", "rw", "cli,rest") | |
1006 | ||
1007 | COMMAND("osd tier add-cache " \ | |
1008 | "name=pool,type=CephPoolname " \ | |
1009 | "name=tierpool,type=CephPoolname " \ | |
1010 | "name=size,type=CephInt,range=0", \ | |
1011 | "add a cache <tierpool> (the second one) of size <size> to existing pool <pool> (the first one)", \ | |
1012 | "osd", "rw", "cli,rest") | |
1013 | ||
1014 | /* | |
1015 | * mon/ConfigKeyService.cc | |
1016 | */ | |
1017 | ||
1018 | COMMAND("config-key get " \ | |
1019 | "name=key,type=CephString", \ | |
1020 | "get <key>", "config-key", "r", "cli,rest") | |
1021 | COMMAND("config-key set " \ | |
1022 | "name=key,type=CephString " \ | |
1023 | "name=val,type=CephString,req=false", \ | |
1024 | "set <key> to value <val>", "config-key", "rw", "cli,rest") | |
1025 | COMMAND_WITH_FLAG("config-key put " \ | |
1026 | "name=key,type=CephString " \ | |
1027 | "name=val,type=CephString,req=false", \ | |
1028 | "put <key>, value <val>", "config-key", "rw", "cli,rest", | |
1029 | FLAG(DEPRECATED)) | |
1030 | COMMAND("config-key del " \ | |
1031 | "name=key,type=CephString", \ | |
1032 | "delete <key>", "config-key", "rw", "cli,rest") | |
1033 | COMMAND("config-key rm " \ | |
1034 | "name=key,type=CephString", \ | |
1035 | "rm <key>", "config-key", "rw", "cli,rest") | |
1036 | COMMAND("config-key exists " \ | |
1037 | "name=key,type=CephString", \ | |
1038 | "check for <key>'s existence", "config-key", "r", "cli,rest") | |
1039 | COMMAND_WITH_FLAG("config-key list ", "list keys", "config-key", "r", "cli,rest", | |
1040 | FLAG(DEPRECATED)) | |
1041 | COMMAND("config-key ls ", "list keys", "config-key", "r", "cli,rest") | |
1042 | COMMAND("config-key dump", "dump keys and values", "config-key", "r", "cli,rest") | |
1043 | ||
1044 | ||
1045 | /* | |
1046 | * mon/MgrMonitor.cc | |
1047 | */ | |
1048 | COMMAND("mgr dump " \ | |
1049 | "name=epoch,type=CephInt,range=0,req=false", \ | |
1050 | "dump the latest MgrMap", \ | |
1051 | "mgr", "r", "cli,rest") | |
1052 | COMMAND("mgr fail name=who,type=CephString", \ | |
1053 | "treat the named manager daemon as failed", "mgr", "rw", "cli,rest") | |
1054 | COMMAND("mgr module ls", | |
1055 | "list active mgr modules", "mgr", "r", "cli,rest") | |
1056 | COMMAND("mgr module enable " \ | |
1057 | "name=module,type=CephString " \ | |
1058 | "name=force,type=CephChoices,strings=--force,req=false", | |
1059 | "enable mgr module", "mgr", "rw", "cli,rest") | |
1060 | COMMAND("mgr module disable " \ | |
1061 | "name=module,type=CephString", | |
1062 | "disable mgr module", "mgr", "rw", "cli,rest") | |
1063 | COMMAND("mgr metadata name=id,type=CephString,req=false", | |
1064 | "dump metadata for all daemons or a specific daemon", | |
1065 | "mgr", "r", "cli,rest") | |
1066 | COMMAND("mgr count-metadata name=property,type=CephString", | |
1067 | "count ceph-mgr daemons by metadata field property", | |
1068 | "mgr", "r", "cli,rest") | |
1069 | COMMAND("mgr versions", \ | |
1070 | "check running versions of ceph-mgr daemons", | |
1071 | "mgr", "r", "cli,rest") |