]> git.proxmox.com Git - ceph.git/blame - ceph/src/mon/MonCommands.h
update sources to v12.1.2
[ceph.git] / ceph / src / mon / MonCommands.h
CommitLineData
7c673cae
FG
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:
31f18b77 32 * mds, osd, pg (osd), mon, auth, log, config-key, mgr
7c673cae
FG
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!
126COMMAND("pg force_create_pg name=pgid,type=CephPgid", \
127 "force creation of pg <pgid>", "pg", "rw", "cli,rest")
224ce89b
WB
128COMMAND_WITH_FLAG("pg set_full_ratio name=ratio,type=CephFloat,range=0.0|1.0", \
129 "set ratio at which pgs are considered full", \
130 "pg", "rw", "cli,rest", FLAG(DEPRECATED))
131COMMAND_WITH_FLAG("pg set_nearfull_ratio " \
132 "name=ratio,type=CephFloat,range=0.0|1.0", \
133 "set ratio at which pgs are considered nearly full", \
134 "pg", "rw", "cli,rest", FLAG(DEPRECATED))
7c673cae
FG
135
136COMMAND("pg map name=pgid,type=CephPgid", "show mapping of pg to osds", \
137 "pg", "r", "cli,rest")
31f18b77
FG
138COMMAND("osd last-stat-seq name=id,type=CephOsdName", \
139 "get the last pg stats sequence number reported for this osd", \
140 "osd", "r", "cli,rest")
7c673cae
FG
141
142/*
143 * auth commands AuthMonitor.cc
144 */
145
146COMMAND("auth export name=entity,type=CephString,req=false", \
147 "write keyring for requested entity, or master keyring if none given", \
148 "auth", "rx", "cli,rest")
149COMMAND("auth get name=entity,type=CephString", \
150 "write keyring file with requested key", "auth", "rx", "cli,rest")
151COMMAND("auth get-key name=entity,type=CephString", "display requested key", \
152 "auth", "rx", "cli,rest")
153COMMAND("auth print-key name=entity,type=CephString", "display requested key", \
154 "auth", "rx", "cli,rest")
155COMMAND("auth print_key name=entity,type=CephString", "display requested key", \
156 "auth", "rx", "cli,rest")
c07f9fc5
FG
157COMMAND_WITH_FLAG("auth list", "list authentication state", "auth", "rx", "cli,rest",
158 FLAG(DEPRECATED))
159COMMAND("auth ls", "list authentication state", "auth", "rx", "cli,rest")
7c673cae
FG
160COMMAND("auth import", "auth import: read keyring file from -i <file>", \
161 "auth", "rwx", "cli,rest")
162COMMAND("auth add " \
163 "name=entity,type=CephString " \
164 "name=caps,type=CephString,n=N,req=false", \
165 "add auth info for <entity> from input file, or random key if no " \
166 "input is given, and/or any caps specified in the command",
167 "auth", "rwx", "cli,rest")
168COMMAND("auth get-or-create-key " \
169 "name=entity,type=CephString " \
170 "name=caps,type=CephString,n=N,req=false", \
171 "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.", \
172 "auth", "rwx", "cli,rest")
173COMMAND("auth get-or-create " \
174 "name=entity,type=CephString " \
175 "name=caps,type=CephString,n=N,req=false", \
176 "add auth info for <entity> from input file, or random key if no input given, and/or any caps specified in the command", \
177 "auth", "rwx", "cli,rest")
178COMMAND("auth caps " \
179 "name=entity,type=CephString " \
180 "name=caps,type=CephString,n=N", \
181 "update caps for <name> from caps specified in the command", \
182 "auth", "rwx", "cli,rest")
183COMMAND("auth del " \
184 "name=entity,type=CephString", \
185 "delete all caps for <name>", \
186 "auth", "rwx", "cli,rest")
187COMMAND("auth rm " \
188 "name=entity,type=CephString", \
189 "remove all caps for <name>", \
190 "auth", "rwx", "cli,rest")
191
192/*
193 * Monitor commands (Monitor.cc)
194 */
195COMMAND_WITH_FLAG("compact", "cause compaction of monitor's leveldb storage", \
196 "mon", "rw", "cli,rest", \
197 FLAG(NOFORWARD)|FLAG(DEPRECATED))
198COMMAND_WITH_FLAG("scrub", "scrub the monitor stores", \
199 "mon", "rw", "cli,rest", \
200 FLAG(DEPRECATED))
201COMMAND("fsid", "show cluster FSID/UUID", "mon", "r", "cli,rest")
202COMMAND("log name=logtext,type=CephString,n=N", \
203 "log supplied text to the monitor log", "mon", "rw", "cli,rest")
224ce89b
WB
204COMMAND("log last "
205 "name=num,type=CephInt,range=1,req=false "
206 "name=level,type=CephChoices,strings=debug|info|sec|warn|error,req=false "
207 "name=channel,type=CephChoices,strings=*|cluster|audit,req=false", \
31f18b77 208 "print last few lines of the cluster log", \
c07f9fc5 209 "mon", "r", "cli,rest")
7c673cae
FG
210COMMAND_WITH_FLAG("injectargs " \
211 "name=injected_args,type=CephString,n=N", \
212 "inject config arguments into monitor", "mon", "rw", "cli,rest",
213 FLAG(NOFORWARD))
c07f9fc5
FG
214COMMAND("config set " \
215 "name=key,type=CephString name=value,type=CephString",
216 "Set a configuration option at runtime (not persistent)",
217 "mon", "rw", "cli,rest")
7c673cae
FG
218COMMAND("status", "show cluster status", "mon", "r", "cli,rest")
219COMMAND("health name=detail,type=CephChoices,strings=detail,req=false", \
220 "show cluster health", "mon", "r", "cli,rest")
224ce89b 221COMMAND("time-sync-status", "show time sync status", "mon", "r", "cli,rest")
7c673cae
FG
222COMMAND("df name=detail,type=CephChoices,strings=detail,req=false", \
223 "show cluster free space stats", "mon", "r", "cli,rest")
224COMMAND("report name=tags,type=CephString,n=N,req=false", \
225 "report full status of cluster, optional title tag strings", \
226 "mon", "r", "cli,rest")
31f18b77
FG
227COMMAND("features", "report of connected features", \
228 "mon", "r", "cli,rest")
7c673cae
FG
229COMMAND("quorum_status", "report status of monitor quorum", \
230 "mon", "r", "cli,rest")
231
232COMMAND_WITH_FLAG("mon_status", "report status of monitors", "mon", "r", "cli,rest",
233 FLAG(NOFORWARD))
234COMMAND_WITH_FLAG("sync force " \
235 "name=validate1,type=CephChoices,strings=--yes-i-really-mean-it,req=false " \
236 "name=validate2,type=CephChoices,strings=--i-know-what-i-am-doing,req=false", \
237 "force sync of and clear monitor store", \
238 "mon", "rw", "cli,rest", \
239 FLAG(NOFORWARD)|FLAG(DEPRECATED))
240COMMAND_WITH_FLAG("heap " \
241 "name=heapcmd,type=CephChoices,strings=dump|start_profiler|stop_profiler|release|stats", \
242 "show heap usage info (available only if compiled with tcmalloc)", \
243 "mon", "rw", "cli,rest", FLAG(NOFORWARD))
244COMMAND("quorum name=quorumcmd,type=CephChoices,strings=enter|exit,n=1", \
245 "enter or exit quorum", "mon", "rw", "cli,rest")
246COMMAND("tell " \
247 "name=target,type=CephName " \
248 "name=args,type=CephString,n=N", \
249 "send a command to a specific daemon", "mon", "rw", "cli,rest")
250COMMAND_WITH_FLAG("version", "show mon daemon version", "mon", "r", "cli,rest",
251 FLAG(NOFORWARD))
252
253COMMAND("node ls " \
254 "name=type,type=CephChoices,strings=all|osd|mon|mds,req=false",
255 "list all nodes in cluster [type]", "mon", "r", "cli,rest")
256/*
257 * Monitor-specific commands under module 'mon'
258 */
259COMMAND_WITH_FLAG("mon compact", \
260 "cause compaction of monitor's leveldb storage", \
261 "mon", "rw", "cli,rest", \
262 FLAG(NOFORWARD))
263COMMAND_WITH_FLAG("mon scrub",
264 "scrub the monitor stores", \
265 "mon", "rw", "cli,rest", \
266 FLAG(NONE))
267COMMAND_WITH_FLAG("mon sync force " \
268 "name=validate1,type=CephChoices,strings=--yes-i-really-mean-it,req=false " \
269 "name=validate2,type=CephChoices,strings=--i-know-what-i-am-doing,req=false", \
270 "force sync of and clear monitor store", \
271 "mon", "rw", "cli,rest", \
272 FLAG(NOFORWARD))
273COMMAND("mon metadata name=id,type=CephString,req=false",
274 "fetch metadata for mon <id>",
275 "mon", "r", "cli,rest")
31f18b77
FG
276COMMAND("mon count-metadata name=property,type=CephString",
277 "count mons by metadata field property",
278 "mon", "r", "cli,rest")
279COMMAND("mon versions",
280 "check running versions of monitors",
281 "mon", "r", "cli,rest")
c07f9fc5
FG
282COMMAND("versions",
283 "check running versions of ceph daemons",
284 "mon", "r", "cli,rest")
285
7c673cae
FG
286
287
288/*
289 * MDS commands (MDSMonitor.cc)
290 */
291
292COMMAND("mds stat", "show MDS status", "mds", "r", "cli,rest")
293COMMAND_WITH_FLAG("mds dump "
294 "name=epoch,type=CephInt,req=false,range=0", \
295 "dump legacy MDS cluster info, optionally from epoch",
296 "mds", "r", "cli,rest", FLAG(DEPRECATED))
297COMMAND("fs dump "
298 "name=epoch,type=CephInt,req=false,range=0", \
299 "dump all CephFS status, optionally from epoch", "mds", "r", "cli,rest")
300COMMAND_WITH_FLAG("mds getmap " \
301 "name=epoch,type=CephInt,req=false,range=0", \
302 "get MDS map, optionally from epoch", "mds", "r", "cli,rest", FLAG(DEPRECATED))
303COMMAND("mds metadata name=who,type=CephString,req=false",
304 "fetch metadata for mds <who>",
305 "mds", "r", "cli,rest")
31f18b77
FG
306COMMAND("mds count-metadata name=property,type=CephString",
307 "count MDSs by metadata field property",
308 "mds", "r", "cli,rest")
309COMMAND("mds versions",
310 "check running versions of MDSs",
311 "mds", "r", "cli,rest")
7c673cae
FG
312COMMAND_WITH_FLAG("mds tell " \
313 "name=who,type=CephString " \
314 "name=args,type=CephString,n=N", \
315 "send command to particular mds", "mds", "rw", "cli,rest", FLAG(OBSOLETE))
316COMMAND("mds compat show", "show mds compatibility settings", \
317 "mds", "r", "cli,rest")
318COMMAND_WITH_FLAG("mds stop name=who,type=CephString", "stop mds", \
319 "mds", "rw", "cli,rest", FLAG(DEPRECATED))
224ce89b
WB
320COMMAND("mds deactivate name=who,type=CephString",
321 "clean up specified MDS rank (use with `set max_mds` to shrink cluster)", \
7c673cae
FG
322 "mds", "rw", "cli,rest")
323COMMAND_WITH_FLAG("mds set_max_mds " \
324 "name=maxmds,type=CephInt,range=0", \
325 "set max MDS index", "mds", "rw", "cli,rest", FLAG(DEPRECATED))
326COMMAND_WITH_FLAG("mds set " \
327 "name=var,type=CephChoices,strings=max_mds|max_file_size"
328 "|allow_new_snaps|inline_data|allow_multimds|allow_dirfrags " \
329 "name=val,type=CephString " \
330 "name=confirm,type=CephString,req=false", \
331 "set mds parameter <var> to <val>", "mds", "rw", "cli,rest", FLAG(DEPRECATED))
332// arbitrary limit 0-20 below; worth standing on head to make it
333// relate to actual state definitions?
334// #include "include/ceph_fs.h"
335COMMAND("mds set_state " \
336 "name=gid,type=CephInt,range=0 " \
337 "name=state,type=CephInt,range=0|20", \
338 "set mds state of <gid> to <numeric-state>", "mds", "rw", "cli,rest")
339COMMAND("mds fail name=who,type=CephString", \
224ce89b
WB
340 "Mark MDS failed: trigger a failover if a standby is available",
341 "mds", "rw", "cli,rest")
7c673cae
FG
342COMMAND("mds repaired name=rank,type=CephString", \
343 "mark a damaged MDS rank as no longer damaged", "mds", "rw", "cli,rest")
344COMMAND("mds rm " \
345 "name=gid,type=CephInt,range=0", \
346 "remove nonactive mds", "mds", "rw", "cli,rest")
347COMMAND("mds rmfailed name=who,type=CephString name=confirm,type=CephString,req=false", \
348 "remove failed mds", "mds", "rw", "cli,rest")
349COMMAND_WITH_FLAG("mds cluster_down", "take MDS cluster down", "mds", "rw", "cli,rest", FLAG(DEPRECATED))
350COMMAND_WITH_FLAG("mds cluster_up", "bring MDS cluster up", "mds", "rw", "cli,rest", FLAG(DEPRECATED))
351COMMAND("mds compat rm_compat " \
352 "name=feature,type=CephInt,range=0", \
353 "remove compatible feature", "mds", "rw", "cli,rest")
354COMMAND("mds compat rm_incompat " \
355 "name=feature,type=CephInt,range=0", \
356 "remove incompatible feature", "mds", "rw", "cli,rest")
357COMMAND_WITH_FLAG("mds add_data_pool " \
358 "name=pool,type=CephString", \
359 "add data pool <pool>", "mds", "rw", "cli,rest", FLAG(DEPRECATED))
360COMMAND_WITH_FLAG("mds remove_data_pool " \
361 "name=pool,type=CephString", \
362 "remove data pool <pool>", "mds", "rw", "cli,rest", FLAG(DEPRECATED))
363COMMAND_WITH_FLAG("mds rm_data_pool " \
364 "name=pool,type=CephString", \
365 "remove data pool <pool>", "mds", "rw", "cli,rest", FLAG(DEPRECATED))
366COMMAND_WITH_FLAG("mds newfs " \
367 "name=metadata,type=CephInt,range=0 " \
368 "name=data,type=CephInt,range=0 " \
369 "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
370 "make new filesystem using pools <metadata> and <data>", \
371 "mds", "rw", "cli,rest", FLAG(OBSOLETE))
372COMMAND("fs new " \
373 "name=fs_name,type=CephString " \
374 "name=metadata,type=CephString " \
375 "name=data,type=CephString " \
376 "name=force,type=CephChoices,strings=--force,req=false " \
377 "name=sure,type=CephChoices,strings=--allow-dangerous-metadata-overlay,req=false", \
378 "make new filesystem using named pools <metadata> and <data>", \
379 "fs", "rw", "cli,rest")
380COMMAND("fs rm " \
381 "name=fs_name,type=CephString " \
382 "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
383 "disable the named filesystem", \
384 "fs", "rw", "cli,rest")
385COMMAND("fs reset " \
386 "name=fs_name,type=CephString " \
387 "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
388 "disaster recovery only: reset to a single-MDS map", \
389 "fs", "rw", "cli,rest")
390COMMAND("fs ls ", \
391 "list filesystems", \
392 "fs", "r", "cli,rest")
393COMMAND("fs get name=fs_name,type=CephString", \
394 "get info about one filesystem", \
395 "fs", "r", "cli,rest")
396COMMAND("fs set " \
397 "name=fs_name,type=CephString " \
398 "name=var,type=CephChoices,strings=max_mds|max_file_size"
399 "|allow_new_snaps|inline_data|cluster_down|allow_multimds|allow_dirfrags|balancer" \
400 "|standby_count_wanted " \
401 "name=val,type=CephString " \
402 "name=confirm,type=CephString,req=false", \
403 "set mds parameter <var> to <val>", "mds", "rw", "cli,rest")
404COMMAND("fs flag set name=flag_name,type=CephChoices,strings=enable_multiple "
405 "name=val,type=CephString " \
406 "name=confirm,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
407 "Set a global CephFS flag", \
408 "fs", "rw", "cli,rest")
409COMMAND("fs add_data_pool name=fs_name,type=CephString " \
410 "name=pool,type=CephString", \
411 "add data pool <pool>", "mds", "rw", "cli,rest")
412COMMAND("fs rm_data_pool name=fs_name,type=CephString " \
413 "name=pool,type=CephString", \
414 "remove data pool <pool>", "mds", "rw", "cli,rest")
415COMMAND_WITH_FLAG("fs set_default name=fs_name,type=CephString", \
416 "set the default to the named filesystem", \
417 "fs", "rw", "cli,rest", \
418 FLAG(DEPRECATED))
419COMMAND("fs set-default name=fs_name,type=CephString", \
420 "set the default to the named filesystem", \
421 "fs", "rw", "cli,rest")
422
423/*
424 * Monmap commands
425 */
426COMMAND("mon dump " \
427 "name=epoch,type=CephInt,range=0,req=false", \
428 "dump formatted monmap (optionally from epoch)", \
429 "mon", "r", "cli,rest")
430COMMAND("mon stat", "summarize monitor status", "mon", "r", "cli,rest")
431COMMAND("mon getmap " \
432 "name=epoch,type=CephInt,range=0,req=false", \
433 "get monmap", "mon", "r", "cli,rest")
434COMMAND("mon add " \
435 "name=name,type=CephString " \
436 "name=addr,type=CephIPAddr", \
437 "add new monitor named <name> at <addr>", "mon", "rw", "cli,rest")
438COMMAND("mon remove " \
439 "name=name,type=CephString", \
440 "remove monitor named <name>", "mon", "rw", "cli,rest")
441COMMAND("mon rm " \
442 "name=name,type=CephString", \
443 "remove monitor named <name>", "mon", "rw", "cli,rest")
224ce89b 444COMMAND("mon feature ls " \
7c673cae
FG
445 "name=with_value,type=CephChoices,strings=--with-value,req=false", \
446 "list available mon map features to be set/unset", \
447 "mon", "r", "cli,rest")
448COMMAND("mon feature set " \
449 "name=feature_name,type=CephString " \
450 "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
451 "set provided feature on mon map", \
452 "mon", "rw", "cli,rest")
453
454/*
455 * OSD commands
456 */
457COMMAND("osd stat", "print summary of OSD map", "osd", "r", "cli,rest")
458COMMAND("osd dump " \
459 "name=epoch,type=CephInt,range=0,req=false",
460 "print summary of OSD map", "osd", "r", "cli,rest")
461COMMAND("osd tree " \
31f18b77 462 "name=epoch,type=CephInt,range=0,req=false " \
c07f9fc5 463 "name=states,type=CephChoices,strings=up|down|in|out|destroyed,n=N,req=false", \
7c673cae
FG
464 "print OSD tree", "osd", "r", "cli,rest")
465COMMAND("osd ls " \
466 "name=epoch,type=CephInt,range=0,req=false", \
467 "show all OSD ids", "osd", "r", "cli,rest")
468COMMAND("osd getmap " \
469 "name=epoch,type=CephInt,range=0,req=false", \
470 "get OSD map", "osd", "r", "cli,rest")
471COMMAND("osd getcrushmap " \
472 "name=epoch,type=CephInt,range=0,req=false", \
473 "get CRUSH map", "osd", "r", "cli,rest")
474COMMAND("osd getmaxosd", "show largest OSD id", "osd", "r", "cli,rest")
31f18b77
FG
475COMMAND("osd ls-tree " \
476 "name=epoch,type=CephInt,range=0,req=false "
477 "name=name,type=CephString,req=true", \
478 "show OSD ids under bucket <name> in the CRUSH map", \
479 "osd", "r", "cli,rest")
7c673cae
FG
480COMMAND("osd find " \
481 "name=id,type=CephOsdName", \
482 "find osd <id> in the CRUSH map and show its location", \
483 "osd", "r", "cli,rest")
484COMMAND("osd metadata " \
485 "name=id,type=CephOsdName,req=false", \
486 "fetch metadata for osd {id} (default all)", \
487 "osd", "r", "cli,rest")
31f18b77
FG
488COMMAND("osd count-metadata name=property,type=CephString",
489 "count OSDs by metadata field property",
490 "osd", "r", "cli,rest")
491COMMAND("osd versions", \
492 "check running versions of OSDs",
493 "osd", "r", "cli,rest")
7c673cae
FG
494COMMAND("osd map " \
495 "name=pool,type=CephPoolname " \
496 "name=object,type=CephObjectname " \
497 "name=nspace,type=CephString,req=false", \
498 "find pg for <object> in <pool> with [namespace]", "osd", "r", "cli,rest")
7c673cae
FG
499COMMAND("osd lspools " \
500 "name=auid,type=CephInt,req=false", \
501 "list pools", "osd", "r", "cli,rest")
502COMMAND("osd blacklist ls", "show blacklisted clients", "osd", "r", "cli,rest")
503COMMAND("osd blacklist clear", "clear all blacklisted clients", "osd", "rw",
504 "cli,rest")
c07f9fc5
FG
505COMMAND_WITH_FLAG("osd crush rule list", "list crush rules", "osd", "r", "cli,rest",
506 FLAG(DEPRECATED))
7c673cae
FG
507COMMAND("osd crush rule ls", "list crush rules", "osd", "r", "cli,rest")
508COMMAND("osd crush rule dump " \
509 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.],req=false", \
510 "dump crush rule <name> (default all)", \
511 "osd", "r", "cli,rest")
512COMMAND("osd crush dump", \
513 "dump crush map", \
514 "osd", "r", "cli,rest")
31f18b77
FG
515COMMAND("osd setcrushmap name=prior_version,type=CephInt,req=false", \
516 "set crush map from input file", \
7c673cae 517 "osd", "rw", "cli,rest")
31f18b77
FG
518COMMAND("osd crush set name=prior_version,type=CephInt,req=false", \
519 "set crush map from input file", \
7c673cae
FG
520 "osd", "rw", "cli,rest")
521COMMAND("osd crush add-bucket " \
522 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \
523 "name=type,type=CephString", \
524 "add no-parent (probably root) crush bucket <name> of type <type>", \
525 "osd", "rw", "cli,rest")
526COMMAND("osd crush rename-bucket " \
527 "name=srcname,type=CephString,goodchars=[A-Za-z0-9-_.] " \
528 "name=dstname,type=CephString,goodchars=[A-Za-z0-9-_.]", \
529 "rename bucket <srcname> to <dstname>", \
530 "osd", "rw", "cli,rest")
531COMMAND("osd crush set " \
532 "name=id,type=CephOsdName " \
533 "name=weight,type=CephFloat,range=0.0 " \
534 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]", \
535 "update crushmap position and weight for <name> to <weight> with location <args>", \
536 "osd", "rw", "cli,rest")
537COMMAND("osd crush add " \
538 "name=id,type=CephOsdName " \
539 "name=weight,type=CephFloat,range=0.0 " \
540 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]", \
541 "add or update crushmap position and weight for <name> with <weight> and location <args>", \
542 "osd", "rw", "cli,rest")
543COMMAND("osd crush set-device-class " \
224ce89b
WB
544 "name=class,type=CephString " \
545 "name=ids,type=CephString,n=N", \
546 "set the <class> of the osd(s) <id> [<id>...]," \
547 "or use <all|any|*> to set all.", \
7c673cae 548 "osd", "rw", "cli,rest")
c07f9fc5
FG
549COMMAND("osd crush rm-device-class " \
550 "name=ids,type=CephString,n=N", \
551 "remove class of the osd(s) <id> [<id>...]," \
552 "or use <all|any|*> to remove all.", \
553 "osd", "rw", "cli,rest")
7c673cae
FG
554COMMAND("osd crush create-or-move " \
555 "name=id,type=CephOsdName " \
556 "name=weight,type=CephFloat,range=0.0 " \
557 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]", \
558 "create entry or move existing entry for <name> <weight> at/to location <args>", \
559 "osd", "rw", "cli,rest")
560COMMAND("osd crush move " \
561 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \
562 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]", \
563 "move existing entry for <name> to location <args>", \
564 "osd", "rw", "cli,rest")
31f18b77
FG
565COMMAND("osd crush swap-bucket " \
566 "name=source,type=CephString,goodchars=[A-Za-z0-9-_.] " \
567 "name=dest,type=CephString,goodchars=[A-Za-z0-9-_.] " \
568 "name=force,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
569 "swap existing bucket contents from (orphan) bucket <source> and <target>", \
570 "osd", "rw", "cli,rest")
7c673cae
FG
571COMMAND("osd crush link " \
572 "name=name,type=CephString " \
573 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]", \
574 "link existing entry for <name> under location <args>", \
575 "osd", "rw", "cli,rest")
576COMMAND("osd crush rm " \
577 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \
578 "name=ancestor,type=CephString,req=false,goodchars=[A-Za-z0-9-_.]", \
579 "remove <name> from crush map (everywhere, or just at <ancestor>)",\
580 "osd", "rw", "cli,rest")
581COMMAND("osd crush remove " \
582 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \
583 "name=ancestor,type=CephString,req=false,goodchars=[A-Za-z0-9-_.]", \
584 "remove <name> from crush map (everywhere, or just at <ancestor>)", \
585 "osd", "rw", "cli,rest")
586COMMAND("osd crush unlink " \
587 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \
588 "name=ancestor,type=CephString,req=false,goodchars=[A-Za-z0-9-_.]", \
589 "unlink <name> from crush map (everywhere, or just at <ancestor>)", \
590 "osd", "rw", "cli,rest")
591COMMAND("osd crush reweight-all",
592 "recalculate the weights for the tree to ensure they sum correctly",
593 "osd", "rw", "cli,rest")
594COMMAND("osd crush reweight " \
595 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \
596 "name=weight,type=CephFloat,range=0.0", \
597 "change <name>'s weight to <weight> in crush map", \
598 "osd", "rw", "cli,rest")
599COMMAND("osd crush reweight-subtree " \
600 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \
601 "name=weight,type=CephFloat,range=0.0", \
602 "change all leaf items beneath <name> to <weight> in crush map", \
603 "osd", "rw", "cli,rest")
604COMMAND("osd crush tunables " \
605 "name=profile,type=CephChoices,strings=legacy|argonaut|bobtail|firefly|hammer|jewel|optimal|default", \
606 "set crush tunables values to <profile>", "osd", "rw", "cli,rest")
607COMMAND("osd crush set-tunable " \
608 "name=tunable,type=CephChoices,strings=straw_calc_version " \
609 "name=value,type=CephInt",
610 "set crush tunable <tunable> to <value>",
611 "osd", "rw", "cli,rest")
612COMMAND("osd crush get-tunable " \
613 "name=tunable,type=CephChoices,strings=straw_calc_version",
614 "get crush tunable <tunable>",
c07f9fc5 615 "osd", "r", "cli,rest")
7c673cae
FG
616COMMAND("osd crush show-tunables", \
617 "show current crush tunables", "osd", "r", "cli,rest")
618COMMAND("osd crush rule create-simple " \
619 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \
620 "name=root,type=CephString,goodchars=[A-Za-z0-9-_.] " \
621 "name=type,type=CephString,goodchars=[A-Za-z0-9-_.] " \
622 "name=mode,type=CephChoices,strings=firstn|indep,req=false",
623 "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)", \
624 "osd", "rw", "cli,rest")
224ce89b
WB
625COMMAND("osd crush rule create-replicated " \
626 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \
627 "name=root,type=CephString,goodchars=[A-Za-z0-9-_.] " \
628 "name=type,type=CephString,goodchars=[A-Za-z0-9-_.] " \
629 "name=class,type=CephString,goodchars=[A-Za-z0-9-_.],req=false",
630 "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)", \
631 "osd", "rw", "cli,rest")
7c673cae
FG
632COMMAND("osd crush rule create-erasure " \
633 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \
634 "name=profile,type=CephString,req=false,goodchars=[A-Za-z0-9-_.=]", \
635 "create crush rule <name> for erasure coded pool created with <profile> (default default)", \
636 "osd", "rw", "cli,rest")
637COMMAND("osd crush rule rm " \
638 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] ", \
639 "remove crush rule <name>", "osd", "rw", "cli,rest")
c07f9fc5
FG
640COMMAND("osd crush tree "
641 "name=shadow,type=CephChoices,strings=--show-shadow,req=false", \
7c673cae
FG
642 "dump crush buckets and items in a tree view",
643 "osd", "r", "cli,rest")
7c673cae
FG
644COMMAND("osd crush class rm " \
645 "name=class,type=CephString,goodchars=[A-Za-z0-9-_]", \
646 "remove crush device class <class>", \
647 "osd", "rw", "cli,rest")
648COMMAND("osd crush class ls", \
649 "list all crush device classes", \
650 "osd", "r", "cli,rest")
224ce89b
WB
651COMMAND("osd crush class ls-osd " \
652 "name=class,type=CephString,goodchars=[A-Za-z0-9-_]", \
653 "list all osds belonging to the specific <class>", \
654 "osd", "r", "cli,rest")
c07f9fc5
FG
655COMMAND("osd crush weight-set ls",
656 "list crush weight sets",
657 "osd", "r", "cli,rest")
658COMMAND("osd crush weight-set dump",
659 "dump crush weight sets",
660 "osd", "r", "cli,rest")
661COMMAND("osd crush weight-set create-compat",
662 "create a default backward-compatible weight-set",
663 "osd", "rw", "cli,rest")
664COMMAND("osd crush weight-set create " \
665 "name=pool,type=CephPoolname "\
666 "name=mode,type=CephChoices,strings=flat|positional",
667 "create a weight-set for a given pool",
668 "osd", "rw", "cli,rest")
669COMMAND("osd crush weight-set rm name=pool,type=CephPoolname",
670 "remove the weight-set for a given pool",
671 "osd", "rw", "cli,rest")
672COMMAND("osd crush weight-set rm-compat",
673 "remove the backward-compatible weight-set",
674 "osd", "rw", "cli,rest")
675COMMAND("osd crush weight-set reweight " \
676 "name=pool,type=CephPoolname " \
677 "name=item,type=CephString " \
678 "name=weight,type=CephFloat,range=0.0,n=N",
679 "set weight for an item (bucket or osd) in a pool's weight-set",
680 "osd", "rw", "cli,rest")
681COMMAND("osd crush weight-set reweight-compat " \
682 "name=item,type=CephString " \
683 "name=weight,type=CephFloat,range=0.0,n=N",
684 "set weight for an item (bucket or osd) in the backward-compatible weight-set",
685 "osd", "rw", "cli,rest")
7c673cae
FG
686COMMAND("osd setmaxosd " \
687 "name=newmax,type=CephInt,range=0", \
688 "set new maximum osd value", "osd", "rw", "cli,rest")
689COMMAND("osd set-full-ratio " \
690 "name=ratio,type=CephFloat,range=0.0|1.0", \
691 "set usage ratio at which OSDs are marked full",
692 "osd", "rw", "cli,rest")
693COMMAND("osd set-backfillfull-ratio " \
694 "name=ratio,type=CephFloat,range=0.0|1.0", \
695 "set usage ratio at which OSDs are marked too full to backfill",
696 "osd", "rw", "cli,rest")
697COMMAND("osd set-nearfull-ratio " \
698 "name=ratio,type=CephFloat,range=0.0|1.0", \
699 "set usage ratio at which OSDs are marked near-full",
700 "osd", "rw", "cli,rest")
701COMMAND("osd set-require-min-compat-client " \
31f18b77
FG
702 "name=version,type=CephString " \
703 "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
7c673cae
FG
704 "set the minimum client version we will maintain compatibility with",
705 "osd", "rw", "cli,rest")
706COMMAND("osd pause", "pause osd", "osd", "rw", "cli,rest")
707COMMAND("osd unpause", "unpause osd", "osd", "rw", "cli,rest")
708COMMAND("osd erasure-code-profile set " \
709 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " \
710 "name=profile,type=CephString,n=N,req=false", \
711 "create erasure code profile <name> with [<key[=value]> ...] pairs. Add a --force at the end to override an existing profile (VERY DANGEROUS)", \
712 "osd", "rw", "cli,rest")
713COMMAND("osd erasure-code-profile get " \
714 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.]", \
715 "get erasure code profile <name>", \
716 "osd", "r", "cli,rest")
717COMMAND("osd erasure-code-profile rm " \
718 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.]", \
719 "remove erasure code profile <name>", \
720 "osd", "rw", "cli,rest")
721COMMAND("osd erasure-code-profile ls", \
722 "list all erasure code profiles", \
723 "osd", "r", "cli,rest")
724COMMAND("osd set " \
c07f9fc5 725 "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", \
7c673cae
FG
726 "set <key>", "osd", "rw", "cli,rest")
727COMMAND("osd unset " \
728 "name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent", \
729 "unset <key>", "osd", "rw", "cli,rest")
31f18b77
FG
730COMMAND("osd require-osd-release "\
731 "name=release,type=CephChoices,strings=luminous",
732 "set the minimum allowed OSD release to participate in the cluster",
733 "osd", "rw", "cli,rest")
7c673cae
FG
734COMMAND("osd cluster_snap", "take cluster snapshot (disabled)", \
735 "osd", "r", "")
736COMMAND("osd down " \
737 "type=CephString,name=ids,n=N", \
31f18b77
FG
738 "set osd(s) <id> [<id>...] down, " \
739 "or use <any|all|*> to set all osds down", \
740 "osd", "rw", "cli,rest")
7c673cae
FG
741COMMAND("osd out " \
742 "name=ids,type=CephString,n=N", \
31f18b77
FG
743 "set osd(s) <id> [<id>...] out, " \
744 "or use <any|all|*> to set all osds out", \
745 "osd", "rw", "cli,rest")
7c673cae
FG
746COMMAND("osd in " \
747 "name=ids,type=CephString,n=N", \
31f18b77
FG
748 "set osd(s) <id> [<id>...] in, "
749 "can use <any|all|*> to automatically set all previously out osds in", \
750 "osd", "rw", "cli,rest")
7c673cae
FG
751COMMAND("osd rm " \
752 "name=ids,type=CephString,n=N", \
31f18b77
FG
753 "remove osd(s) <id> [<id>...], "
754 "or use <any|all|*> to remove all osds", \
755 "osd", "rw", "cli,rest")
756COMMAND("osd add-noup " \
757 "name=ids,type=CephString,n=N", \
758 "mark osd(s) <id> [<id>...] as noup, " \
759 "or use <all|any|*> to mark all osds as noup", \
760 "osd", "rw", "cli,rest")
761COMMAND("osd add-nodown " \
762 "name=ids,type=CephString,n=N", \
763 "mark osd(s) <id> [<id>...] as nodown, " \
764 "or use <all|any|*> to mark all osds as nodown", \
765 "osd", "rw", "cli,rest")
766COMMAND("osd add-noin " \
767 "name=ids,type=CephString,n=N", \
768 "mark osd(s) <id> [<id>...] as noin, " \
769 "or use <all|any|*> to mark all osds as noin", \
770 "osd", "rw", "cli,rest")
771COMMAND("osd add-noout " \
772 "name=ids,type=CephString,n=N", \
773 "mark osd(s) <id> [<id>...] as noout, " \
774 "or use <all|any|*> to mark all osds as noout", \
775 "osd", "rw", "cli,rest")
776COMMAND("osd rm-noup " \
777 "name=ids,type=CephString,n=N", \
778 "allow osd(s) <id> [<id>...] to be marked up " \
779 "(if they are currently marked as noup), " \
780 "can use <all|any|*> to automatically filter out all noup osds", \
781 "osd", "rw", "cli,rest")
782COMMAND("osd rm-nodown " \
783 "name=ids,type=CephString,n=N", \
784 "allow osd(s) <id> [<id>...] to be marked down " \
785 "(if they are currently marked as nodown), " \
786 "can use <all|any|*> to automatically filter out all nodown osds", \
787 "osd", "rw", "cli,rest")
788COMMAND("osd rm-noin " \
789 "name=ids,type=CephString,n=N", \
790 "allow osd(s) <id> [<id>...] to be marked in " \
791 "(if they are currently marked as noin), " \
792 "can use <all|any|*> to automatically filter out all noin osds", \
793 "osd", "rw", "cli,rest")
794COMMAND("osd rm-noout " \
795 "name=ids,type=CephString,n=N", \
796 "allow osd(s) <id> [<id>...] to be marked out " \
797 "(if they are currently marked as noout), " \
798 "can use <all|any|*> to automatically filter out all noout osds", \
799 "osd", "rw", "cli,rest")
7c673cae
FG
800COMMAND("osd reweight " \
801 "name=id,type=CephOsdName " \
802 "type=CephFloat,name=weight,range=0.0|1.0", \
803 "reweight osd to 0.0 < <weight> < 1.0", "osd", "rw", "cli,rest")
804COMMAND("osd reweightn " \
805 "name=weights,type=CephString",
806 "reweight osds with {<id>: <weight>,...})",
807 "osd", "rw", "cli,rest")
c07f9fc5
FG
808COMMAND("osd force-create-pg " \
809 "name=pgid,type=CephPgid ",
810 "force creation of pg <pgid>",
811 "osd", "rw", "cli,rest")
7c673cae
FG
812COMMAND("osd pg-temp " \
813 "name=pgid,type=CephPgid " \
814 "name=id,type=CephOsdName,n=N,req=false", \
815 "set pg_temp mapping pgid:[<id> [<id>...]] (developers only)", \
816 "osd", "rw", "cli,rest")
817COMMAND("osd pg-upmap " \
818 "name=pgid,type=CephPgid " \
819 "name=id,type=CephOsdName,n=N", \
224ce89b 820 "set pg_upmap mapping <pgid>:[<id> [<id>...]] (developers only)", \
7c673cae
FG
821 "osd", "rw", "cli,rest")
822COMMAND("osd rm-pg-upmap " \
823 "name=pgid,type=CephPgid", \
824 "clear pg_upmap mapping for <pgid> (developers only)", \
825 "osd", "rw", "cli,rest")
7c673cae
FG
826COMMAND("osd pg-upmap-items " \
827 "name=pgid,type=CephPgid " \
828 "name=id,type=CephOsdName,n=N", \
829 "set pg_upmap_items mapping <pgid>:{<id> to <id>, [...]} (developers only)", \
830 "osd", "rw", "cli,rest")
831COMMAND("osd rm-pg-upmap-items " \
832 "name=pgid,type=CephPgid", \
833 "clear pg_upmap_items mapping for <pgid> (developers only)", \
834 "osd", "rw", "cli,rest")
835COMMAND("osd primary-temp " \
836 "name=pgid,type=CephPgid " \
837 "name=id,type=CephOsdName", \
838 "set primary_temp mapping pgid:<id>|-1 (developers only)", \
839 "osd", "rw", "cli,rest")
840COMMAND("osd primary-affinity " \
841 "name=id,type=CephOsdName " \
842 "type=CephFloat,name=weight,range=0.0|1.0", \
843 "adjust osd primary-affinity from 0.0 <= <weight> <= 1.0", \
844 "osd", "rw", "cli,rest")
31f18b77
FG
845COMMAND("osd destroy " \
846 "name=id,type=CephOsdName " \
847 "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
848 "mark osd as being destroyed. Keeps the ID intact (allowing reuse), " \
849 "but removes cephx keys, config-key data and lockbox keys, "\
850 "rendering data permanently unreadable.", \
851 "osd", "rw", "cli,rest")
852COMMAND("osd purge " \
853 "name=id,type=CephOsdName " \
854 "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
855 "purge all osd data from the monitors. Combines `osd destroy`, " \
856 "`osd rm`, and `osd crush rm`.", \
857 "osd", "rw", "cli,rest")
7c673cae
FG
858COMMAND("osd lost " \
859 "name=id,type=CephOsdName " \
860 "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
861 "mark osd as permanently lost. THIS DESTROYS DATA IF NO MORE REPLICAS EXIST, BE CAREFUL", \
862 "osd", "rw", "cli,rest")
31f18b77 863COMMAND_WITH_FLAG("osd create " \
7c673cae
FG
864 "name=uuid,type=CephUUID,req=false " \
865 "name=id,type=CephOsdName,req=false", \
31f18b77
FG
866 "create new osd (with optional UUID and ID)", "osd", "rw", "cli,rest",
867 FLAG(DEPRECATED))
868COMMAND("osd new " \
869 "name=uuid,type=CephUUID,req=true " \
870 "name=id,type=CephOsdName,req=false", \
871 "Create a new OSD. If supplied, the `id` to be replaced needs to " \
872 "exist and have been previously destroyed. " \
873 "Reads secrets from JSON file via `-i <file>` (see man page).", \
874 "osd", "rw", "cli,rest")
7c673cae
FG
875COMMAND("osd blacklist " \
876 "name=blacklistop,type=CephChoices,strings=add|rm " \
877 "name=addr,type=CephEntityAddr " \
878 "name=expire,type=CephFloat,range=0.0,req=false", \
879 "add (optionally until <expire> seconds from now) or remove <addr> from blacklist", \
880 "osd", "rw", "cli,rest")
881COMMAND("osd pool mksnap " \
882 "name=pool,type=CephPoolname " \
883 "name=snap,type=CephString", \
884 "make snapshot <snap> in <pool>", "osd", "rw", "cli,rest")
885COMMAND("osd pool rmsnap " \
886 "name=pool,type=CephPoolname " \
887 "name=snap,type=CephString", \
888 "remove snapshot <snap> from <pool>", "osd", "rw", "cli,rest")
889COMMAND("osd pool ls " \
890 "name=detail,type=CephChoices,strings=detail,req=false", \
891 "list pools", "osd", "r", "cli,rest")
892COMMAND("osd pool create " \
893 "name=pool,type=CephPoolname " \
894 "name=pg_num,type=CephInt,range=0 " \
895 "name=pgp_num,type=CephInt,range=0,req=false " \
896 "name=pool_type,type=CephChoices,strings=replicated|erasure,req=false " \
897 "name=erasure_code_profile,type=CephString,req=false,goodchars=[A-Za-z0-9-_.] " \
31f18b77 898 "name=rule,type=CephString,req=false " \
7c673cae
FG
899 "name=expected_num_objects,type=CephInt,req=false", \
900 "create pool", "osd", "rw", "cli,rest")
901COMMAND("osd pool delete " \
902 "name=pool,type=CephPoolname " \
903 "name=pool2,type=CephPoolname,req=false " \
224ce89b 904 "name=sure,type=CephString,req=false", \
7c673cae
FG
905 "delete pool", \
906 "osd", "rw", "cli,rest")
907COMMAND("osd pool rm " \
908 "name=pool,type=CephPoolname " \
909 "name=pool2,type=CephPoolname,req=false " \
910 "name=sure,type=CephString,req=false", \
911 "remove pool", \
912 "osd", "rw", "cli,rest")
913COMMAND("osd pool rename " \
914 "name=srcpool,type=CephPoolname " \
915 "name=destpool,type=CephPoolname", \
916 "rename <srcpool> to <destpool>", "osd", "rw", "cli,rest")
917COMMAND("osd pool get " \
918 "name=pool,type=CephPoolname " \
224ce89b 919 "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", \
7c673cae
FG
920 "get pool parameter <var>", "osd", "r", "cli,rest")
921COMMAND("osd pool set " \
922 "name=pool,type=CephPoolname " \
224ce89b 923 "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 " \
7c673cae
FG
924 "name=val,type=CephString " \
925 "name=force,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
926 "set pool parameter <var> to <val>", "osd", "rw", "cli,rest")
927// 'val' is a CephString because it can include a unit. Perhaps
928// there should be a Python type for validation/conversion of strings
929// with units.
930COMMAND("osd pool set-quota " \
931 "name=pool,type=CephPoolname " \
932 "name=field,type=CephChoices,strings=max_objects|max_bytes " \
933 "name=val,type=CephString",
934 "set object or byte limit on pool", "osd", "rw", "cli,rest")
935COMMAND("osd pool get-quota " \
936 "name=pool,type=CephPoolname ",
937 "obtain object or byte limits for pool",
938 "osd", "r", "cli,rest")
c07f9fc5
FG
939COMMAND("osd pool application enable " \
940 "name=pool,type=CephPoolname " \
941 "name=app,type=CephString,goodchars=[A-Za-z0-9-_.] " \
942 "name=force,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
943 "enable use of an application <app> [cephfs,rbd,rgw] on pool <poolname>",
944 "osd", "rw", "cli,rest")
945COMMAND("osd pool application disable " \
946 "name=pool,type=CephPoolname " \
947 "name=app,type=CephString " \
948 "name=force,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
949 "disables use of an application <app> on pool <poolname>",
950 "osd", "rw", "cli,rest")
951COMMAND("osd pool application set " \
952 "name=pool,type=CephPoolname " \
953 "name=app,type=CephString " \
954 "name=key,type=CephString,goodchars=[A-Za-z0-9-_.] " \
955 "name=value,type=CephString,goodchars=[A-Za-z0-9-_.=]",
956 "sets application <app> metadata key <key> to <value> on pool <poolname>",
957 "osd", "rw", "cli,rest")
958COMMAND("osd pool application rm " \
959 "name=pool,type=CephPoolname " \
960 "name=app,type=CephString " \
961 "name=key,type=CephString",
962 "removes application <app> metadata key <key> on pool <poolname>",
963 "osd", "rw", "cli,rest")
7c673cae
FG
964COMMAND("osd utilization",
965 "get basic pg distribution stats",
966 "osd", "r", "cli,rest")
7c673cae
FG
967
968// tiering
969COMMAND("osd tier add " \
970 "name=pool,type=CephPoolname " \
971 "name=tierpool,type=CephPoolname " \
972 "name=force_nonempty,type=CephChoices,strings=--force-nonempty,req=false",
973 "add the tier <tierpool> (the second one) to base pool <pool> (the first one)", \
974 "osd", "rw", "cli,rest")
975COMMAND("osd tier remove " \
976 "name=pool,type=CephPoolname " \
977 "name=tierpool,type=CephPoolname",
978 "remove the tier <tierpool> (the second one) from base pool <pool> (the first one)", \
979 "osd", "rw", "cli,rest")
980COMMAND("osd tier rm " \
981 "name=pool,type=CephPoolname " \
982 "name=tierpool,type=CephPoolname",
983 "remove the tier <tierpool> (the second one) from base pool <pool> (the first one)", \
984 "osd", "rw", "cli,rest")
985COMMAND("osd tier cache-mode " \
986 "name=pool,type=CephPoolname " \
987 "name=mode,type=CephChoices,strings=none|writeback|forward|readonly|readforward|proxy|readproxy " \
988 "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
989 "specify the caching mode for cache tier <pool>", "osd", "rw", "cli,rest")
990COMMAND("osd tier set-overlay " \
991 "name=pool,type=CephPoolname " \
992 "name=overlaypool,type=CephPoolname", \
993 "set the overlay pool for base pool <pool> to be <overlaypool>", "osd", "rw", "cli,rest")
994COMMAND("osd tier remove-overlay " \
995 "name=pool,type=CephPoolname ", \
996 "remove the overlay pool for base pool <pool>", "osd", "rw", "cli,rest")
997COMMAND("osd tier rm-overlay " \
998 "name=pool,type=CephPoolname ", \
999 "remove the overlay pool for base pool <pool>", "osd", "rw", "cli,rest")
1000
1001COMMAND("osd tier add-cache " \
1002 "name=pool,type=CephPoolname " \
1003 "name=tierpool,type=CephPoolname " \
1004 "name=size,type=CephInt,range=0", \
1005 "add a cache <tierpool> (the second one) of size <size> to existing pool <pool> (the first one)", \
1006 "osd", "rw", "cli,rest")
1007
1008/*
1009 * mon/ConfigKeyService.cc
1010 */
1011
1012COMMAND("config-key get " \
1013 "name=key,type=CephString", \
1014 "get <key>", "config-key", "r", "cli,rest")
c07f9fc5 1015COMMAND("config-key set " \
7c673cae
FG
1016 "name=key,type=CephString " \
1017 "name=val,type=CephString,req=false", \
c07f9fc5
FG
1018 "set <key> to value <val>", "config-key", "rw", "cli,rest")
1019COMMAND_WITH_FLAG("config-key put " \
1020 "name=key,type=CephString " \
1021 "name=val,type=CephString,req=false", \
1022 "put <key>, value <val>", "config-key", "rw", "cli,rest",
1023 FLAG(DEPRECATED))
7c673cae
FG
1024COMMAND("config-key del " \
1025 "name=key,type=CephString", \
1026 "delete <key>", "config-key", "rw", "cli,rest")
1027COMMAND("config-key rm " \
1028 "name=key,type=CephString", \
1029 "rm <key>", "config-key", "rw", "cli,rest")
1030COMMAND("config-key exists " \
1031 "name=key,type=CephString", \
1032 "check for <key>'s existence", "config-key", "r", "cli,rest")
c07f9fc5
FG
1033COMMAND_WITH_FLAG("config-key list ", "list keys", "config-key", "r", "cli,rest",
1034 FLAG(DEPRECATED))
1035COMMAND("config-key ls ", "list keys", "config-key", "r", "cli,rest")
7c673cae
FG
1036COMMAND("config-key dump", "dump keys and values", "config-key", "r", "cli,rest")
1037
1038
1039/*
1040 * mon/MgrMonitor.cc
1041 */
31f18b77
FG
1042COMMAND("mgr dump " \
1043 "name=epoch,type=CephInt,range=0,req=false", \
1044 "dump the latest MgrMap", \
224ce89b 1045 "mgr", "r", "cli,rest")
7c673cae
FG
1046COMMAND("mgr fail name=who,type=CephString", \
1047 "treat the named manager daemon as failed", "mgr", "rw", "cli,rest")
224ce89b
WB
1048COMMAND("mgr module ls",
1049 "list active mgr modules", "mgr", "r", "cli,rest")
1050COMMAND("mgr module enable " \
1051 "name=module,type=CephString " \
1052 "name=force,type=CephChoices,strings=--force,req=false",
1053 "enable mgr module", "mgr", "rw", "cli,rest")
1054COMMAND("mgr module disable " \
1055 "name=module,type=CephString",
1056 "disable mgr module", "mgr", "rw", "cli,rest")
c07f9fc5
FG
1057COMMAND("mgr metadata name=id,type=CephString,req=false",
1058 "dump metadata for all daemons or a specific daemon",
1059 "mgr", "r", "cli,rest")
1060COMMAND("mgr count-metadata name=property,type=CephString",
1061 "count ceph-mgr daemons by metadata field property",
1062 "mgr", "r", "cli,rest")
1063COMMAND("mgr versions", \
1064 "check running versions of ceph-mgr daemons",
1065 "mgr", "r", "cli,rest")