The swift client is the command-line interface (CLI) for the Object Storage service API and its extensions.
This chapter documents swift version 3.1.0
.
For help on a specific swift command, enter:
$ swift COMMAND --help
Usage: swift [--version] [--help] [--os-help] [--snet] [--verbose]
[--debug] [--info] [--quiet] [--auth <auth_url>]
[--auth-version <auth_version> |
--os-identity-api-version <auth_version> ]
[--user <username>]
[--key <api_key>] [--retries <num_retries>]
[--os-username <auth-user-name>] [--os-password <auth-password>]
[--os-user-id <auth-user-id>]
[--os-user-domain-id <auth-user-domain-id>]
[--os-user-domain-name <auth-user-domain-name>]
[--os-tenant-id <auth-tenant-id>]
[--os-tenant-name <auth-tenant-name>]
[--os-project-id <auth-project-id>]
[--os-project-name <auth-project-name>]
[--os-project-domain-id <auth-project-domain-id>]
[--os-project-domain-name <auth-project-domain-name>]
[--os-auth-url <auth-url>] [--os-auth-token <auth-token>]
[--os-storage-url <storage-url>] [--os-region-name <region-name>]
[--os-service-type <service-type>]
[--os-endpoint-type <endpoint-type>]
[--os-cacert <ca-certificate>] [--insecure]
[--os-cert <client-certificate-file>]
[--os-key <client-certificate-key-file>]
[--no-ssl-compression]
<subcommand> [--help] [<subcommand options>]
Subcommands:
delete
download
list
post
copy
stat
upload
capabilities
tempurl
auth
swift download --help
swift -A https://auth.api.rackspacecloud.com/v1.0 -U user -K api_key stat -v
swift --os-auth-url https://api.example.com/v2.0 \
--os-tenant-name tenant --os-username user --os-password password list
swift --os-auth-url https://api.example.com/v3 --auth-version 3 \
--os-project-name project1 --os-project-domain-name domain1 \
--os-username user --os-user-domain-name domain1 \
--os-password password list
swift --os-auth-url https://api.example.com/v3 --auth-version 3 \
--os-project-id 0123456789abcdef0123456789abcdef \
--os-user-id abcdef0123456789abcdef0123456789 \
--os-password password list
swift --os-auth-token 6ee5eb33efad4e45ab46806eac010566 \
--os-storage-url https://10.1.5.2:8080/v1/AUTH_ced809b6a4baea7aeab61a \
list
swift list --lh
--version
-h, --help
--os-help
-s, --snet
-v, --verbose
--debug
--info
-q, --quiet
-A AUTH, --auth=AUTH
-V AUTH_VERSION, --auth-version=AUTH_VERSION, --os-identity-api-version=AUTH_VERSION
env[ST_AUTH_VERSION]
, env[OS_AUTH_VERSION]
,
env[OS_IDENTITY_API_VERSION]
or 1.0.-U USER, --user=USER
-K KEY, --key=KEY
-R RETRIES, --retries=RETRIES
--insecure
env[SWIFTCLIENT_INSECURE]
(set to ‘true’ to enable).--no-ssl-compression
Usage: swift auth
Display auth related authentication variables in shell friendly format.
Commands to run to export storage url and auth token into
OS_STORAGE_URL
and OS_AUTH_TOKEN
:
$ swift auth
Commands to append to a runcom file (e.g. ~/.bashrc, /etc/profile) for automatic authentication:
$ swift auth -v -U test:tester -K testing -A http://localhost:8080/auth/v1.0
Usage: swift capabilities
Retrieve capability of the proxy.
Optional positional arguments:
<proxy_url>
--json
Usage: swift delete
Delete a container or objects within a container.
Positional arguments:
[<container>]
[<object>]
Optional arguments:
-a, --all
--leave-segments
--object-threads <threads>
--container-threads <threads>
Usage: swift download
Download objects from containers.
Positional arguments:
<container>
--all
.<object>
Optional arguments:
-a, --all
-m, --marker <marker>
-p, --prefix <prefix>
-r, --remove-prefix
--prefix
<prefix>, use this
option to download items without <prefix>-o, --output <out_file>
-D, --output-dir <out_directory>
--object-threads <threads>
--container-threads <threads>
--no-download
-H, --header <header:value>
--header
“content-type:text/plain”--skip-identical
--ignore-checksum
--no-shuffle
Usage: swift list
Lists the containers for the account or the objects for a container.
Positional arguments:
[container]
Optional arguments:
-l, --long
--lh
-t, --totals
--lh,
only report totals.-p <prefix>, --prefix <prefix>
-d <delim>, --delimiter <delim>
Usage: swift post
Updates meta information for the account, container, or object. If the container is not found, it will be created automatically.
Positional arguments:
[container]
[object]
Optional arguments:
-r, --read-acl <acl>
.r:*
, .r:-.example.com
, .r:www.example.com
, account1
,
account2:user2
-w, --write-acl <acl>
-t, --sync-to <sync-to>
-k, --sync-key <sync-key>
-m, --meta <name:value>
-H, --header <header:value>
Usage: swift stat
Displays information for the account, container, or object.
Positional arguments:
[container]
[object]
Optional arguments:
--lh
Usage: swift tempurl
Generates a temporary URL for a Swift object.
Positional arguments:
<method>
<seconds>
--absolute
is passed, the Unix
timestamp when the temporary URL will expire.<path>
<key>
Optional arguments:
--absolute
Usage: swift upload
Uploads specified files and directories to the given container.
Positional arguments:
<container>
<file_or_directory>
Optional arguments:
-c, --changed
--skip-identical
-S, --segment-size <size>
--segment-container <container>
--leave-segments
--object-threads <threads>
--segment-threads <threads>
-H, --header <header:value>
--use-slo
--segment-size
it will
create a Static Large Object instead of the default
Dynamic Large Object.--object-name <object-name>
--ignore-checksum
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.