25 Commits

Author SHA1 Message Date
Timur Alperovich
0982791db2 Allow for uploads from standard input.
If "-" is passed in for the source, python-swiftclient will upload
the object by reading the contents of the standard input. The object
name option must be set, as well, and this cannot be used in
conjunction with other files.

This approach stores the entire contents as one object. A follow on
patch will change this behavior to upload from standard input as SLO,
unless the segment size is larger than the content size.

Change-Id: I1a8be6377de06f702e0f336a5a593408ed49be02
2017-07-26 17:04:19 -07:00
Hangdong Zhang
3db6ddd6e4 Update the documentation link for doc migration
Change-Id: I1a5a354675b3ca6a7dbb5ab2dc78bf60209fa2b5
2017-07-24 09:49:59 -07:00
Christopher Bartz
cde73c196d Option to ignore mtime metadata entry.
Currently, the swiftclient upload command passes a custom metadata
header for each object (called object-meta-mtime), whose value is
the current UNIX timestamp. When downloading such an object with the
swiftclient, the mtime header is parsed and passed as the atime and
mtime for the newly created file.

There are use-cases where this is not desired, for example when using
tmp or scratch directories in which files older than a specific date
are deleted. This commit provides a boolean option for ignoring the
mtime header.

Change-Id: If60b389aa910c6f1969b999b5d3b6d0940375686
2017-07-06 10:19:12 -07:00
Christopher Bartz
8e08931b9f ISO 8601 timestamps for tempurl
Client-side implementation for ISO 8601 timestamp
support of tempurl middleware. Please see

https://review.openstack.org/#/c/422679/

Change-Id: I76da28b48948475ec1bae5258e0b39a316553fb7
2017-03-29 14:27:39 -04:00
Andreas Jaeger
ee8620de94 Change swift.o.o URL
This is an obsolete URL that redirects, use docs.o.o - and use https for
it.

Change-Id: I7ba2c49db2c620071f8eeb96d0b63af8381ed899
2017-03-08 16:53:24 +01:00
Christopher Bartz
3934bd606a prefix-based tempurls support
Implements client-side functionality for
prefix-based tempurls.

Please see: https://review.openstack.org/#/c/274048/

Change-Id: I8d7701daee888ed1120271a96c0660b01543ca2d
2017-01-19 16:34:26 +01:00
Jenkins
b57044a853 Merge "Add copy object method" 2016-08-24 23:59:34 +00:00
Marek Kaleta
4a2465fb12 Add copy object method
Implement copy object method in swiftclient Connection, Service and CLI.

Although COPY functionality can be accomplished with 'X-Copy-From'
header in PUT request, using copy is more convenient especially when
using copy for updating object metadata non-destructively.

Closes-Bug: 1474939
Change-Id: I1338ac411f418f4adb3d06753d044a484a7f32a4
2016-08-23 14:37:11 -07:00
Tim Burke
335570e511 Add --json option to swift capabilities / swift info
This lets us do things like:

    $ swift info --json | jq '[.swift.policies[].name]'
    [
      "Standard-Replica",
      "EC"
    ]

Also, escape more dashes in the man page, so they won't be
misinterpreted as hyphens.

Change-Id: Ic7690bdbcfc55f55e5dde9bc11bb0644085973ce
2016-08-02 16:18:44 -07:00
Shashirekha Gundur
5be9b7e310 fixing nit picks in python-swiftclient doc
Change-Id: Ifde19be175ea828a3137951a0382492434727b5b
2016-07-07 22:15:45 +00:00
Cheng Li
69bf4634b9 Add an option: disable etag check on downloads
This patch is to add an option of disable etag
check on downloads.

Change-Id: I9ad389dd691942dea6db470ca3f0543eb6e9703e
Closes-bug: #1581147
2016-06-02 22:53:18 +08:00
Tim Burke
7a1e192803 Use bulk-delete middleware when available
When issuing `delete` commands that would require three or more
individual deletes, check whether the cluster supports bulk deletes
and use that if it's available.

Additionally, a new option is added to the `delete` command:

  * --prefix <prefix>

    Delete all objects that start with <prefix>. This is similar to the
    --prefix option for the `list` command.

Example:

$ swift delete c --prefix obj_prefix/

    ...will delete from container "c" all objects whose name begins with
    "obj_prefix/", such as "obj_prefix/foo" and "obj_prefix/bar".

Change-Id: I6b9504848d6ef562cf4f570bbcd17db4e3da8264
2016-01-12 15:40:57 -08:00
Peter Lisák
3b1f4fda72 Unification of manpages and docstrings
* adding missing options
* unification of help

