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