summaryrefslogtreecommitdiff
path: root/swiftclient
diff options
context:
space:
mode:
Diffstat (limited to 'swiftclient')
-rw-r--r--swiftclient/service.py2
-rwxr-xr-xswiftclient/shell.py11
2 files changed, 11 insertions, 2 deletions
diff --git a/swiftclient/service.py b/swiftclient/service.py
index b9b843e..8301ae9 100644
--- a/swiftclient/service.py
+++ b/swiftclient/service.py
@@ -1912,6 +1912,8 @@ class SwiftService(object):
return res
# Merge the command line header options to the put_headers
+ put_headers.update(split_headers(
+ options['meta'], 'X-Object-Meta-'))
put_headers.update(split_headers(options['header'], ''))
# Don't do segment job if object is not big enough, and never do
diff --git a/swiftclient/shell.py b/swiftclient/shell.py
index 841ed6e..58b9f54 100755
--- a/swiftclient/shell.py
+++ b/swiftclient/shell.py
@@ -881,8 +881,8 @@ def st_copy(parser, args, output_manager):
st_upload_options = '''[--changed] [--skip-identical] [--segment-size <size>]
[--segment-container <container>] [--leave-segments]
[--object-threads <thread>] [--segment-threads <threads>]
- [--header <header>] [--use-slo] [--ignore-checksum]
- [--object-name <object-name>]
+ [--meta <name:value>] [--header <header>] [--use-slo]
+ [--ignore-checksum] [--object-name <object-name>]
<container> <file_or_directory> [<file_or_directory>] [...]
'''
@@ -916,6 +916,9 @@ Optional arguments:
--segment-threads <threads>
Number of threads to use for uploading object segments.
Default is 10.
+ -m, --meta <name:value>
+ Sets a meta data item. This option may be repeated.
+ Example: -m Color:Blue -m Size:Large
-H, --header <header:value>
Adds a customized request header. This option may be
repeated. Example: -H "content-type:text/plain"
@@ -967,6 +970,10 @@ def st_upload(parser, args, output_manager):
help='Number of threads to use for uploading object segments. '
'Its value must be a positive integer. Default is 10.')
parser.add_argument(
+ '-m', '--meta', action='append', dest='meta', default=[],
+ help='Sets a meta data item. This option may be repeated. '
+ 'Example: -m Color:Blue -m Size:Large')
+ parser.add_argument(
'-H', '--header', action='append', dest='header',
default=[], help='Set request headers with the syntax header:value. '
' This option may be repeated. Example: -H "content-type:text/plain" '