Skip to content

Commit 20979c4

Browse files
committed
Fixed up help/readme
1 parent 553dee8 commit 20979c4

File tree

2 files changed

+34
-30
lines changed

2 files changed

+34
-30
lines changed

README.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,36 @@ dynamodump supports local DynamoDB instances as well (tested with [dynalite](htt
1212
Usage
1313
-----
1414
```
15-
usage: dynamodump.py [-h] [-m MODE] [-r REGION] [-s SRCTABLE] [-d DESTTABLE]
15+
usage: dynamodump.py [-h] [-m MODE] [-r REGION] [--host HOST] [--port PORT]
16+
[--accessKey ACCESSKEY] [--secretKey SECRETKEY]
17+
[-p PROFILE] [-s SRCTABLE] [-d DESTTABLE]
1618
[--prefixSeparator PREFIXSEPARATOR] [--noSeparator]
1719
[--readCapacity READCAPACITY]
18-
[--writeCapacity WRITECAPACITY] [--host HOST]
19-
[--port PORT] [--accessKey ACCESSKEY]
20-
[--secretKey SECRETKEY] [--log LOG] [--dataOnly]
20+
[--writeCapacity WRITECAPACITY] [--schemaOnly]
21+
[--dataOnly] [--skipThroughputUpdate] [--log LOG]
2122
22-
Simple DynamoDB backup/restore.
23+
Simple DynamoDB backup/restore/empty.
2324
2425
optional arguments:
2526
-h, --help show this help message and exit
2627
-m MODE, --mode MODE 'backup' or 'restore' or 'empty'
2728
-r REGION, --region REGION
2829
AWS region to use, e.g. 'us-west-1'. Use 'local' for
29-
local DynamoDB testing.
30+
local DynamoDB testing
31+
--host HOST Host of local DynamoDB [required only for local]
32+
--port PORT Port of local DynamoDB [required only for local]
33+
--accessKey ACCESSKEY
34+
Access key of local DynamoDB [required only for local]
35+
--secretKey SECRETKEY
36+
Secret key of local DynamoDB [required only for local]
3037
-p PROFILE, --profile PROFILE
31-
AWS credentials file profile. Use as an alternative to
32-
putting accessKey and secretKey on the command line.
38+
AWS credentials file profile to use. Allows you to use
39+
a profile instead of accessKey, secretKey
40+
authentication
3341
-s SRCTABLE, --srcTable SRCTABLE
3442
Source DynamoDB table name to backup or restore from,
3543
use 'tablename*' for wildcard prefix selection or '*'
36-
for all tables.
44+
for all tables
3745
-d DESTTABLE, --destTable DESTTABLE
3846
Destination DynamoDB table name to backup or restore
3947
to, use 'tablename*' for wildcard prefix selection
@@ -43,29 +51,25 @@ optional arguments:
4351
Specify a different prefix separator, e.g. '.'
4452
[optional]
4553
--noSeparator Overrides the use of a prefix separator for backup
46-
wildcard searches, [optional]
54+
wildcard searches [optional]
4755
--readCapacity READCAPACITY
4856
Change the temp read capacity of the DynamoDB table to
4957
backup from [optional]
5058
--writeCapacity WRITECAPACITY
5159
Change the temp write capacity of the DynamoDB table
5260
to restore to [defaults to 25, optional]
53-
--host HOST Host of local DynamoDB [required only for local]
54-
--port PORT Port of local DynamoDB [required only for local]
55-
--accessKey ACCESSKEY
56-
Access key of local DynamoDB [required only for local]
57-
--secretKey SECRETKEY
58-
Secret key of local DynamoDB [required only for local]
59-
--log LOG Logging level - DEBUG|INFO|WARNING|ERROR|CRITICAL
61+
--schemaOnly Backup or restore the schema only. Do not
62+
backup/restore data. Can be used with both backup and
63+
restore modes. Cannot be used with the --dataOnly
6064
[optional]
61-
--schemaOnly Dump or load schema only. Do not backup/restore data.
62-
Can be used with both backup and restore modes. Cannot
63-
be used with the --dataOnly.
6465
--dataOnly Restore data only. Do not delete/recreate schema
6566
[optional for restore]
6667
--skipThroughputUpdate
6768
Skip updating throughput values across tables
6869
[optional]
70+
--log LOG Logging level - DEBUG|INFO|WARNING|ERROR|CRITICAL
71+
[optional]
72+
6973
7074
Backup files are stored in a 'dump' subdirectory, and are restored from there as well by default.
7175
```

dynamodump.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -433,32 +433,32 @@ def do_restore(conn, sleep_interval, source_table, destination_table, write_capa
433433
parser = argparse.ArgumentParser(description="Simple DynamoDB backup/restore/empty.")
434434
parser.add_argument("-m", "--mode", help="'backup' or 'restore' or 'empty'")
435435
parser.add_argument("-r", "--region",
436-
help="AWS region to use, e.g. 'us-west-1'. Use '" + LOCAL_REGION + "' for local DynamoDB testing.")
436+
help="AWS region to use, e.g. 'us-west-1'. Use '" + LOCAL_REGION + "' for local DynamoDB testing")
437+
parser.add_argument("--host", help="Host of local DynamoDB [required only for local]")
438+
parser.add_argument("--port", help="Port of local DynamoDB [required only for local]")
439+
parser.add_argument("--accessKey", help="Access key of local DynamoDB [required only for local]")
440+
parser.add_argument("--secretKey", help="Secret key of local DynamoDB [required only for local]")
437441
parser.add_argument("-p", "--profile",
438-
help="AWS profile name to use. Allows to you to choose alternate profile from your AWS credentials file.")
442+
help="AWS credentials file profile to use. Allows you to use a profile instead of accessKey, secretKey authentication")
439443
parser.add_argument("-s", "--srcTable",
440-
help="Source DynamoDB table name to backup or restore from, use 'tablename*' for wildcard prefix selection or '*' for all tables.")
444+
help="Source DynamoDB table name to backup or restore from, use 'tablename*' for wildcard prefix selection or '*' for all tables")
441445
parser.add_argument("-d", "--destTable",
442446
help="Destination DynamoDB table name to backup or restore to, use 'tablename*' for wildcard prefix selection (defaults to use '-' separator) [optional, defaults to source]")
443447
parser.add_argument("--prefixSeparator", help="Specify a different prefix separator, e.g. '.' [optional]")
444448
parser.add_argument("--noSeparator", action='store_true',
445-
help="Overrides the use of a prefix separator for backup wildcard searches, [optional]")
449+
help="Overrides the use of a prefix separator for backup wildcard searches [optional]")
446450
parser.add_argument("--readCapacity",
447451
help="Change the temp read capacity of the DynamoDB table to backup from [optional]")
448452
parser.add_argument("--writeCapacity",
449453
help="Change the temp write capacity of the DynamoDB table to restore to [defaults to " + str(
450454
RESTORE_WRITE_CAPACITY) + ", optional]")
451-
parser.add_argument("--host", help="Host of local DynamoDB [required only for local]")
452-
parser.add_argument("--port", help="Port of local DynamoDB [required only for local]")
453-
parser.add_argument("--accessKey", help="Access key of local DynamoDB [required only for local]")
454-
parser.add_argument("--secretKey", help="Secret key of local DynamoDB [required only for local]")
455-
parser.add_argument("--log", help="Logging level - DEBUG|INFO|WARNING|ERROR|CRITICAL [optional]")
456455
parser.add_argument("--schemaOnly", action="store_true", default=False,
457-
help="Backup or restore the schema only. Do not export/import data. [optional]")
456+
help="Backup or restore the schema only. Do not backup/restore data. Can be used with both backup and restore modes. Cannot be used with the --dataOnly [optional]")
458457
parser.add_argument("--dataOnly", action="store_true", default=False,
459458
help="Restore data only. Do not delete/recreate schema [optional for restore]")
460459
parser.add_argument("--skipThroughputUpdate", action="store_true", default=False,
461460
help="Skip updating throughput values across tables [optional]")
461+
parser.add_argument("--log", help="Logging level - DEBUG|INFO|WARNING|ERROR|CRITICAL [optional]")
462462
args = parser.parse_args()
463463

464464
# set log level

0 commit comments

Comments
 (0)