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