summaryrefslogtreecommitdiff
path: root/swiftclient/shell.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-11-08 19:30:40 +0000
committerGerrit Code Review <review@openstack.org>2016-11-08 19:30:40 +0000
commit70c90b2243c2df9857a188cbd61d340b7e191d0d (patch)
treee18844bd7c4d2d571916dc9ca6e55f4f48056b11 /swiftclient/shell.py
parentcb922f4dc6c9d1f49069b555d8fbfc3628e78190 (diff)
parent6cf2bd6626df8e4c68bd5463d9b030e315f76b42 (diff)
downloadpython-swiftclient-70c90b2243c2df9857a188cbd61d340b7e191d0d.tar.gz
Merge "Add additional headers for HEAD/GET/DELETE requests."
Diffstat (limited to 'swiftclient/shell.py')
-rwxr-xr-xswiftclient/shell.py27
1 files changed, 25 insertions, 2 deletions
diff --git a/swiftclient/shell.py b/swiftclient/shell.py
index 3f8aad6..9fd7aac 100755
--- a/swiftclient/shell.py
+++ b/swiftclient/shell.py
@@ -58,6 +58,7 @@ def immediate_exit(signum, frame):
st_delete_options = '''[--all] [--leave-segments]
[--object-threads <threads>]
[--container-threads <threads>]
+ [--header <header:value>]
[<container> [<object>] [...]]
'''
@@ -72,6 +73,9 @@ Positional arguments:
Optional arguments:
-a, --all Delete all containers and objects.
--leave-segments Do not delete segments of manifest objects.
+ -H, --header <header:value>
+ Adds a custom request header to use for deleting
+ objects or an entire container .
--object-threads <threads>
Number of threads to use for deleting objects.
Default is 10.
@@ -89,6 +93,11 @@ def st_delete(parser, args, output_manager):
'-p', '--prefix', dest='prefix',
help='Only delete items beginning with the <prefix>.')
parser.add_argument(
+ '-H', '--header', action='append', dest='header',
+ default=[],
+ help='Adds a custom request header to use for deleting objects '
+ 'or an entire container.')
+ parser.add_argument(
'--leave-segments', action='store_true',
dest='leave_segments', default=False,
help='Do not delete segments of manifest objects.')
@@ -445,7 +454,8 @@ def st_download(parser, args, output_manager):
st_list_options = '''[--long] [--lh] [--totals] [--prefix <prefix>]
- [--delimiter <delimiter>] [<container>]
+ [--delimiter <delimiter>] [--header <header:value>]
+ [<container>]
'''
st_list_help = '''
@@ -465,6 +475,8 @@ Optional arguments:
Roll up items with the given delimiter. For containers
only. See OpenStack Swift API documentation for what
this means.
+ -H, --header <header:value>
+ Adds a custom request header to use for listing.
'''.strip('\n')
@@ -541,6 +553,10 @@ def st_list(parser, args, output_manager):
help='Roll up items with the given delimiter. For containers '
'only. See OpenStack Swift API documentation for '
'what this means.')
+ parser.add_argument(
+ '-H', '--header', action='append', dest='header',
+ default=[],
+ help='Adds a custom request header to use for listing.')
options, args = parse_args(parser, args)
args = args[1:]
if options['delimiter'] and not args:
@@ -580,7 +596,7 @@ def st_list(parser, args, output_manager):
output_manager.error(e.value)
-st_stat_options = '''[--lh]
+st_stat_options = '''[--lh] [--header <header:value>]
[<container> [<object>]]
'''
@@ -594,6 +610,8 @@ Positional arguments:
Optional arguments:
--lh Report sizes in human readable format similar to
ls -lh.
+ -H, --header <header:value>
+ Adds a custom request header to use for stat.
'''.strip('\n')
@@ -601,6 +619,11 @@ def st_stat(parser, args, output_manager):
parser.add_argument(
'--lh', dest='human', action='store_true', default=False,
help='Report sizes in human readable format similar to ls -lh.')
+ parser.add_argument(
+ '-H', '--header', action='append', dest='header',
+ default=[],
+ help='Adds a custom request header to use for stat.')
+
options, args = parse_args(parser, args)
args = args[1:]