...since modern sphinx won't install on py27.
While we're at it, clean up some warnings and treat warnings as errors.
Also, fix up how we parse test configs so we can run func tests.
Add the --prompt option for the CLI which will cause the user to be
prompted to enter a password. Any password otherwise specified by
--key, --os-password or an environment variable will be ignored.
The swift client will exit with a warning if the password cannot be
entered without its value being echoed.
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.
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
This is a follow up to patch Ia3fd947ff619c11ff0ce474897533dcf7b49d9b3.
One of the imports for the keystone session example was wrong. It was
trying to import v3 like:
from keystoneauth1 import v3
Whereas in my testing v3 actually exists deeper under identity:
from keystoneauth1.identity import v3
This patch fixes this import in the example documentation.
This lets us use Keystone sessions against endpoints like swauth and
tempauth with code like:
loader = keystoneauth1.loading.get_plugin_loader('v1password')
auth_plugin = loader.load_from_options(
keystone_session = keystoneauth1.session.Session(auth_plugin)
conn = swiftclient.Connection(session=keystone_session)
The plugin includes an optional project_name option, which may be used
to override the swift account from the storage url that was returned.
Additionally, it includes enough infrastructure to support some commands
openstack token issue
openstack catalog list
openstack catalog show object-store
openstack object store account show
openstack container list
openstack container create <container>
openstack container save <container>
openstack container show <container>
openstack container delete <container>
openstack object list <container>
openstack object create <container> <file>
openstack object save <container> <object>
opsentack object show <container> <object>
openstack object delete <container> <object>
There are no examples for copy and delete command. For beginners,
they may not use both commands. Therefore, I add examples, then
beginners are able to understand how to use both commands.
Swift has commands including 'swift tempurl' and 'swift auth',
but it has no 'swift tempurl' and 'swift auth' in doc/source/cli.rst.
Therefore, I add them and their examples.
This patch fixes a missing code-block section in the
capabilities section of service-api.rst, and fixes
the import of walk in the upload.py examples to support
both python2 and python3.
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.
This lets us do things like:
$ swift info --json | jq '[.swift.policies.name]'
Also, escape more dashes in the man page, so they won't be
misinterpreted as hyphens.
As a result of the Hackathon we have produced a new
documentation structure for the python-swiftclient.
This patch introduces the new structure and adds the
The intention is to document the CLI, the SwiftService
and Connection API. Importantly, we also provide
guidance on important considerations when using a swift
object store, such as which aspect of the python-swiftclient
to use for various use cases, common authentication patterns
and some useful examples.
Co-Authored-By: Alexandra Settle <firstname.lastname@example.org>
Co-Authored-By: Mohit Motiani <email@example.com>
Co-Authored-By: Hisashi Osanai <firstname.lastname@example.org>
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.
$ 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".