Change-Id: I2365e66433b63de8fd4da205611d9c1bf3bb6730
2015-11-13 17:32:12 +01:00
Zack M. Davis
52d39bebc1 absolute expiry option for tempURL generation
The `tempurl` subcommand's second positional argument is called
`seconds` and has heretofore interpreted as the number of seconds for
which the tempURL should be valid, counting from the moment of running
the command. This is indeed a common, if not the most common,
use-case. But some users, occasionally, might want to generate a tempURL
that expires at some particular ("absolute") time, rather than a
particular amount of time relative to the moment of happening to run the
command. (One might make an analogy to the way in which Swift's expiring
object support supports an `X-Delete-At` header in addition to
`X-Delete-After`—and it's the former that must be regarded as
ontologically prior.) Thus, this commit adds an `--absolute` optional
argument to the `tempurl` subcommand; if present, the `seconds` argument
will be interpreted as a Unix timestamp of when the tempURL should be
expire, rather than a duration for which the tempURL should be valid
starting from "now".

Change-Id: If9ded96f2799800958d5063127f3de812f50ef06
2015-09-04 14:57:30 -07:00
Zack M. Davis
ca70dd9e15 add tempurl command to swift.1 man page
Change-Id: Ifccc7f6dc049ca0ac2c53c00b1704cff4d1a770f
Closes-Bug: #1450606
2015-07-13 11:38:58 -07:00
Hirokazu Sakata
eb85f8c1a4 Add help message for "<subcommand> --help"
This patch fixed help message for "<subcommand> --help" in
general help message. Previous help message was only
"this help message". It has not described for subcommand.

Change-Id: I2fe6413baf98ba3881425ee6bed29c618e29fff8
Closes-Bug: 1420253
2015-02-10 20:52:17 +09:00
Thomas Goirand
822274b637 swift.1 manpage fix for groff warnings
The current manual page contains hyphens where a minus sign
was intended. By default, "-" chars are interpreted as
hyphens (U+2010) by groff, not as minus signs (U+002D).
Since options to programs use minus signs (U+002D), this
means for example in UTF-8 locales that you cannot cut and
paste options, nor search for them easily.

This patch fixes this by escaping hyphens with backslashes,
and also fixes a typo: s/retreived/retrieved/.

Change-Id: If954c91eebe7b39bdac792f1f126998d2e3bcb8e
2014-02-18 11:42:18 +08:00
Fabien Boucher
533c9c5ba1 Add capabilities option
This patch adds a capabilities option on swiftclient.
This option uses the new /info endpoint to request the
remote capabilities and nicely display it.

Change-Id: Ie34b454511d5527e402e66e1fdb72120f427f2fd
2014-01-17 10:26:34 +01:00
Taurus Cheung
26ecec0f6d Add --object-name
Add parameter --object-name, which:
1) Sets target object name when upload single file
2) Sets object prefix when upload a directory

Change-Id: Idc4357c3355e66d31c100540b901e70db20b03c3
Closes-Bug: 1012979
2013-12-24 10:27:17 +08:00
Matthieu Huin
3cabda8c48 Allow custom headers when using swift download (CLI)
This fixes bug #1051046

A repeatable option, --header or -H, is added so a user can specify
custom headers such as Range or If-Modified-Since when downloading
an object with the swift CLI.

Change-Id: I1f7dcf64cf625f2e5a4488c210894cfe6e0d5974
2013-11-04 17:41:55 +01:00
Alex Gaynor
ff6ba367fa Replaced two references to Cloud Files with Swift
Change-Id: I721f2b25a255a829c625b34928b066df3cd3e632
2013-11-01 11:40:44 -07:00
Darrell Bishop
1d4d51b218 Allow storage url override for both auth vers.
When --os-storage-url is specified on the command-line to bin/swift, it
will override the used storage URL regardless of authentication for both
authentication version 1 and version 2.  This can be used to bypass a
load-balancer to hit a specific proxy server for testing/debugging
purposes.

Within the client library, this feature is accessed by passing the
desired storage URL into swiftclient.client.Conection.__init__() via the
os_options keyword argument.  For example:

  conn = Connection(auth_url, user, key, os_options={
    'object_storage_url': 'http://overridden.storage.url/AUTH_foo'})

This patch also adds a dependency on mock>=0.8.0, which is the same as
openstack/swift.

Change-Id: Id2a36ed6abffd65e7762b6beea5bbfc6c036e848
2013-07-05 14:12:59 -05:00
Mark Seger
17bb3fa779 Add -l and --lh switches to swift 'list' command
Also updated man page and added an example in 'list'
command help message

Change-Id: Icf38de9bab6d387a9a1deed444a91f68b4389cfe
2013-06-10 16:49:44 +00:00
Pete Zaitcev
07311a0639 Update the man page
- Add -V option
- Use uniform and correct capitalization for OpenStack Swift
- Make the example of output of stat command up-to-date
- Generally prettify the document
- Remove all trailing whitespace

Change-Id: Id3da2035851847c4bff8cec8f927d3654824bf5b
2013-05-21 15:34:21 -06:00
Pete Zaitcev
d79c435bfe Add client man page swift.1
This is the byte-by-byte copy of swift.1 that was left behind
in the main Swift package when python-swiftclient was split away.
Apparently there is absolutely nothing to be changed in setup.py
and the distribution packagers are supposed to pick the page as-is
using their packaging systems.

Change-Id: I24f238501589db940574eac61b89a1422fe2fd77
2013-02-26 12:47:34 -07:00