]> git.proxmox.com Git - ceph.git/blame - ceph/src/mon/MonCommands.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / mon / MonCommands.h
CommitLineData
9f95a23c 1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
7c673cae
FG
2// vim: ts=8 sw=2 smarttab
3/*
4 * Ceph - scalable distributed file system
5 *
9f95a23c 6 * Copyright (C) 2013 Inktank Storage, Inc.
7c673cae
FG
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
9f95a23c 13 * License version 2.1, as published by the Free Software
7c673cae 14 * Foundation. See file COPYING.
9f95a23c 15 *
7c673cae
FG
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
7c673cae
FG
35 *
36 * The commands describe themselves completely enough for the separate
37 * frontend(s) to be able to accept user input and validate it against
38 * the command descriptions, and generate a JSON object that contains
39 * key:value mappings of parameter names to validated parameter values.
40 *
41 * 'signature' is a space-separated list of individual command descriptors;
42 * each descriptor is either a literal string, which can contain no spaces or
43 * '=' signs (for instance, in "pg stat", both "pg" and "stat" are literal
44 * strings representing one descriptor each), or a list of key=val[,key=val...]
9f95a23c 45 * which also includes no spaces.
7c673cae
FG
46 *
47 * The key=val form describes a non-literal parameter. Each will have at
48 * least a name= and type=, and each type can have its own type-specific
9f95a23c 49 * parameters. The parser is the arbiter of these types and their
7c673cae
FG
50 * interpretation. A few more non-type-specific key=val pairs exist:
51 *
52 * req=false marks an optional parameter (default for req is 'true')
53 * n=<n> is a repeat count for how many of this argument must be supplied.
54 * n=1 is the default.
55 * n=N is a special case that means "1 or more".
56 *
57 * A perhaps-incomplete list of types:
58 *
59 * CephInt: Optional: range=min[|max]
60 * CephFloat: Optional range
61 * CephString: optional badchars
62 * CephSocketpath: validation involves "is it S_ISSOCK"
63 * CephIPAddr: v4 or v6 addr with optional port, syntax validated
64 * CephEntityAddr: CephIPAddr + optional '/nonce'
65 * CephPoolname: Plainold string
66 * CephObjectname: Another plainold string
67 * CephPgid: n.xxx where n is an int > 0, xxx is a hex number > 0
68 * CephName: daemon name, '*' or '<type>.<id>' (id must be int for type osd)
69 * CephOsdName: osd name, '*' or '<id> or 'osd.<id>' (id must be int)
70 * CephChoices: strings="foo|bar" means this param can be either
71 * CephFilepath: openable file
72 * CephFragment: cephfs 'fragID': val/bits, val in hex 0xnnn, bits in dec
73 * CephUUID: uuid in text matching Python uuid.UUID()
74 * CephPrefix: special type assigned to literals
75 *
76 * Example:
77 *
9f95a23c
TL
78 * COMMAND("auth add "
79 * "name=entity,type=CephString "
20effc67
TL
80 * "name=caps,type=CephString,n=N,req=false "
81 * "-- "
82 * "name=some_option,type=CephString,req=false",
9f95a23c 83 * "add auth info for <name> from input file, or random key "
7c673cae
FG
84 * "if no input given, and/or any caps specified in the command")
85 *
86 * defines a command "auth add" that takes a required argument "entity"
87 * of type "CephString", and from 1 to N arguments named "caps" of type
88 * CephString, at least one of which is required. The front end will
89 * validate user input against this description. Let's say the user
90 * enters auth add client.admin 'mon rwx' 'osd *'. The result will be a
91 * JSON object like {"prefix":"auth add", "entity":"client.admin",
92 * "caps":["mon rwx", "osd *"]}.
20effc67
TL
93 *
94 * The -- separates positional from non-positional (and, by implication,
95 * optional) arguments. Note that CephBool is assumed to be non-positional
96 * and will also implicitly mark that any following arguments are
97 * non-positional.
98 *
9f95a23c 99 * Note that
7c673cae
FG
100 * - string literals are accumulated into 'prefix'
101 * - n=1 descriptors are given normal string or int object values
102 * - n=N descriptors are given array values
103 *
104 * NOTE: be careful with spaces. Each descriptor must be separated by
105 * one space, no other characters, so if you split lines as above, be
106 * sure to close and reopen the quotes, and be careful to include the '
107 * separating spaces in the quoted string.
108 *
109 * The monitor marshals this JSON into a std::map<string, cmd_vartype>
110 * where cmd_vartype is a boost::variant type-enforcing discriminated
111 * type, so the monitor is expected to know the type of each argument.
112 * See cmdparse.cc/h for more details.
113 *
114 * The flag parameter for COMMAND_WITH_FLAGS macro must be passed using
115 * FLAG(f), where 'f' may be one of the following:
116 *
117 * NONE - no flag assigned
118 * NOFORWARD - command may not be forwarded
119 * OBSOLETE - command is considered obsolete
120 * DEPRECATED - command is considered deprecated
121 * MGR - command goes to ceph-mgr (for luminous+)
11fdf7f2
TL
122 * POLL - command is intended to be called periodically by the
123 * client (see iostat)
124 * HIDDEN - command is hidden (no reported by help etc)
9f95a23c 125 * TELL - tell/asok command. it's an alias of (NOFORWARD | HIDDEN)
7c673cae
FG
126 *
127 * A command should always be first considered DEPRECATED before being
128 * considered OBSOLETE, giving due consideration to users and conforming
129 * to any guidelines regarding deprecating commands.
130 */
131
7c673cae 132COMMAND("pg map name=pgid,type=CephPgid", "show mapping of pg to osds", \
11fdf7f2
TL
133 "pg", "r")
134COMMAND("pg repeer name=pgid,type=CephPgid", "force a PG to repeer",
135 "osd", "rw")
31f18b77
FG
136COMMAND("osd last-stat-seq name=id,type=CephOsdName", \
137 "get the last pg stats sequence number reported for this osd", \
11fdf7f2 138 "osd", "r")
7c673cae
FG
139
140/*
141 * auth commands AuthMonitor.cc
142 */
143
144COMMAND("auth export name=entity,type=CephString,req=false", \
145 "write keyring for requested entity, or master keyring if none given", \
11fdf7f2 146 "auth", "rx")
7c673cae 147COMMAND("auth get name=entity,type=CephString", \
11fdf7f2 148 "write keyring file with requested key", "auth", "rx")
7c673cae 149COMMAND("auth get-key name=entity,type=CephString", "display requested key", \
11fdf7f2 150 "auth", "rx")
7c673cae 151COMMAND("auth print-key name=entity,type=CephString", "display requested key", \
11fdf7f2 152 "auth", "rx")
7c673cae 153COMMAND("auth print_key name=entity,type=CephString", "display requested key", \
11fdf7f2
TL
154 "auth", "rx")
155COMMAND_WITH_FLAG("auth list", "list authentication state", "auth", "rx",
c07f9fc5 156 FLAG(DEPRECATED))
11fdf7f2 157COMMAND("auth ls", "list authentication state", "auth", "rx")
9f95a23c 158COMMAND("auth import", "auth import: read keyring file from -i <file>",
11fdf7f2 159 "auth", "rwx")
9f95a23c
TL
160COMMAND("auth add "
161 "name=entity,type=CephString "
162 "name=caps,type=CephString,n=N,req=false",
163 "add auth info for <entity> from input file, or random key if no "
7c673cae 164 "input is given, and/or any caps specified in the command",
11fdf7f2 165 "auth", "rwx")
9f95a23c
TL
166COMMAND("auth get-or-create-key "
167 "name=entity,type=CephString "
168 "name=caps,type=CephString,n=N,req=false",
169 "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.",
11fdf7f2 170 "auth", "rwx")
9f95a23c
TL
171COMMAND("auth get-or-create "
172 "name=entity,type=CephString "
173 "name=caps,type=CephString,n=N,req=false",
174 "add auth info for <entity> from input file, or random key if no input given, and/or any caps specified in the command",
11fdf7f2 175 "auth", "rwx")
9f95a23c
TL
176COMMAND("fs authorize "
177 "name=filesystem,type=CephString "
178 "name=entity,type=CephString "
179 "name=caps,type=CephString,n=N",
180 "add auth for <entity> to access file system <filesystem> based on following directory and permissions pairs",
11fdf7f2 181 "auth", "rwx")
9f95a23c
TL
182COMMAND("auth caps "
183 "name=entity,type=CephString "
184 "name=caps,type=CephString,n=N",
185 "update caps for <name> from caps specified in the command",
11fdf7f2 186 "auth", "rwx")
9f95a23c
TL
187COMMAND_WITH_FLAG("auth del "
188 "name=entity,type=CephString",
189 "delete all caps for <name>",
190 "auth", "rwx",
11fdf7f2 191 FLAG(DEPRECATED))
9f95a23c
TL
192COMMAND("auth rm "
193 "name=entity,type=CephString",
194 "remove all caps for <name>",
11fdf7f2 195 "auth", "rwx")
7c673cae
FG
196
197/*
198 * Monitor commands (Monitor.cc)
199 */
9f95a23c
TL
200COMMAND_WITH_FLAG("compact", "cause compaction of monitor's leveldb/rocksdb storage",
201 "mon", "rw",
202 FLAG(TELL))
11fdf7f2 203COMMAND("fsid", "show cluster FSID/UUID", "mon", "r")
9f95a23c 204COMMAND("log name=logtext,type=CephString,n=N",
11fdf7f2 205 "log supplied text to the monitor log", "mon", "rw")
224ce89b
WB
206COMMAND("log last "
207 "name=num,type=CephInt,range=1,req=false "
208 "name=level,type=CephChoices,strings=debug|info|sec|warn|error,req=false "
9f95a23c
TL
209 "name=channel,type=CephChoices,strings=*|cluster|audit|cephadm,req=false",
210 "print last few lines of the cluster log",
11fdf7f2 211 "mon", "r")
11fdf7f2
TL
212
213COMMAND("status", "show cluster status", "mon", "r")
9f95a23c 214COMMAND("health name=detail,type=CephChoices,strings=detail,req=false",
11fdf7f2 215 "show cluster health", "mon", "r")
9f95a23c
TL
216COMMAND("health mute "\
217 "name=code,type=CephString "
218 "name=ttl,type=CephString,req=false "
219 "name=sticky,type=CephBool,req=false",
220 "mute health alert", "mon", "w")
221COMMAND("health unmute "\
222 "name=code,type=CephString,req=false",
223 "unmute existing health alert mute(s)", "mon", "w")
11fdf7f2 224COMMAND("time-sync-status", "show time sync status", "mon", "r")
9f95a23c 225COMMAND("df name=detail,type=CephChoices,strings=detail,req=false",
11fdf7f2 226 "show cluster free space stats", "mon", "r")
9f95a23c
TL
227COMMAND("report name=tags,type=CephString,n=N,req=false",
228 "report full status of cluster, optional title tag strings",
11fdf7f2 229 "mon", "r")
9f95a23c 230COMMAND("features", "report of connected features",
11fdf7f2 231 "mon", "r")
9f95a23c 232COMMAND("quorum_status", "report status of monitor quorum",
11fdf7f2 233 "mon", "r")
9f95a23c 234COMMAND("mon ok-to-stop "
11fdf7f2 235 "name=ids,type=CephString,n=N",
9f95a23c 236 "check whether mon(s) can be safely stopped without reducing immediate "
11fdf7f2
TL
237 "availability",
238 "mon", "r")
239COMMAND("mon ok-to-add-offline",
240 "check whether adding a mon and not starting it would break quorum",
241 "mon", "r")
9f95a23c 242COMMAND("mon ok-to-rm "
11fdf7f2
TL
243 "name=id,type=CephString",
244 "check whether removing the specified mon would break quorum",
245 "mon", "r")
7c673cae 246
9f95a23c
TL
247COMMAND("tell "
248 "name=target,type=CephName "
249 "name=args,type=CephString,n=N",
11fdf7f2
TL
250 "send a command to a specific daemon", "mon", "rw")
251COMMAND_WITH_FLAG("version", "show mon daemon version", "mon", "r",
9f95a23c 252 FLAG(TELL))
7c673cae 253
9f95a23c 254COMMAND("node ls "
11fdf7f2
TL
255 "name=type,type=CephChoices,strings=all|osd|mon|mds|mgr,req=false",
256 "list all nodes in cluster [type]", "mon", "r")
7c673cae
FG
257/*
258 * Monitor-specific commands under module 'mon'
259 */
7c673cae 260COMMAND_WITH_FLAG("mon scrub",
9f95a23c
TL
261 "scrub the monitor stores",
262 "mon", "rw",
7c673cae 263 FLAG(NONE))
7c673cae
FG
264COMMAND("mon metadata name=id,type=CephString,req=false",
265 "fetch metadata for mon <id>",
11fdf7f2 266 "mon", "r")
31f18b77
FG
267COMMAND("mon count-metadata name=property,type=CephString",
268 "count mons by metadata field property",
11fdf7f2 269 "mon", "r")
31f18b77
FG
270COMMAND("mon versions",
271 "check running versions of monitors",
11fdf7f2 272 "mon", "r")
c07f9fc5
FG
273COMMAND("versions",
274 "check running versions of ceph daemons",
11fdf7f2 275 "mon", "r")
c07f9fc5 276
7c673cae
FG
277
278
279/*
280 * MDS commands (MDSMonitor.cc)
281 */
282
20effc67 283#define FS_NAME_GOODCHARS "[A-Za-z0-9-_.]"
11fdf7f2 284COMMAND_WITH_FLAG("mds stat", "show MDS status", "mds", "r", FLAG(HIDDEN))
7c673cae 285COMMAND("fs dump "
9f95a23c 286 "name=epoch,type=CephInt,req=false,range=0",
11fdf7f2 287 "dump all CephFS status, optionally from epoch", "mds", "r")
7c673cae 288COMMAND("mds metadata name=who,type=CephString,req=false",
11fdf7f2
TL
289 "fetch metadata for mds <role>",
290 "mds", "r")
31f18b77
FG
291COMMAND("mds count-metadata name=property,type=CephString",
292 "count MDSs by metadata field property",
11fdf7f2 293 "mds", "r")
31f18b77
FG
294COMMAND("mds versions",
295 "check running versions of MDSs",
11fdf7f2 296 "mds", "r")
11fdf7f2
TL
297COMMAND("mds ok-to-stop name=ids,type=CephString,n=N",
298 "check whether stopping the specified MDS would reduce immediate availability",
299 "mds", "r")
11fdf7f2
TL
300COMMAND_WITH_FLAG("mds freeze name=role_or_gid,type=CephString"
301 " name=val,type=CephString",
302 "freeze MDS yes/no", "mds", "rw", FLAG(HIDDEN))
7c673cae
FG
303// arbitrary limit 0-20 below; worth standing on head to make it
304// relate to actual state definitions?
305// #include "include/ceph_fs.h"
9f95a23c
TL
306COMMAND_WITH_FLAG("mds set_state "
307 "name=gid,type=CephInt,range=0 "
308 "name=state,type=CephInt,range=0|20",
11fdf7f2 309 "set mds state of <gid> to <numeric-state>", "mds", "rw", FLAG(HIDDEN))
9f95a23c 310COMMAND("mds fail name=role_or_gid,type=CephString",
224ce89b 311 "Mark MDS failed: trigger a failover if a standby is available",
11fdf7f2 312 "mds", "rw")
9f95a23c 313COMMAND("mds repaired name=role,type=CephString",
11fdf7f2 314 "mark a damaged MDS rank as no longer damaged", "mds", "rw")
9f95a23c
TL
315COMMAND("mds rm "
316 "name=gid,type=CephInt,range=0",
11fdf7f2 317 "remove nonactive mds", "mds", "rw")
9f95a23c
TL
318COMMAND_WITH_FLAG("mds rmfailed name=role,type=CephString "
319 "name=yes_i_really_mean_it,type=CephBool,req=false",
11fdf7f2 320 "remove failed rank", "mds", "rw", FLAG(HIDDEN))
522d829b
TL
321COMMAND_WITH_FLAG("mds compat show", "show mds compatibility settings",
322 "mds", "r", FLAG(DEPRECATED))
323COMMAND("fs compat show "
324 "name=fs_name,type=CephString ",
325 "show fs compatibility settings",
326 "mds", "r")
327COMMAND_WITH_FLAG("mds compat rm_compat "
9f95a23c 328 "name=feature,type=CephInt,range=0",
522d829b
TL
329 "remove compatible feature", "mds", "rw", FLAG(DEPRECATED))
330COMMAND_WITH_FLAG("mds compat rm_incompat "
9f95a23c 331 "name=feature,type=CephInt,range=0",
522d829b 332 "remove incompatible feature", "mds", "rw", FLAG(DEPRECATED))
9f95a23c 333COMMAND("fs new "
20effc67
TL
334 "name=fs_name,type=CephString,goodchars=" FS_NAME_GOODCHARS
335 " name=metadata,type=CephString "
9f95a23c
TL
336 "name=data,type=CephString "
337 "name=force,type=CephBool,req=false "
522d829b 338 "name=allow_dangerous_metadata_overlay,type=CephBool,req=false "
20effc67
TL
339 "name=fscid,type=CephInt,range=0,req=false "
340 "name=recover,type=CephBool,req=false",
9f95a23c 341 "make new filesystem using named pools <metadata> and <data>",
11fdf7f2 342 "fs", "rw")
9f95a23c
TL
343COMMAND("fs fail "
344 "name=fs_name,type=CephString ",
345 "bring the file system down and all of its ranks",
11fdf7f2 346 "fs", "rw")
9f95a23c
TL
347COMMAND("fs rm "
348 "name=fs_name,type=CephString "
349 "name=yes_i_really_mean_it,type=CephBool,req=false",
350 "disable the named filesystem",
11fdf7f2 351 "fs", "rw")
9f95a23c
TL
352COMMAND("fs reset "
353 "name=fs_name,type=CephString "
354 "name=yes_i_really_mean_it,type=CephBool,req=false",
355 "disaster recovery only: reset to a single-MDS map",
11fdf7f2 356 "fs", "rw")
9f95a23c
TL
357COMMAND("fs ls ",
358 "list filesystems",
11fdf7f2 359 "fs", "r")
9f95a23c
TL
360COMMAND("fs get name=fs_name,type=CephString",
361 "get info about one filesystem",
11fdf7f2 362 "fs", "r")
9f95a23c
TL
363COMMAND("fs set "
364 "name=fs_name,type=CephString "
7c673cae 365 "name=var,type=CephChoices,strings=max_mds|max_file_size"
9f95a23c
TL
366 "|allow_new_snaps|inline_data|cluster_down|allow_dirfrags|balancer"
367 "|standby_count_wanted|session_timeout|session_autoclose"
368 "|allow_standby_replay|down|joinable|min_compat_client "
369 "name=val,type=CephString "
370 "name=yes_i_really_mean_it,type=CephBool,req=false "
371 "name=yes_i_really_really_mean_it,type=CephBool,req=false",
11fdf7f2 372 "set fs parameter <var> to <val>", "mds", "rw")
7c673cae 373COMMAND("fs flag set name=flag_name,type=CephChoices,strings=enable_multiple "
9f95a23c
TL
374 "name=val,type=CephString "
375 "name=yes_i_really_mean_it,type=CephBool,req=false",
376 "Set a global CephFS flag",
11fdf7f2 377 "fs", "rw")
f67539c2
TL
378
379COMMAND("fs feature ls",
380 "list available cephfs features to be set/unset",
381 "mds", "r")
382
20effc67
TL
383COMMAND("fs lsflags name=fs_name,type=CephString",
384 "list the flags set on a ceph filesystem",
385 "fs", "r")
386
522d829b
TL
387COMMAND("fs compat "
388 "name=fs_name,type=CephString "
389 "name=subop,type=CephChoices,strings=rm_compat|rm_incompat|add_compat|add_incompat "
390 "name=feature,type=CephInt "
391 "name=feature_str,type=CephString,req=false ",
392 "manipulate compat settings", "fs", "rw")
393
f67539c2
TL
394COMMAND("fs required_client_features "
395 "name=fs_name,type=CephString "
396 "name=subop,type=CephChoices,strings=add|rm "
397 "name=val,type=CephString ",
398 "add/remove required features of clients", "mds", "rw")
399
9f95a23c
TL
400COMMAND("fs add_data_pool name=fs_name,type=CephString "
401 "name=pool,type=CephString",
11fdf7f2 402 "add data pool <pool>", "mds", "rw")
9f95a23c
TL
403COMMAND("fs rm_data_pool name=fs_name,type=CephString "
404 "name=pool,type=CephString",
11fdf7f2 405 "remove data pool <pool>", "mds", "rw")
9f95a23c
TL
406COMMAND_WITH_FLAG("fs set_default name=fs_name,type=CephString",
407 "set the default to the named filesystem",
408 "fs", "rw",
7c673cae 409 FLAG(DEPRECATED))
9f95a23c
TL
410COMMAND("fs set-default name=fs_name,type=CephString",
411 "set the default to the named filesystem",
11fdf7f2 412 "fs", "rw")
f67539c2
TL
413COMMAND("fs mirror enable "
414 "name=fs_name,type=CephString ",
415 "enable mirroring for a ceph filesystem", "mds", "rw")
416COMMAND("fs mirror disable "
417 "name=fs_name,type=CephString ",
418 "disable mirroring for a ceph filesystem", "mds", "rw")
419COMMAND("fs mirror peer_add "
420 "name=fs_name,type=CephString "
421 "name=uuid,type=CephString "
422 "name=remote_cluster_spec,type=CephString "
423 "name=remote_fs_name,type=CephString",
424 "add a mirror peer for a ceph filesystem", "mds", "rw")
425COMMAND("fs mirror peer_remove "
426 "name=fs_name,type=CephString "
427 "name=uuid,type=CephString ",
428 "remove a mirror peer for a ceph filesystem", "mds", "rw")
20effc67
TL
429COMMAND("fs rename "
430 "name=fs_name,type=CephString "
431 "name=new_fs_name,type=CephString,goodchars=" FS_NAME_GOODCHARS
432 " name=yes_i_really_mean_it,type=CephBool,req=false",
433 "rename a ceph file system", "mds", "rw")
7c673cae
FG
434
435/*
436 * Monmap commands
437 */
9f95a23c
TL
438COMMAND("mon dump "
439 "name=epoch,type=CephInt,range=0,req=false",
440 "dump formatted monmap (optionally from epoch)",
11fdf7f2
TL
441 "mon", "r")
442COMMAND("mon stat", "summarize monitor status", "mon", "r")
9f95a23c
TL
443COMMAND("mon getmap "
444 "name=epoch,type=CephInt,range=0,req=false",
11fdf7f2 445 "get monmap", "mon", "r")
9f95a23c
TL
446COMMAND("mon add "
447 "name=name,type=CephString "
f67539c2
TL
448 "name=addr,type=CephIPAddr "
449 "name=location,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=],req=false",
450 "add new monitor named <name> at <addr>, possibly with CRUSH location <location>", "mon", "rw")
9f95a23c
TL
451COMMAND("mon rm "
452 "name=name,type=CephString",
11fdf7f2 453 "remove monitor named <name>", "mon", "rw")
9f95a23c
TL
454COMMAND_WITH_FLAG("mon remove "
455 "name=name,type=CephString",
456 "remove monitor named <name>", "mon", "rw",
11fdf7f2 457 FLAG(DEPRECATED))
9f95a23c 458COMMAND("mon feature ls "
20effc67 459 "name=with_value,type=CephBool,req=false",
9f95a23c 460 "list available mon map features to be set/unset",
11fdf7f2 461 "mon", "r")
9f95a23c
TL
462COMMAND("mon feature set "
463 "name=feature_name,type=CephString "
464 "name=yes_i_really_mean_it,type=CephBool,req=false",
465 "set provided feature on mon map",
11fdf7f2 466 "mon", "rw")
9f95a23c
TL
467COMMAND("mon set-rank "
468 "name=name,type=CephString "
11fdf7f2
TL
469 "name=rank,type=CephInt",
470 "set the rank for the specified mon",
471 "mon", "rw")
9f95a23c
TL
472COMMAND("mon set-addrs "
473 "name=name,type=CephString "
11fdf7f2
TL
474 "name=addrs,type=CephString",
475 "set the addrs (IPs and ports) a specific monitor binds to",
476 "mon", "rw")
9f95a23c
TL
477COMMAND("mon set-weight "
478 "name=name,type=CephString "
479 "name=weight,type=CephInt,range=0|65535",
480 "set the weight for the specified mon",
481 "mon", "rw")
11fdf7f2
TL
482COMMAND("mon enable-msgr2",
483 "enable the msgr2 protocol on port 3300",
484 "mon", "rw")
f67539c2
TL
485COMMAND("mon set election_strategy " \
486 "name=strategy,type=CephString", \
487 "set the election strategy to use; choices classic, disallow, connectivity", \
488 "mon", "rw")
489COMMAND("mon add disallowed_leader " \
490 "name=name,type=CephString", \
491 "prevent the named mon from being a leader", \
492 "mon", "rw")
493COMMAND("mon rm disallowed_leader " \
494 "name=name,type=CephString", \
495 "allow the named mon to be a leader again", \
496 "mon", "rw")
497COMMAND("mon set_location " \
498 "name=name,type=CephString "
499 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]",
500 "specify location <args> for the monitor <name>, using CRUSH bucket names", \
501 "mon", "rw")
502COMMAND("mon enable_stretch_mode " \
503 "name=tiebreaker_mon,type=CephString, "
504 "name=new_crush_rule,type=CephString, "
505 "name=dividing_bucket,type=CephString, ",
506 "enable stretch mode, changing the peering rules and "
507 "failure handling on all pools with <tiebreaker_mon> "
508 "as the tiebreaker and setting <dividing_bucket> locations "
509 "as the units for stretching across",
510 "mon", "rw")
a4b75251
TL
511COMMAND("mon set_new_tiebreaker " \
512 "name=name,type=CephString "
513 "name=yes_i_really_mean_it,type=CephBool,req=false",
514 "switch the stretch tiebreaker to be the named mon", \
515 "mon", "rw")
7c673cae
FG
516
517/*
518 * OSD commands
519 */
11fdf7f2 520COMMAND("osd stat", "print summary of OSD map", "osd", "r")
9f95a23c 521COMMAND("osd dump "
7c673cae 522 "name=epoch,type=CephInt,range=0,req=false",
11fdf7f2 523 "print summary of OSD map", "osd", "r")
9f95a23c
TL
524COMMAND("osd info "
525 "name=id,type=CephOsdName,req=false",
526 "print osd's {id} information (instead of all osds from map)",
527 "osd", "r")
528COMMAND("osd tree "
529 "name=epoch,type=CephInt,range=0,req=false "
530 "name=states,type=CephChoices,strings=up|down|in|out|destroyed,n=N,req=false",
11fdf7f2 531 "print OSD tree", "osd", "r")
9f95a23c
TL
532COMMAND("osd tree-from "
533 "name=epoch,type=CephInt,range=0,req=false "
534 "name=bucket,type=CephString "
535 "name=states,type=CephChoices,strings=up|down|in|out|destroyed,n=N,req=false",
11fdf7f2 536 "print OSD tree in bucket", "osd", "r")
9f95a23c
TL
537COMMAND("osd ls "
538 "name=epoch,type=CephInt,range=0,req=false",
11fdf7f2 539 "show all OSD ids", "osd", "r")
9f95a23c
TL
540COMMAND("osd getmap "
541 "name=epoch,type=CephInt,range=0,req=false",
11fdf7f2 542 "get OSD map", "osd", "r")
9f95a23c
TL
543COMMAND("osd getcrushmap "
544 "name=epoch,type=CephInt,range=0,req=false",
11fdf7f2
TL
545 "get CRUSH map", "osd", "r")
546COMMAND("osd getmaxosd", "show largest OSD id", "osd", "r")
9f95a23c 547COMMAND("osd ls-tree "
31f18b77 548 "name=epoch,type=CephInt,range=0,req=false "
9f95a23c
TL
549 "name=name,type=CephString,req=true",
550 "show OSD ids under bucket <name> in the CRUSH map",
11fdf7f2 551 "osd", "r")
9f95a23c
TL
552COMMAND("osd find "
553 "name=id,type=CephOsdName",
554 "find osd <id> in the CRUSH map and show its location",
11fdf7f2 555 "osd", "r")
9f95a23c
TL
556COMMAND("osd metadata "
557 "name=id,type=CephOsdName,req=false",
558 "fetch metadata for osd {id} (default all)",
11fdf7f2 559 "osd", "r")
31f18b77
FG
560COMMAND("osd count-metadata name=property,type=CephString",
561 "count OSDs by metadata field property",
11fdf7f2 562 "osd", "r")
9f95a23c 563COMMAND("osd versions",
31f18b77 564 "check running versions of OSDs",
11fdf7f2
TL
565 "osd", "r")
566COMMAND("osd numa-status",
567 "show NUMA status of OSDs",
568 "osd", "r")
9f95a23c
TL
569COMMAND("osd map "
570 "name=pool,type=CephPoolname "
571 "name=object,type=CephObjectname "
572 "name=nspace,type=CephString,req=false",
11fdf7f2 573 "find pg for <object> in <pool> with [namespace]", "osd", "r")
9f95a23c 574COMMAND_WITH_FLAG("osd lspools",
11fdf7f2
TL
575 "list pools", "osd", "r", FLAG(DEPRECATED))
576COMMAND_WITH_FLAG("osd crush rule list", "list crush rules", "osd", "r",
c07f9fc5 577 FLAG(DEPRECATED))
11fdf7f2 578COMMAND("osd crush rule ls", "list crush rules", "osd", "r")
9f95a23c
TL
579COMMAND("osd crush rule ls-by-class "
580 "name=class,type=CephString,goodchars=[A-Za-z0-9-_.]",
581 "list all crush rules that reference the same <class>",
11fdf7f2 582 "osd", "r")
9f95a23c
TL
583COMMAND("osd crush rule dump "
584 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.],req=false",
585 "dump crush rule <name> (default all)",
11fdf7f2 586 "osd", "r")
9f95a23c
TL
587COMMAND("osd crush dump",
588 "dump crush map",
11fdf7f2 589 "osd", "r")
9f95a23c
TL
590COMMAND("osd setcrushmap name=prior_version,type=CephInt,req=false",
591 "set crush map from input file",
11fdf7f2 592 "osd", "rw")
9f95a23c
TL
593COMMAND("osd crush set name=prior_version,type=CephInt,req=false",
594 "set crush map from input file",
11fdf7f2 595 "osd", "rw")
9f95a23c
TL
596COMMAND("osd crush add-bucket "
597 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
598 "name=type,type=CephString "
599 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=],req=false",
600 "add no-parent (probably root) crush bucket <name> of type <type> "
601 "to location <args>",
11fdf7f2 602 "osd", "rw")
9f95a23c
TL
603COMMAND("osd crush rename-bucket "
604 "name=srcname,type=CephString,goodchars=[A-Za-z0-9-_.] "
605 "name=dstname,type=CephString,goodchars=[A-Za-z0-9-_.]",
606 "rename bucket <srcname> to <dstname>",
11fdf7f2 607 "osd", "rw")
9f95a23c
TL
608COMMAND("osd crush set "
609 "name=id,type=CephOsdName "
610 "name=weight,type=CephFloat,range=0.0 "
611 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]",
612 "update crushmap position and weight for <name> to <weight> with location <args>",
11fdf7f2 613 "osd", "rw")
9f95a23c
TL
614COMMAND("osd crush add "
615 "name=id,type=CephOsdName "
616 "name=weight,type=CephFloat,range=0.0 "
617 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]",
618 "add or update crushmap position and weight for <name> with <weight> and location <args>",
11fdf7f2 619 "osd", "rw")
3efd9988
FG
620COMMAND("osd crush set-all-straw-buckets-to-straw2",
621 "convert all CRUSH current straw buckets to use the straw2 algorithm",
11fdf7f2 622 "osd", "rw")
9f95a23c
TL
623COMMAND("osd crush class create "
624 "name=class,type=CephString,goodchars=[A-Za-z0-9-_]",
625 "create crush device class <class>",
11fdf7f2 626 "osd", "rw")
9f95a23c
TL
627COMMAND("osd crush class rm "
628 "name=class,type=CephString,goodchars=[A-Za-z0-9-_]",
629 "remove crush device class <class>",
11fdf7f2 630 "osd", "rw")
9f95a23c
TL
631COMMAND("osd crush set-device-class "
632 "name=class,type=CephString "
633 "name=ids,type=CephString,n=N",
634 "set the <class> of the osd(s) <id> [<id>...],"
635 "or use <all|any> to set all.",
11fdf7f2 636 "osd", "rw")
9f95a23c
TL
637COMMAND("osd crush rm-device-class "
638 "name=ids,type=CephString,n=N",
639 "remove class of the osd(s) <id> [<id>...],"
640 "or use <all|any> to remove all.",
11fdf7f2 641 "osd", "rw")
9f95a23c
TL
642COMMAND("osd crush class rename "
643 "name=srcname,type=CephString,goodchars=[A-Za-z0-9-_] "
644 "name=dstname,type=CephString,goodchars=[A-Za-z0-9-_]",
645 "rename crush device class <srcname> to <dstname>",
11fdf7f2 646 "osd", "rw")
9f95a23c
TL
647COMMAND("osd crush create-or-move "
648 "name=id,type=CephOsdName "
649 "name=weight,type=CephFloat,range=0.0 "
650 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]",
651 "create entry or move existing entry for <name> <weight> at/to location <args>",
11fdf7f2 652 "osd", "rw")
9f95a23c
TL
653COMMAND("osd crush move "
654 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
655 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]",
656 "move existing entry for <name> to location <args>",
11fdf7f2 657 "osd", "rw")
9f95a23c
TL
658COMMAND("osd crush swap-bucket "
659 "name=source,type=CephString,goodchars=[A-Za-z0-9-_.] "
660 "name=dest,type=CephString,goodchars=[A-Za-z0-9-_.] "
661 "name=yes_i_really_mean_it,type=CephBool,req=false",
662 "swap existing bucket contents from (orphan) bucket <source> and <target>",
11fdf7f2 663 "osd", "rw")
9f95a23c
TL
664COMMAND("osd crush link "
665 "name=name,type=CephString "
666 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]",
667 "link existing entry for <name> under location <args>",
11fdf7f2 668 "osd", "rw")
9f95a23c
TL
669COMMAND("osd crush rm "
670 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
671 "name=ancestor,type=CephString,req=false,goodchars=[A-Za-z0-9-_.]",
7c673cae 672 "remove <name> from crush map (everywhere, or just at <ancestor>)",\
11fdf7f2 673 "osd", "rw")
9f95a23c
TL
674COMMAND_WITH_FLAG("osd crush remove "
675 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
676 "name=ancestor,type=CephString,req=false,goodchars=[A-Za-z0-9-_.]",
677 "remove <name> from crush map (everywhere, or just at <ancestor>)",
678 "osd", "rw",
11fdf7f2 679 FLAG(DEPRECATED))
9f95a23c
TL
680COMMAND("osd crush unlink "
681 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
682 "name=ancestor,type=CephString,req=false,goodchars=[A-Za-z0-9-_.]",
683 "unlink <name> from crush map (everywhere, or just at <ancestor>)",
11fdf7f2 684 "osd", "rw")
7c673cae
FG
685COMMAND("osd crush reweight-all",
686 "recalculate the weights for the tree to ensure they sum correctly",
11fdf7f2 687 "osd", "rw")
9f95a23c
TL
688COMMAND("osd crush reweight "
689 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
690 "name=weight,type=CephFloat,range=0.0",
691 "change <name>'s weight to <weight> in crush map",
11fdf7f2 692 "osd", "rw")
9f95a23c
TL
693COMMAND("osd crush reweight-subtree "
694 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
695 "name=weight,type=CephFloat,range=0.0",
696 "change all leaf items beneath <name> to <weight> in crush map",
11fdf7f2 697 "osd", "rw")
9f95a23c
TL
698COMMAND("osd crush tunables "
699 "name=profile,type=CephChoices,strings=legacy|argonaut|bobtail|firefly|hammer|jewel|optimal|default",
11fdf7f2 700 "set crush tunables values to <profile>", "osd", "rw")
9f95a23c
TL
701COMMAND("osd crush set-tunable "
702 "name=tunable,type=CephChoices,strings=straw_calc_version "
7c673cae
FG
703 "name=value,type=CephInt",
704 "set crush tunable <tunable> to <value>",
11fdf7f2 705 "osd", "rw")
9f95a23c 706COMMAND("osd crush get-tunable "
7c673cae
FG
707 "name=tunable,type=CephChoices,strings=straw_calc_version",
708 "get crush tunable <tunable>",
11fdf7f2 709 "osd", "r")
9f95a23c 710COMMAND("osd crush show-tunables",
11fdf7f2 711 "show current crush tunables", "osd", "r")
9f95a23c
TL
712COMMAND("osd crush rule create-simple "
713 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
714 "name=root,type=CephString,goodchars=[A-Za-z0-9-_.] "
715 "name=type,type=CephString,goodchars=[A-Za-z0-9-_.] "
7c673cae 716 "name=mode,type=CephChoices,strings=firstn|indep,req=false",
9f95a23c 717 "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)",
11fdf7f2 718 "osd", "rw")
9f95a23c
TL
719COMMAND("osd crush rule create-replicated "
720 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
721 "name=root,type=CephString,goodchars=[A-Za-z0-9-_.] "
722 "name=type,type=CephString,goodchars=[A-Za-z0-9-_.] "
224ce89b 723 "name=class,type=CephString,goodchars=[A-Za-z0-9-_.],req=false",
9f95a23c 724 "create crush rule <name> for replicated pool to start from <root>, replicate across buckets of type <type>, use devices of type <class> (ssd or hdd)",
11fdf7f2 725 "osd", "rw")
9f95a23c
TL
726COMMAND("osd crush rule create-erasure "
727 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
728 "name=profile,type=CephString,req=false,goodchars=[A-Za-z0-9-_.=]",
729 "create crush rule <name> for erasure coded pool created with <profile> (default default)",
11fdf7f2 730 "osd", "rw")
9f95a23c
TL
731COMMAND("osd crush rule rm "
732 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] ",
11fdf7f2 733 "remove crush rule <name>", "osd", "rw")
9f95a23c
TL
734COMMAND("osd crush rule rename "
735 "name=srcname,type=CephString,goodchars=[A-Za-z0-9-_.] "
736 "name=dstname,type=CephString,goodchars=[A-Za-z0-9-_.]",
b5b8bbf5 737 "rename crush rule <srcname> to <dstname>",
11fdf7f2 738 "osd", "rw")
c07f9fc5 739COMMAND("osd crush tree "
20effc67 740 "name=show_shadow,type=CephBool,req=false",
7c673cae 741 "dump crush buckets and items in a tree view",
11fdf7f2
TL
742 "osd", "r")
743COMMAND("osd crush ls name=node,type=CephString,goodchars=[A-Za-z0-9-_.]",
d2e6a577 744 "list items beneath a node in the CRUSH tree",
11fdf7f2 745 "osd", "r")
9f95a23c
TL
746COMMAND("osd crush class ls",
747 "list all crush device classes",
11fdf7f2 748 "osd", "r")
9f95a23c
TL
749COMMAND("osd crush class ls-osd "
750 "name=class,type=CephString,goodchars=[A-Za-z0-9-_]",
751 "list all osds belonging to the specific <class>",
11fdf7f2 752 "osd", "r")
9f95a23c
TL
753COMMAND("osd crush get-device-class "
754 "name=ids,type=CephString,n=N",
755 "get classes of specified osd(s) <id> [<id>...]",
11fdf7f2 756 "osd", "r")
c07f9fc5
FG
757COMMAND("osd crush weight-set ls",
758 "list crush weight sets",
11fdf7f2 759 "osd", "r")
c07f9fc5
FG
760COMMAND("osd crush weight-set dump",
761 "dump crush weight sets",
11fdf7f2 762 "osd", "r")
c07f9fc5
FG
763COMMAND("osd crush weight-set create-compat",
764 "create a default backward-compatible weight-set",
11fdf7f2 765 "osd", "rw")
9f95a23c 766COMMAND("osd crush weight-set create "
c07f9fc5
FG
767 "name=pool,type=CephPoolname "\
768 "name=mode,type=CephChoices,strings=flat|positional",
769 "create a weight-set for a given pool",
11fdf7f2 770 "osd", "rw")
c07f9fc5
FG
771COMMAND("osd crush weight-set rm name=pool,type=CephPoolname",
772 "remove the weight-set for a given pool",
11fdf7f2 773 "osd", "rw")
c07f9fc5
FG
774COMMAND("osd crush weight-set rm-compat",
775 "remove the backward-compatible weight-set",
11fdf7f2 776 "osd", "rw")
9f95a23c
TL
777COMMAND("osd crush weight-set reweight "
778 "name=pool,type=CephPoolname "
779 "name=item,type=CephString "
c07f9fc5
FG
780 "name=weight,type=CephFloat,range=0.0,n=N",
781 "set weight for an item (bucket or osd) in a pool's weight-set",
11fdf7f2 782 "osd", "rw")
9f95a23c
TL
783COMMAND("osd crush weight-set reweight-compat "
784 "name=item,type=CephString "
c07f9fc5
FG
785 "name=weight,type=CephFloat,range=0.0,n=N",
786 "set weight for an item (bucket or osd) in the backward-compatible weight-set",
11fdf7f2 787 "osd", "rw")
9f95a23c
TL
788COMMAND("osd setmaxosd "
789 "name=newmax,type=CephInt,range=0",
11fdf7f2 790 "set new maximum osd value", "osd", "rw")
9f95a23c
TL
791COMMAND("osd set-full-ratio "
792 "name=ratio,type=CephFloat,range=0.0|1.0",
7c673cae 793 "set usage ratio at which OSDs are marked full",
11fdf7f2 794 "osd", "rw")
9f95a23c
TL
795COMMAND("osd set-backfillfull-ratio "
796 "name=ratio,type=CephFloat,range=0.0|1.0",
7c673cae 797 "set usage ratio at which OSDs are marked too full to backfill",
11fdf7f2 798 "osd", "rw")
9f95a23c
TL
799COMMAND("osd set-nearfull-ratio "
800 "name=ratio,type=CephFloat,range=0.0|1.0",
7c673cae 801 "set usage ratio at which OSDs are marked near-full",
11fdf7f2
TL
802 "osd", "rw")
803COMMAND("osd get-require-min-compat-client",
804 "get the minimum client version we will maintain compatibility with",
805 "osd", "r")
9f95a23c
TL
806COMMAND("osd set-require-min-compat-client "
807 "name=version,type=CephString "
808 "name=yes_i_really_mean_it,type=CephBool,req=false",
7c673cae 809 "set the minimum client version we will maintain compatibility with",
11fdf7f2
TL
810 "osd", "rw")
811COMMAND("osd pause", "pause osd", "osd", "rw")
812COMMAND("osd unpause", "unpause osd", "osd", "rw")
9f95a23c
TL
813COMMAND("osd erasure-code-profile set "
814 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
815 "name=profile,type=CephString,n=N,req=false "
816 "name=force,type=CephBool,req=false",
817 "create erasure code profile <name> with [<key[=value]> ...] pairs. Add a --force at the end to override an existing profile (VERY DANGEROUS)",
11fdf7f2 818 "osd", "rw")
9f95a23c
TL
819COMMAND("osd erasure-code-profile get "
820 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.]",
821 "get erasure code profile <name>",
11fdf7f2 822 "osd", "r")
9f95a23c
TL
823COMMAND("osd erasure-code-profile rm "
824 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.]",
825 "remove erasure code profile <name>",
11fdf7f2 826 "osd", "rw")
9f95a23c
TL
827COMMAND("osd erasure-code-profile ls",
828 "list all erasure code profiles",
11fdf7f2 829 "osd", "r")
9f95a23c
TL
830COMMAND("osd set "
831 "name=key,type=CephChoices,strings=full|pause|noup|nodown|"
832 "noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|"
833 "notieragent|nosnaptrim|pglog_hardlimit "
834 "name=yes_i_really_mean_it,type=CephBool,req=false",
11fdf7f2 835 "set <key>", "osd", "rw")
9f95a23c 836COMMAND("osd unset "
11fdf7f2 837 "name=key,type=CephChoices,strings=full|pause|noup|nodown|"\
9f95a23c
TL
838 "noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|"
839 "notieragent|nosnaptrim",
11fdf7f2 840 "unset <key>", "osd", "rw")
31f18b77 841COMMAND("osd require-osd-release "\
20effc67 842 "name=release,type=CephChoices,strings=octopus|pacific|quincy "
9f95a23c 843 "name=yes_i_really_mean_it,type=CephBool,req=false",
31f18b77 844 "set the minimum allowed OSD release to participate in the cluster",
11fdf7f2 845 "osd", "rw")
9f95a23c
TL
846COMMAND("osd down "
847 "name=ids,type=CephString,n=N "
848 "name=definitely_dead,type=CephBool,req=false",
849 "set osd(s) <id> [<id>...] down, "
850 "or use <any|all> to set all osds down",
11fdf7f2 851 "osd", "rw")
9f95a23c
TL
852COMMAND("osd stop "
853 "type=CephString,name=ids,n=N",
854 "stop the corresponding osd daemons and mark them as down",
11fdf7f2 855 "osd", "rw")
9f95a23c
TL
856COMMAND("osd out "
857 "name=ids,type=CephString,n=N",
858 "set osd(s) <id> [<id>...] out, "
859 "or use <any|all> to set all osds out",
860 "osd", "rw")
861COMMAND("osd in "
862 "name=ids,type=CephString,n=N",
31f18b77 863 "set osd(s) <id> [<id>...] in, "
9f95a23c 864 "can use <any|all> to automatically set all previously out osds in",
11fdf7f2 865 "osd", "rw")
9f95a23c
TL
866COMMAND_WITH_FLAG("osd rm "
867 "name=ids,type=CephString,n=N",
31f18b77 868 "remove osd(s) <id> [<id>...], "
9f95a23c 869 "or use <any|all> to remove all osds",
11fdf7f2
TL
870 "osd", "rw",
871 FLAG(DEPRECATED))
9f95a23c
TL
872COMMAND_WITH_FLAG("osd add-noup "
873 "name=ids,type=CephString,n=N",
874 "mark osd(s) <id> [<id>...] as noup, "
875 "or use <all|any> to mark all osds as noup",
81eedcae
TL
876 "osd", "rw",
877 FLAG(DEPRECATED))
9f95a23c
TL
878COMMAND_WITH_FLAG("osd add-nodown "
879 "name=ids,type=CephString,n=N",
880 "mark osd(s) <id> [<id>...] as nodown, "
881 "or use <all|any> to mark all osds as nodown",
81eedcae
TL
882 "osd", "rw",
883 FLAG(DEPRECATED))
9f95a23c
TL
884COMMAND_WITH_FLAG("osd add-noin "
885 "name=ids,type=CephString,n=N",
886 "mark osd(s) <id> [<id>...] as noin, "
887 "or use <all|any> to mark all osds as noin",
81eedcae
TL
888 "osd", "rw",
889 FLAG(DEPRECATED))
9f95a23c
TL
890COMMAND_WITH_FLAG("osd add-noout "
891 "name=ids,type=CephString,n=N",
892 "mark osd(s) <id> [<id>...] as noout, "
893 "or use <all|any> to mark all osds as noout",
81eedcae
TL
894 "osd", "rw",
895 FLAG(DEPRECATED))
9f95a23c
TL
896COMMAND_WITH_FLAG("osd rm-noup "
897 "name=ids,type=CephString,n=N",
898 "allow osd(s) <id> [<id>...] to be marked up "
899 "(if they are currently marked as noup), "
900 "can use <all|any> to automatically filter out all noup osds",
81eedcae
TL
901 "osd", "rw",
902 FLAG(DEPRECATED))
9f95a23c
TL
903COMMAND_WITH_FLAG("osd rm-nodown "
904 "name=ids,type=CephString,n=N",
905 "allow osd(s) <id> [<id>...] to be marked down "
906 "(if they are currently marked as nodown), "
907 "can use <all|any> to automatically filter out all nodown osds",
81eedcae
TL
908 "osd", "rw",
909 FLAG(DEPRECATED))
9f95a23c
TL
910COMMAND_WITH_FLAG("osd rm-noin "
911 "name=ids,type=CephString,n=N",
912 "allow osd(s) <id> [<id>...] to be marked in "
913 "(if they are currently marked as noin), "
914 "can use <all|any> to automatically filter out all noin osds",
81eedcae
TL
915 "osd", "rw",
916 FLAG(DEPRECATED))
9f95a23c
TL
917COMMAND_WITH_FLAG("osd rm-noout "
918 "name=ids,type=CephString,n=N",
919 "allow osd(s) <id> [<id>...] to be marked out "
920 "(if they are currently marked as noout), "
921 "can use <all|any> to automatically filter out all noout osds",
81eedcae
TL
922 "osd", "rw",
923 FLAG(DEPRECATED))
9f95a23c 924COMMAND("osd set-group "
81eedcae 925 "name=flags,type=CephString "
9f95a23c
TL
926 "name=who,type=CephString,n=N",
927 "set <flags> for batch osds or crush nodes, "
928 "<flags> must be a comma-separated subset of {noup,nodown,noin,noout}",
81eedcae 929 "osd", "rw")
9f95a23c 930COMMAND("osd unset-group "
81eedcae 931 "name=flags,type=CephString "
9f95a23c
TL
932 "name=who,type=CephString,n=N",
933 "unset <flags> for batch osds or crush nodes, "
934 "<flags> must be a comma-separated subset of {noup,nodown,noin,noout}",
11fdf7f2 935 "osd", "rw")
9f95a23c
TL
936COMMAND("osd reweight "
937 "name=id,type=CephOsdName "
938 "type=CephFloat,name=weight,range=0.0|1.0",
11fdf7f2 939 "reweight osd to 0.0 < <weight> < 1.0", "osd", "rw")
9f95a23c 940COMMAND("osd reweightn "
7c673cae 941 "name=weights,type=CephString",
f67539c2 942 "reweight osds with {<id>: <weight>,...}",
11fdf7f2 943 "osd", "rw")
9f95a23c 944COMMAND("osd force-create-pg "
11fdf7f2 945 "name=pgid,type=CephPgid "\
9f95a23c 946 "name=yes_i_really_mean_it,type=CephBool,req=false",
c07f9fc5 947 "force creation of pg <pgid>",
11fdf7f2 948 "osd", "rw")
9f95a23c
TL
949COMMAND("osd pg-temp "
950 "name=pgid,type=CephPgid "
951 "name=id,type=CephOsdName,n=N,req=false",
952 "set pg_temp mapping pgid:[<id> [<id>...]] (developers only)",
11fdf7f2 953 "osd", "rw")
9f95a23c
TL
954COMMAND("osd pg-upmap "
955 "name=pgid,type=CephPgid "
956 "name=id,type=CephOsdName,n=N",
957 "set pg_upmap mapping <pgid>:[<id> [<id>...]] (developers only)",
11fdf7f2 958 "osd", "rw")
9f95a23c
TL
959COMMAND("osd rm-pg-upmap "
960 "name=pgid,type=CephPgid",
961 "clear pg_upmap mapping for <pgid> (developers only)",
11fdf7f2 962 "osd", "rw")
9f95a23c
TL
963COMMAND("osd pg-upmap-items "
964 "name=pgid,type=CephPgid "
965 "name=id,type=CephOsdName,n=N",
966 "set pg_upmap_items mapping <pgid>:{<id> to <id>, [...]} (developers only)",
11fdf7f2 967 "osd", "rw")
9f95a23c
TL
968COMMAND("osd rm-pg-upmap-items "
969 "name=pgid,type=CephPgid",
970 "clear pg_upmap_items mapping for <pgid> (developers only)",
11fdf7f2 971 "osd", "rw")
9f95a23c
TL
972COMMAND("osd primary-temp "
973 "name=pgid,type=CephPgid "
974 "name=id,type=CephOsdName",
975 "set primary_temp mapping pgid:<id>|-1 (developers only)",
11fdf7f2 976 "osd", "rw")
9f95a23c
TL
977COMMAND("osd primary-affinity "
978 "name=id,type=CephOsdName "
979 "type=CephFloat,name=weight,range=0.0|1.0",
980 "adjust osd primary-affinity from 0.0 <= <weight> <= 1.0",
11fdf7f2 981 "osd", "rw")
9f95a23c
TL
982COMMAND_WITH_FLAG("osd destroy-actual "
983 "name=id,type=CephOsdName "
984 "name=yes_i_really_mean_it,type=CephBool,req=false",
985 "mark osd as being destroyed. Keeps the ID intact (allowing reuse), "
31f18b77 986 "but removes cephx keys, config-key data and lockbox keys, "\
9f95a23c 987 "rendering data permanently unreadable.",
11fdf7f2 988 "osd", "rw", FLAG(HIDDEN))
9f95a23c
TL
989COMMAND("osd purge-new "
990 "name=id,type=CephOsdName "
991 "name=yes_i_really_mean_it,type=CephBool,req=false",
992 "purge all traces of an OSD that was partially created but never "
993 "started",
11fdf7f2 994 "osd", "rw")
9f95a23c
TL
995COMMAND_WITH_FLAG("osd purge-actual "
996 "name=id,type=CephOsdName "
997 "name=yes_i_really_mean_it,type=CephBool,req=false",
998 "purge all osd data from the monitors. Combines `osd destroy`, "
999 "`osd rm`, and `osd crush rm`.",
11fdf7f2 1000 "osd", "rw", FLAG(HIDDEN))
9f95a23c
TL
1001COMMAND("osd lost "
1002 "name=id,type=CephOsdName "
1003 "name=yes_i_really_mean_it,type=CephBool,req=false",
1004 "mark osd as permanently lost. THIS DESTROYS DATA IF NO MORE REPLICAS EXIST, BE CAREFUL",
11fdf7f2 1005 "osd", "rw")
9f95a23c
TL
1006COMMAND_WITH_FLAG("osd create "
1007 "name=uuid,type=CephUUID,req=false "
1008 "name=id,type=CephOsdName,req=false",
11fdf7f2 1009 "create new osd (with optional UUID and ID)", "osd", "rw",
31f18b77 1010 FLAG(DEPRECATED))
9f95a23c
TL
1011COMMAND("osd new "
1012 "name=uuid,type=CephUUID,req=true "
1013 "name=id,type=CephOsdName,req=false",
1014 "Create a new OSD. If supplied, the `id` to be replaced needs to "
1015 "exist and have been previously destroyed. "
1016 "Reads secrets from JSON file via `-i <file>` (see man page).",
11fdf7f2 1017 "osd", "rw")
f67539c2
TL
1018COMMAND("osd blocklist "
1019 "name=blocklistop,type=CephChoices,strings=add|rm "
1020 "name=addr,type=CephEntityAddr "
1021 "name=expire,type=CephFloat,range=0.0,req=false",
1022 "add (optionally until <expire> seconds from now) or remove <addr> from blocklist",
1023 "osd", "rw")
1024COMMAND("osd blocklist ls", "show blocklisted clients", "osd", "r")
1025COMMAND("osd blocklist clear", "clear all blocklisted clients", "osd", "rw")
1026
1027COMMAND_WITH_FLAG("osd blacklist "
9f95a23c
TL
1028 "name=blacklistop,type=CephChoices,strings=add|rm "
1029 "name=addr,type=CephEntityAddr "
1030 "name=expire,type=CephFloat,range=0.0,req=false",
1031 "add (optionally until <expire> seconds from now) or remove <addr> from blacklist",
f67539c2
TL
1032 "osd", "rw",
1033 FLAG(DEPRECATED))
1034COMMAND_WITH_FLAG("osd blacklist ls", "show blacklisted clients", "osd", "r",
1035 FLAG(DEPRECATED))
1036COMMAND_WITH_FLAG("osd blacklist clear", "clear all blacklisted clients", "osd", "rw",
1037 FLAG(DEPRECATED))
1038
9f95a23c
TL
1039COMMAND("osd pool mksnap "
1040 "name=pool,type=CephPoolname "
1041 "name=snap,type=CephString",
11fdf7f2 1042 "make snapshot <snap> in <pool>", "osd", "rw")
9f95a23c
TL
1043COMMAND("osd pool rmsnap "
1044 "name=pool,type=CephPoolname "
1045 "name=snap,type=CephString",
11fdf7f2 1046 "remove snapshot <snap> from <pool>", "osd", "rw")
9f95a23c
TL
1047COMMAND("osd pool ls "
1048 "name=detail,type=CephChoices,strings=detail,req=false",
11fdf7f2 1049 "list pools", "osd", "r")
9f95a23c
TL
1050COMMAND("osd pool create "
1051 "name=pool,type=CephPoolname "
1052 "name=pg_num,type=CephInt,range=0,req=false "
1053 "name=pgp_num,type=CephInt,range=0,req=false "
1054 "name=pool_type,type=CephChoices,strings=replicated|erasure,req=false "
1055 "name=erasure_code_profile,type=CephString,req=false,goodchars=[A-Za-z0-9-_.] "
1056 "name=rule,type=CephString,req=false "
1057 "name=expected_num_objects,type=CephInt,range=0,req=false "
1058 "name=size,type=CephInt,range=0,req=false "
1059 "name=pg_num_min,type=CephInt,range=0,req=false "
20effc67 1060 "name=pg_num_max,type=CephInt,range=0,req=false "
9f95a23c 1061 "name=autoscale_mode,type=CephChoices,strings=on|off|warn,req=false "
20effc67 1062 "name=bulk,type=CephBool,req=false "
9f95a23c 1063 "name=target_size_bytes,type=CephInt,range=0,req=false "
11fdf7f2
TL
1064 "name=target_size_ratio,type=CephFloat,range=0|1,req=false",\
1065 "create pool", "osd", "rw")
9f95a23c
TL
1066COMMAND_WITH_FLAG("osd pool delete "
1067 "name=pool,type=CephPoolname "
1068 "name=pool2,type=CephPoolname,req=false "
11fdf7f2 1069 "name=yes_i_really_really_mean_it,type=CephBool,req=false "
9f95a23c
TL
1070 "name=yes_i_really_really_mean_it_not_faking,type=CephBool,req=false ",
1071 "delete pool",
1072 "osd", "rw",
11fdf7f2 1073 FLAG(DEPRECATED))
9f95a23c
TL
1074COMMAND("osd pool rm "
1075 "name=pool,type=CephPoolname "
1076 "name=pool2,type=CephPoolname,req=false "
11fdf7f2 1077 "name=yes_i_really_really_mean_it,type=CephBool,req=false "
9f95a23c
TL
1078 "name=yes_i_really_really_mean_it_not_faking,type=CephBool,req=false ",
1079 "remove pool",
11fdf7f2 1080 "osd", "rw")
9f95a23c
TL
1081COMMAND("osd pool rename "
1082 "name=srcpool,type=CephPoolname "
1083 "name=destpool,type=CephPoolname",
11fdf7f2 1084 "rename <srcpool> to <destpool>", "osd", "rw")
9f95a23c
TL
1085COMMAND("osd pool get "
1086 "name=pool,type=CephPoolname "
20effc67 1087 "name=var,type=CephChoices,strings=size|min_size|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_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|fingerprint_algorithm|pg_autoscale_mode|pg_autoscale_bias|pg_num_min|pg_num_max|target_size_bytes|target_size_ratio|dedup_tier|dedup_chunk_algorithm|dedup_cdc_chunk_size|eio|bulk",
11fdf7f2 1088 "get pool parameter <var>", "osd", "r")
9f95a23c
TL
1089COMMAND("osd pool set "
1090 "name=pool,type=CephPoolname "
20effc67 1091 "name=var,type=CephChoices,strings=size|min_size|pg_num|pgp_num|pgp_num_actual|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|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|fingerprint_algorithm|pg_autoscale_mode|pg_autoscale_bias|pg_num_min|pg_num_max|target_size_bytes|target_size_ratio|dedup_tier|dedup_chunk_algorithm|dedup_cdc_chunk_size|eio|bulk "
9f95a23c
TL
1092 "name=val,type=CephString "
1093 "name=yes_i_really_mean_it,type=CephBool,req=false",
11fdf7f2 1094 "set pool parameter <var> to <val>", "osd", "rw")
7c673cae
FG
1095// 'val' is a CephString because it can include a unit. Perhaps
1096// there should be a Python type for validation/conversion of strings
1097// with units.
9f95a23c
TL
1098COMMAND("osd pool set-quota "
1099 "name=pool,type=CephPoolname "
1100 "name=field,type=CephChoices,strings=max_objects|max_bytes "
7c673cae 1101 "name=val,type=CephString",
11fdf7f2 1102 "set object or byte limit on pool", "osd", "rw")
9f95a23c 1103COMMAND("osd pool get-quota "
7c673cae
FG
1104 "name=pool,type=CephPoolname ",
1105 "obtain object or byte limits for pool",
11fdf7f2 1106 "osd", "r")
9f95a23c
TL
1107COMMAND("osd pool application enable "
1108 "name=pool,type=CephPoolname "
1109 "name=app,type=CephString,goodchars=[A-Za-z0-9-_.] "
1110 "name=yes_i_really_mean_it,type=CephBool,req=false",
c07f9fc5 1111 "enable use of an application <app> [cephfs,rbd,rgw] on pool <poolname>",
11fdf7f2 1112 "osd", "rw")
9f95a23c
TL
1113COMMAND("osd pool application disable "
1114 "name=pool,type=CephPoolname "
1115 "name=app,type=CephString "
1116 "name=yes_i_really_mean_it,type=CephBool,req=false",
c07f9fc5 1117 "disables use of an application <app> on pool <poolname>",
11fdf7f2 1118 "osd", "rw")
9f95a23c
TL
1119COMMAND("osd pool application set "
1120 "name=pool,type=CephPoolname "
1121 "name=app,type=CephString "
1122 "name=key,type=CephString,goodchars=[A-Za-z0-9-_.] "
c07f9fc5
FG
1123 "name=value,type=CephString,goodchars=[A-Za-z0-9-_.=]",
1124 "sets application <app> metadata key <key> to <value> on pool <poolname>",
11fdf7f2 1125 "osd", "rw")
9f95a23c
TL
1126COMMAND("osd pool application rm "
1127 "name=pool,type=CephPoolname "
1128 "name=app,type=CephString "
c07f9fc5
FG
1129 "name=key,type=CephString",
1130 "removes application <app> metadata key <key> on pool <poolname>",
11fdf7f2 1131 "osd", "rw")
9f95a23c
TL
1132COMMAND("osd pool application get "
1133 "name=pool,type=CephPoolname,req=fasle "
1134 "name=app,type=CephString,req=false "
181888fb
FG
1135 "name=key,type=CephString,req=false",
1136 "get value of key <key> of application <app> on pool <poolname>",
11fdf7f2 1137 "osd", "r")
7c673cae
FG
1138COMMAND("osd utilization",
1139 "get basic pg distribution stats",
11fdf7f2 1140 "osd", "r")
f67539c2
TL
1141COMMAND("osd force_healthy_stretch_mode " \
1142 "name=yes_i_really_mean_it,type=CephBool,req=false",
1143 "force a healthy stretch mode, requiring the full number of CRUSH buckets "
1144 "to peer and letting all non-tiebreaker monitors be elected leader ",
1145 "osd", "rw")
1146COMMAND("osd force_recovery_stretch_mode " \
1147 "name=yes_i_really_mean_it,type=CephBool,req=false",
1148 "try and force a recovery stretch mode, increasing the "
1149 "pool size to its non-failure value if currently degraded and "
1150 "all monitor buckets are up",
1151 "osd", "rw")
1152
7c673cae
FG
1153
1154// tiering
9f95a23c
TL
1155COMMAND("osd tier add "
1156 "name=pool,type=CephPoolname "
1157 "name=tierpool,type=CephPoolname "
20effc67 1158 "name=force_nonempty,type=CephBool,req=false",
9f95a23c 1159 "add the tier <tierpool> (the second one) to base pool <pool> (the first one)",
11fdf7f2 1160 "osd", "rw")
9f95a23c
TL
1161COMMAND("osd tier rm "
1162 "name=pool,type=CephPoolname "
7c673cae 1163 "name=tierpool,type=CephPoolname",
9f95a23c 1164 "remove the tier <tierpool> (the second one) from base pool <pool> (the first one)",
11fdf7f2 1165 "osd", "rw")
9f95a23c
TL
1166COMMAND_WITH_FLAG("osd tier remove "
1167 "name=pool,type=CephPoolname "
7c673cae 1168 "name=tierpool,type=CephPoolname",
9f95a23c
TL
1169 "remove the tier <tierpool> (the second one) from base pool <pool> (the first one)",
1170 "osd", "rw",
11fdf7f2 1171 FLAG(DEPRECATED))
9f95a23c
TL
1172COMMAND("osd tier cache-mode "
1173 "name=pool,type=CephPoolname "
e306af50 1174 "name=mode,type=CephChoices,strings=writeback|readproxy|readonly|none "
9f95a23c 1175 "name=yes_i_really_mean_it,type=CephBool,req=false",
11fdf7f2 1176 "specify the caching mode for cache tier <pool>", "osd", "rw")
9f95a23c
TL
1177COMMAND("osd tier set-overlay "
1178 "name=pool,type=CephPoolname "
1179 "name=overlaypool,type=CephPoolname",
11fdf7f2 1180 "set the overlay pool for base pool <pool> to be <overlaypool>", "osd", "rw")
9f95a23c
TL
1181COMMAND("osd tier rm-overlay "
1182 "name=pool,type=CephPoolname ",
11fdf7f2 1183 "remove the overlay pool for base pool <pool>", "osd", "rw")
9f95a23c
TL
1184COMMAND_WITH_FLAG("osd tier remove-overlay "
1185 "name=pool,type=CephPoolname ",
1186 "remove the overlay pool for base pool <pool>", "osd", "rw",
11fdf7f2 1187 FLAG(DEPRECATED))
7c673cae 1188
9f95a23c
TL
1189COMMAND("osd tier add-cache "
1190 "name=pool,type=CephPoolname "
1191 "name=tierpool,type=CephPoolname "
1192 "name=size,type=CephInt,range=0",
1193 "add a cache <tierpool> (the second one) of size <size> to existing pool <pool> (the first one)",
11fdf7f2 1194 "osd", "rw")
7c673cae
FG
1195
1196/*
f67539c2 1197 * mon/KVMonitor.cc
7c673cae
FG
1198 */
1199
9f95a23c
TL
1200COMMAND("config-key get "
1201 "name=key,type=CephString",
11fdf7f2 1202 "get <key>", "config-key", "r")
9f95a23c
TL
1203COMMAND("config-key set "
1204 "name=key,type=CephString "
1205 "name=val,type=CephString,req=false",
11fdf7f2 1206 "set <key> to value <val>", "config-key", "rw")
9f95a23c
TL
1207COMMAND_WITH_FLAG("config-key put "
1208 "name=key,type=CephString "
1209 "name=val,type=CephString,req=false",
11fdf7f2 1210 "put <key>, value <val>", "config-key", "rw",
c07f9fc5 1211 FLAG(DEPRECATED))
9f95a23c
TL
1212COMMAND_WITH_FLAG("config-key del "
1213 "name=key,type=CephString",
1214 "delete <key>", "config-key", "rw",
11fdf7f2 1215 FLAG(DEPRECATED))
9f95a23c
TL
1216COMMAND("config-key rm "
1217 "name=key,type=CephString",
11fdf7f2 1218 "rm <key>", "config-key", "rw")
9f95a23c
TL
1219COMMAND("config-key exists "
1220 "name=key,type=CephString",
11fdf7f2
TL
1221 "check for <key>'s existence", "config-key", "r")
1222COMMAND_WITH_FLAG("config-key list ", "list keys", "config-key", "r",
c07f9fc5 1223 FLAG(DEPRECATED))
11fdf7f2 1224COMMAND("config-key ls ", "list keys", "config-key", "r")
9f95a23c 1225COMMAND("config-key dump "
11fdf7f2 1226 "name=key,type=CephString,req=false", "dump keys and values (with optional prefix)", "config-key", "r")
7c673cae
FG
1227
1228
1229/*
1230 * mon/MgrMonitor.cc
1231 */
f67539c2
TL
1232COMMAND("mgr stat",
1233 "dump basic info about the mgr cluster state",
1234 "mgr", "r")
9f95a23c
TL
1235COMMAND("mgr dump "
1236 "name=epoch,type=CephInt,range=0,req=false",
1237 "dump the latest MgrMap",
11fdf7f2 1238 "mgr", "r")
9f95a23c 1239COMMAND("mgr fail name=who,type=CephString,req=false",
11fdf7f2 1240 "treat the named manager daemon as failed", "mgr", "rw")
224ce89b 1241COMMAND("mgr module ls",
20effc67 1242 "list active mgr modules", "mgr", "r")
3efd9988
FG
1243COMMAND("mgr services",
1244 "list service endpoints provided by mgr modules",
11fdf7f2 1245 "mgr", "r")
9f95a23c
TL
1246COMMAND("mgr module enable "
1247 "name=module,type=CephString "
20effc67 1248 "name=force,type=CephBool,req=false",
11fdf7f2 1249 "enable mgr module", "mgr", "rw")
9f95a23c 1250COMMAND("mgr module disable "
224ce89b 1251 "name=module,type=CephString",
11fdf7f2
TL
1252 "disable mgr module", "mgr", "rw")
1253COMMAND("mgr metadata name=who,type=CephString,req=false",
c07f9fc5 1254 "dump metadata for all daemons or a specific daemon",
11fdf7f2 1255 "mgr", "r")
c07f9fc5
FG
1256COMMAND("mgr count-metadata name=property,type=CephString",
1257 "count ceph-mgr daemons by metadata field property",
11fdf7f2 1258 "mgr", "r")
9f95a23c 1259COMMAND("mgr versions",
c07f9fc5 1260 "check running versions of ceph-mgr daemons",
11fdf7f2
TL
1261 "mgr", "r")
1262
1263// ConfigMonitor
9f95a23c
TL
1264COMMAND("config set"
1265 " name=who,type=CephString"
1266 " name=name,type=CephString"
1267 " name=value,type=CephString"
11fdf7f2
TL
1268 " name=force,type=CephBool,req=false",
1269 "Set a configuration option for one or more entities",
1270 "config", "rw")
9f95a23c
TL
1271COMMAND("config rm"
1272 " name=who,type=CephString"
11fdf7f2
TL
1273 " name=name,type=CephString",
1274 "Clear a configuration option for one or more entities",
1275 "config", "rw")
9f95a23c
TL
1276COMMAND("config get "
1277 "name=who,type=CephString "
20effc67 1278 "name=key,type=CephString,req=false",
11fdf7f2
TL
1279 "Show configuration option(s) for an entity",
1280 "config", "r")
1281COMMAND("config dump",
1282 "Show all configuration option(s)",
1283 "mon", "r")
9f95a23c 1284COMMAND("config help "
11fdf7f2
TL
1285 "name=key,type=CephString",
1286 "Describe a configuration option",
1287 "config", "r")
1288COMMAND("config ls",
1289 "List available configuration options",
1290 "config", "r")
1291COMMAND("config assimilate-conf",
1292 "Assimilate options from a conf, and return a new, minimal conf file",
1293 "config", "rw")
20effc67 1294COMMAND("config log name=num,type=CephInt,req=false",
11fdf7f2
TL
1295 "Show recent history of config changes",
1296 "config", "r")
9f95a23c
TL
1297COMMAND("config reset "
1298 "name=num,type=CephInt,range=0",
1299 "Revert configuration to a historical version specified by <num>",
11fdf7f2
TL
1300 "config", "rw")
1301COMMAND("config generate-minimal-conf",
1302 "Generate a minimal ceph.conf file",
1303 "config", "r")
1304
9f95a23c
TL
1305
1306
1307
1308// these are tell commands that were implemented as CLI commands in
1309// the broken pre-octopus way that we want to allow to work when a
1310// monitor has upgraded to octopus+ but the monmap min_mon_release is
1311// still < octopus. we exclude things that weren't well supported
1312// before and that aren't implemented by the octopus mon anymore.
1313//
1314// the command set below matches the kludge in Monitor::handle_command
1315// that shunts these off to the asok machinery.
1316
1317COMMAND_WITH_FLAG("injectargs "
1318 "name=injected_args,type=CephString,n=N",
1319 "inject config arguments into monitor", "mon", "rw",
1320 FLAG(TELL))
11fdf7f2 1321COMMAND_WITH_FLAG("smart name=devid,type=CephString,req=false",
9f95a23c
TL
1322 "Query health metrics for underlying device",
1323 "mon", "rw",
1324 FLAG(TELL))
1325COMMAND_WITH_FLAG("mon_status",
1326 "report status of monitors",
1327 "mon", "r",
1328 FLAG(TELL))
1329COMMAND_WITH_FLAG("heap "
1330 "name=heapcmd,type=CephChoices,strings=dump|start_profiler|stop_profiler|release|stats "
1331 "name=value,type=CephString,req=false",
1332 "show heap usage info (available only if compiled with tcmalloc)",
1333 "mon", "rw",
1334 FLAG(TELL))
f67539c2
TL
1335COMMAND_WITH_FLAG("connection scores dump",
1336 "show the scores used in connectivity-based elections",
1337 "mon", "rwx",
1338 FLAG(TELL))
1339COMMAND_WITH_FLAG("connection scores reset",
1340 "reset the scores used in connectivity-based elections",
1341 "mon", "rwx",
1342 FLAG(TELL))
9f95a23c 1343COMMAND_WITH_FLAG("sync_force "
20effc67 1344 "name=yes_i_really_mean_it,type=CephBool,req=false",
9f95a23c
TL
1345 "force sync of and clear monitor store",
1346 "mon", "rw",
1347 FLAG(TELL))
1348COMMAND_WITH_FLAG("add_bootstrap_peer_hint "
1349 "name=addr,type=CephIPAddr",
1350 "add peer address as potential bootstrap "
1351 "peer for cluster bringup",
1352 "mon", "rw",
1353 FLAG(TELL))
1354COMMAND_WITH_FLAG("add_bootstrap_peer_hintv "
1355 "name=addrv,type=CephString",
1356 "add peer address vector as potential bootstrap "
1357 "peer for cluster bringup",
1358 "mon", "rw",
1359 FLAG(TELL))
1360COMMAND_WITH_FLAG("quorum enter ",
1361 "force monitor back into quorum",
1362 "mon", "rw",
1363 FLAG(TELL))
1364COMMAND_WITH_FLAG("quorum exit",
1365 "force monitor out of the quorum",
1366 "mon", "rw",
1367 FLAG(TELL))
1368COMMAND_WITH_FLAG("ops",
1369 "show the ops currently in flight",
1370 "mon", "r",
1371 FLAG(TELL))
1372COMMAND_WITH_FLAG("sessions",
1373 "list existing sessions",
1374 "mon", "r",
1375 FLAG(TELL))
1376COMMAND_WITH_FLAG("dump_historic_ops",
1377 "dump_historic_ops",
1378 "mon", "r",
1379 FLAG(TELL))