1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
|
=================================================================
radosgw-admin -- rados REST gateway user administration utility
=================================================================
.. program:: radosgw-admin
Synopsis
========
| **radosgw-admin** *command* [ *options* *...* ]
Description
===========
:program:`radosgw-admin` is a RADOS gateway user administration utility. It
allows creating and modifying users.
Commands
========
:program:`radosgw-admin` utility uses many commands for administration purpose
which are as follows:
:command:`user create`
Create a new user.
:command:`user modify`
Modify a user.
:command:`user info`
Display information of a user, and any potentially available
subusers and keys.
:command:`user rm`
Remove a user.
:command:`user suspend`
Suspend a user.
:command:`user enable`
Re-enable user after suspension.
:command:`user check`
Check user info.
:command:`user stats`
Show user stats as accounted by quota subsystem.
:command:`caps add`
Add user capabilities.
:command:`caps rm`
Remove user capabilities.
:command:`subuser create`
Create a new subuser (primarily useful for clients using the Swift API).
:command:`subuser modify`
Modify a subuser.
:command:`subuser rm`
Remove a subuser.
:command:`key create`
Create access key.
:command:`key rm`
Remove access key.
:command:`bucket list`
List all buckets.
:command:`bucket link`
Link bucket to specified user.
:command:`bucket unlink`
Unlink bucket from specified user.
:command:`bucket stats`
Returns bucket statistics.
:command:`bucket rm`
Remove a bucket.
:command:`bucket check`
Check bucket index.
:command:`object rm`
Remove an object.
:command:`object unlink`
Unlink object from bucket index.
:command:`quota set`
Set quota params.
:command:`quota enable`
Enable quota.
:command:`quota disable`
Disable quota.
:command:`region get`
Show region info.
:command:`regions list`
List all regions set on this cluster.
:command:`region set`
Set region info (requires infile).
:command:`region default`
Set default region.
:command:`region-map get`
Show region-map.
:command:`region-map set`
Set region-map (requires infile).
:command:`zone get`
Show zone cluster params.
:command:`zone set`
Set zone cluster params (requires infile).
:command:`zone list`
List all zones set on this cluster.
:command:`pool add`
Add an existing pool for data placement.
:command:`pool rm`
Remove an existing pool from data placement set.
:command:`pools list`
List placement active set.
:command:`policy`
Display bucket/object policy.
:command:`log list`
List log objects.
:command:`log show`
Dump a log from specific object or (bucket + date + bucket-id).
:command:`log rm`
Remove log object.
:command:`usage show`
Show the usage information (with optional user and date range).
:command:`usage trim`
Trim usage information (with optional user and date range).
:command:`temp remove`
Remove temporary objects that were created up to specified date
(and optional time).
:command:`gc list`
Dump expired garbage collection objects (specify --include-all to list all
entries, including unexpired).
:command:`gc process`
Manually process garbage.
:command:`metadata get`
Get metadata info.
:command:`metadata put`
Put metadata info.
:command:`metadata rm`
Remove metadata info.
:command:`metadata list`
List metadata info.
:command:`mdlog list`
List metadata log.
:command:`mdlog trim`
Trim metadata log.
:command:`bilog list`
List bucket index log.
:command:`bilog trim`
Trim bucket index log (use start-marker, end-marker).
:command:`datalog list`
List data log.
:command:`datalog trim`
Trim data log.
:command:`opstate list`
List stateful operations entries (use client_id, op_id, object).
:command:`opstate set`
Set state on an entry (use client_id, op_id, object, state).
:command:`opstate renew`
Renew state on an entry (use client_id, op_id, object).
:command:`opstate rm`
Remove entry (use client_id, op_id, object).
:command:`replicalog get`
Get replica metadata log entry.
:command:`replicalog delete`
Delete replica metadata log entry.
Options
=======
.. option:: -c ceph.conf, --conf=ceph.conf
Use ``ceph.conf`` configuration file instead of the default
``/etc/ceph/ceph.conf`` to determine monitor addresses during
startup.
.. option:: -m monaddress[:port]
Connect to specified monitor (instead of looking through ceph.conf).
.. option:: --uid=uid
The radosgw user ID.
.. option:: --subuser=<name>
Name of the subuser.
.. option:: --email=email
The e-mail address of the user.
.. option:: --display-name=name
Configure the display name of the user.
.. option:: --access-key=<key>
S3 access key.
.. option:: --gen-access-key
Generate random access key (for S3).
.. option:: --secret=secret
The secret associated with a given key.
.. option:: --gen-secret
Generate random secret key.
.. option:: --key-type=<type>
key type, options are: swift, S3.
.. option:: --temp-url-key[-2]=<key>
Temporary url key.
.. option:: --system
Set the system flag on the user.
.. option:: --bucket=bucket
Specify the bucket name.
.. option:: --object=object
Specify the object name.
.. option:: --date=yyyy-mm-dd
The date needed for some commands.
.. option:: --start-date=yyyy-mm-dd
The start date needed for some commands.
.. option:: --end-date=yyyy-mm-dd
The end date needed for some commands.
.. option:: --shard-id=<shard-id>
Optional for mdlog list. Required for ``mdlog trim``,
``replica mdlog get/delete``, ``replica datalog get/delete``.
.. option:: --auth-uid=auid
The librados auid.
.. option:: --purge-data
Remove user data before user removal.
.. option:: --purge-keys
When specified, subuser removal will also purge all the subuser keys.
.. option:: --purge-objects
Remove all objects before bucket removal.
.. option:: --lazy-remove
Defer removal of object tail.
.. option:: --metadata-key=<key>
Key to retrieve metadata from with ``metadata get``.
.. option:: --rgw-region=<region>
Region in which radosgw is running.
.. option:: --rgw-zone=<zone>
Zone in which radosgw is running.
.. option:: --fix
Besides checking bucket index, will also fix it.
.. option:: --check-objects
bucket check: Rebuilds bucket index according to actual objects state.
.. option:: --format=<format>
Specify output format for certain operations: xml, json.
.. option:: --sync-stats
Option to 'user stats', update user stats with current stats reported by
user's buckets indexes.
.. option:: --show-log-entries=<flag>
Enable/disable dump of log entries on log show.
.. option:: --show-log-sum=<flag>
Enable/disable dump of log summation on log show.
.. option:: --skip-zero-entries
Log show only dumps entries that don't have zero value in one of the numeric
field.
.. option:: --infile
Specify a file to read in when setting data.
.. option:: --state=<state string>
Specify a state for the opstate set command.
.. option:: --replica-log-type
Replica log type (metadata, data, bucket), required for replica log
operations.
.. option:: --categories=<list>
Comma separated list of categories, used in usage show.
.. option:: --caps=<caps>
List of caps (e.g., "usage=read, write; user=read".
.. option:: --yes-i-really-mean-it
Required for certain operations.
Quota Options
=============
.. option:: --bucket
Specified bucket for quota command.
.. option:: --max-objects
Specify max objects (negative value to disable).
.. option:: --max-size
Specify max size (in bytes, negative value to disable).
.. option:: --quota-scope
Scope of quota (bucket, user).
Examples
========
Generate a new user::
$ radosgw-admin user create --display-name="johnny rotten" --uid=johnny
{ "user_id": "johnny",
"rados_uid": 0,
"display_name": "johnny rotten",
"email": "",
"suspended": 0,
"subusers": [],
"keys": [
{ "user": "johnny",
"access_key": "TCICW53D9BQ2VGC46I44",
"secret_key": "tfm9aHMI8X76L3UdgE+ZQaJag1vJQmE6HDb5Lbrz"}],
"swift_keys": []}
Remove a user::
$ radosgw-admin user rm --uid=johnny
Remove a user and all associated buckets with their contents::
$ radosgw-admin user rm --uid=johnny --purge-data
Remove a bucket::
$ radosgw-admin bucket unlink --bucket=foo
Show the logs of a bucket from April 1st, 2012::
$ radosgw-admin log show --bucket=foo --date=2012-04-01
Show usage information for user from March 1st to (but not including) April 1st, 2012::
$ radosgw-admin usage show --uid=johnny \
--start-date=2012-03-01 --end-date=2012-04-01
Show only summary of usage information for all users::
$ radosgw-admin usage show --show-log-entries=false
Trim usage information for user until March 1st, 2012::
$ radosgw-admin usage trim --uid=johnny --end-date=2012-04-01
Availability
============
:program:`radosgw-admin` is part of Ceph, a massively scalable, open-source,
distributed storage system. Please refer to the Ceph documentation at
http://ceph.com/docs for more information.
See also
========
:doc:`ceph <ceph>`\(8)
:doc:`radosgw <radosgw>`\(8)
|