54 Commits

Author SHA1 Message Date
Jenkins
473167ff31 Merge "Add -l and --lh switches to swift 'list' command" 2013-06-11 22:03:34 +00: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
Stuart McLaren
790f087a67 Add option to disable SSL compression
Allows optionally disabling SSL compression. This can significantly
improve HTTPS upload/download performance in some cases -- in particular
when the object is not compressible and you have very high network
bandwidth.

Implements blueprint ssl-compression.

Change-Id: I1260055f9c2e83cdabfeb51aed11b3899bed4d55
2013-06-04 16:33:18 +00:00
Tong Li
874e0e4427 remove busy-wait so that swift client won't use up all CPU cycles
The current implementation uses busy-wait and checking flags to
communicate between threads. It wastes a lot of CPU powers. With
python 2.6 is required for Swift, the communication between
threads should now be using queue and signal mechanisms. This
patch removed the busy-wait loops and use queue and queue join
for threads coordination which will not consume CPU cycles if
a thread is blocked.

Change-Id: I648cd637a92a159d5c13baa83f357cee2dfe7937
2013-05-29 19:09:49 +00:00
David Goetz
adebab739d do not warn about etag for slo
Change-Id: I17fa1643f28aa1cd160c2d770243875a3c4a80ee
2013-05-13 07:37:15 -07:00
Monty Taylor
1eb2c29856 Switch to flake8.
Change-Id: Ib9ba1e7eed09c5a90c558a8365d0a87c3f4b5ee5
2013-05-01 12:23:01 -04:00
Dirk Mueller
000e33d021 Improve Python 3.x compatibility
Some mechancical replacement of the deprecated except x,y:
construct with except x as y, which works with any Python
version >= 2.6

Change-Id: Ic245049dc7b408a5c89b9e27dfd2bd7c08acc5b5
2013-04-29 11:08:47 +02:00
Jenkins
2d97609a52 Merge "Static large object support." 2013-04-04 23:08:25 +00:00
Dean Troyer
fab61c8275 Improve auth option help
Add to the help strings to clarify the need for --os-auth-token to
also have --os-storage-url supplied.

Change-Id: I6a7259c38ce01813ae96f307efaf46e7863bd223
2013-04-04 15:41:22 -05:00
David Goetz
2b3d171907 Static large object support.
Also fixed bug with current large objects with segment listing prefixes.

Allow retry for object PUTs when possible.

Change-Id: I0edff127fd5d5c53da33aa7cb76a4f4dc85bf6e6
2013-04-03 09:51:15 -07:00
Jenkins
42fa4568f1 Merge "Allow user to specify headers at the command line." 2013-03-21 11:11:50 +00:00
Jenkins
f31916051d Merge "Allow v2 to use storage_url/storage_token directly" 2013-03-19 18:36:04 +00:00
tong li
48f446a938 Allow user to specify headers at the command line.
Currently swift client does not allow content type to be specified
when upload an object. It does not allow a user to change content
type neither. This patch will allow a user to specify content
type by using upload command or modify the content type by using
post command.

For example:
1. To upload an object with specific content type:
swift upload -H content-type:applicaiton/xml con1 file1

2. To modify an object to a specific content type:
swift post -H content-type:application/josn con1 file1

This patch also allow a client to specify other request headers.

Change-Id: I12db83a1d465285e0906889cc67dfaa44e059568
Fixes: bug #1154621
2013-03-18 09:48:33 -04:00
Jenkins
999e1c0f02 Merge "Added "/" check when list containers." 2013-02-28 02:58:28 +00:00
Chmouel Boudjnah
45af829aa5 Allow v2 to use storage_url/storage_token directly
- Fixes bug 1134306.

Change-Id: Ie1737c57f57bcdad50b3096c921d46a1fe5293b8
2013-02-27 13:55:05 +01:00
yuan-zhou
9ac2c99fc6 Allow to specify segment container
Fix bug 1110924

Add segment container option as part of 'swift upload -S'. If this
option is omitted, the segments will go to <container>_segments.

Example:
$ swift upload c1 obj1 -S 1 -C user_segments

Please check swift upload --help for more details

Change-Id: Ib71aae322485d8d3ac89916d37ebcac053f49e3b
2013-02-26 11:09:34 +08:00
Jian Zhang
ec38637a35 Added "/" check when list containers.
If there is a "/" in container name, print usage.

Fixs bug 1121897.

Change-Id: I633b5b7ff3a8dbc249ddd3c65439dd46c7d93b4a
2013-02-24 19:10:53 -08:00
Chmouel Boudjnah
9a484dfd63 Fix reporting version.
- Fixes bug 1102691.

Change-Id: I72749a1c87a1f337b45d193e923b437d12270b05
2013-01-22 16:32:50 +01:00
Jenkins
3d04363ba4 Merge "Add env[SWIFTCLIENT_INSECURE]" 2013-01-10 20:10:30 +00:00
You Yamagata
5edb40b442 Add env[SWIFTCLIENT_INSECURE]
Add env[SWIFTCLIENT_INSECURE] as default of --insecure option.
If set to 'true', allow to access insecure keystone server.
The name follows 'NOVACLIENT_INSECURE' in novaclient.

Change-Id: I322674eba9c07e6def97bce339815fa15191a92d
2013-01-10 13:26:53 +09:00
Chmouel Boudjnah
ab4282ebb4 Fix debug feature and add --debug to swift.
- Remove PYTHON_SWIFTCLIENT and use --debug making it more consistents
  with other openstack clients libraries.
- Fix printing the curl command.
- Don't show the body of the GET objects it could get bad on large
  objects and it's an iterator anyway.
- Use -I for showing HEADs (and not -X HEAD).

Change-Id: I954e7d3d795401fc3679725440dec36cdc80af87
2013-01-07 17:59:12 +01:00
Dean Troyer
f65f96bc59 Add --os-cacert
Add support to specify a ca certificate bundle to verify
keystone TLS (https) certificates.  This only verifies
certificates on the keystone connection, swift https
connections are unchanged.

Change-Id: I14351b405af4fd3d1970ba6656c1282a5d0a1082
2012-12-20 14:03:19 -06:00
Jenkins
7df9cadbf0 Merge "Add --insecure option to fix bug #1077869" 2012-12-09 09:19:33 +00:00
Jenkins
1662cbd0a3 Merge "Don't add trailing slash to auth URL." 2012-12-06 01:45:16 +00:00
You Yamagata
6a4dc039ff Add --insecure option to fix bug #1077869
If enable this option , swift CLI is allowed to access a keystone
server with self signed certificate.

Change-Id: I5e219fe875b246b68ac51a077e7ff15e95463adf
2012-12-05 13:26:37 +09:00
yuan-zhou
d702d00ab4 Don't segment objects smaller than --segment-size
Fix bug 1075184

Change-Id: I369e742ca802744ac20e3575828cfa881018de6d
2012-12-04 10:27:13 +08:00
Jenkins
4efe3bfa7e Merge "Adding segment size as another x-object-manifest component" 2012-12-03 19:41:46 +00:00
Juan J. Martinez
994c691d66 Don't add trailing slash to auth URL.
Adding a trailing slash to the authentication URL may interfere with
auth service implementations not using /FOO/ but /FOO as authentication
URL.

OpenStack Object Storage API 1.0 doesn't specify that the auth URL must
end in a slash and swiftclient.client doesn't force it either.

Change-Id: I4e6b6d758d5ccc884e253880513e3d8763ffc2ff
Fixes: bug #1085827
2012-12-03 10:20:33 +00:00
yuan-zhou
94511a0624 Adding segment size as another x-object-manifest component
Fix bug 1082930

Change-Id: I2cee91a8f74a3f58379b1b4aefae9401ba5b02c1
2012-11-27 15:33:50 +08:00
Nick Craig-Wood
402d87c757 Stop loss of precision when writing 'x-object-meta-mtime'
str(float) isn't a good way of converting a float to a string with all the precision

Eg

    >>> f = os.path.getmtime("z")
    >>> f
    1347717491.343554
    >>> str(f)
    '1347717491.34'
    >>> "%f" % f
    '1347717491.343554'

Change-Id: I6eb02f7f6730eff814c348d1039eae4606642b52
2012-11-18 11:42:18 +00:00
Christian Berendt
1bbee8189c fixed inconsistencies in parameter descriptions
Change-Id: I208c7fe97c8ec543b5e1cd230527d3eceb52570f
2012-11-13 08:41:42 +01:00
Jenkins
a99a37f7f6 Merge " Fix swiftclient 400 error when OS_AUTH_URL is set." 2012-10-02 06:28:09 +00:00
Donagh McCabe
68d1550f15 Add region_name support
Add --os-region-name (and OS_REGION_NAME env) to bin/swift
Add region_name to the os_options in Connection class.

bug 1019832

Change-Id: Id8515d97e5351638dce10581c7368f61518e1fa7
2012-09-11 09:26:12 +01:00
David Kranz
4b4fbf0dc0 Allow endpoint type to be specified.
Fixes bug 1037690.

Change-Id: I36b3807b2f3234c778316f1e743d27304755aed8
2012-09-04 12:53:18 -04:00
Chmouel Boudjnah
cec3a79b8b PEP8 cleanup.
Some trivial pep8 cleanup.

Change-Id: I0f02c0730bf889b2b89063bef6bcc8b71d36505c
2012-08-29 13:40:32 +02:00
Darrell Bishop
c94ca0e298 Add ability to download without writing to disk.
This patch adds a "--no-download" option to the "download" command.
When given, all writing to disk is bypassed, while still actually
downloading the data and validating etags.

This can be handy when you're using the swift command-line client to
test out a swift cluster and don't want client-side disk writing to be a
bottle-neck (but you still want to know about any etag validation
failures).

Change-Id: I0a511f473a64820161d1eb529b995900742794f2
2012-08-28 13:41:50 -07:00
Dean Troyer
55f0886066 Change '_' to '-' in options
This changes every command-line option with a '_' in its name
and changes them to '-'.  The old option names are maintained
for backward compatibility but are no longer in the help text.

BP command-options

Change-Id: I79b3c03f59ce8e253aa0dcbf0c2ed5a56d71cd0c
2012-08-23 14:16:50 -05:00
yuxcer
8e2e97fd75 Fix swiftclient 400 error when OS_AUTH_URL is set.
Description: The swift command tool will set the auth version
        to 2 if OS_AUTH_URL is set even use -V 1 option to set Version
        to 1.So when use nova/glance client and swift client in the
        same shell, and export environment OS_AUTH_URL, it will lead
        swift client to raise 400 error if swift not use keystone
        for auth.
	Fixes bug 1034158

Change-Id: I8003ff2ad4ac25fd710f87c4dab1507f6040ed3d
2012-08-22 18:06:39 +08:00
Jenkins
6941260d07 Merge "Shuffle download order (of containers and objects)" 2012-08-17 22:41:58 +00:00
Darrell Bishop
9083beb41f Shuffle download order (of containers and objects)
When downloading the same containers or objects with multiple
invocations of the swift command-line client, you'll get better
throughput and avoid "hot spots" if each client randomizes its download
order.

Note that the marker must be picked *before* shuffling the containers or
objects.

Change-Id: I7240eda57a80e1708c2483827c6329fd57d5fc51
2012-08-16 21:39:00 -07:00
Darrell Bishop
9a3aa066c3 Add timing stats to verbose download output.
When using the swift command-line tool to evaluate a Swift cluster, it
can be very handy to get some insight into the download timing.  This
patch adds timing data to verbose output for the download command.  For
each downloaded file, the printed line will also contain:
 - The time it took to send the request and receive the header
 - The total time the request took (including writing the file out
   locally)
 - The average throughput of the download

Change-Id: Ib4a995623af973bb1eed4fb52c8c0e5da935964d
2012-08-16 21:30:54 -07:00
Darrell Bishop
c87458e229 Fix container delete throughput and 409 retries.
Fix race condition in _delete_container() where all elements of
object_queue have been removed, but the last one (per thread) may not
have actually been deleted yet when the container deletion thread calls
conn.delete_container(container).  Fixes bug 1032879.

Improves container deletion throughput by immediately deleting
containers with no objects instead of waiting for all pending object
deletes to complete.  Fixes bug 1032878.

Change-Id: I404229a4c608995294e0ada77724ac8afe8d6f3c
2012-08-03 19:34:40 -07:00
Chmouel Boudjnah
c8163f4112 Use keystoneclient for authentication.
- This allows us to delegate all 2.0 authentication directly to the
  library without reimplementing ourselves.
- Support reusing a token / storage-url without re-authenticating every
  time via the switch os_storage_url os_auth_token.
- Allow auth via tenant_id instead of just tenant_name via the switch
  os_tenant_id.
- Refactor a bit to make it easier in the future to add new OS features
  (i.e: region).
- Implements blueprint use-keystoneclient-for-swiftclient.
- Fixes bug 1016641.

Change-Id: I532f38a68af884de25326aaac05a2050f5ffa1c7
2012-07-06 18:40:45 +00:00
gholt
36daad953a Now url encodes/decodes x-object-manifest values
Change-Id: I8ce7fa1cb0aba3aca622c7a793ee5d330fe4e265
2012-06-28 23:43:30 +00:00
Jenkins
47f8786cc9 Merge "Make swift exit on ctrl-c." 2012-06-27 19:52:24 +00:00
Samuel Merritt
f6c7fec991 Configurable concurrency for swift client.
The 'delete', 'download', and 'upload' commands use multiple threads
for concurrency. However, the number of threads was hardcoded at
10. This patch simply makes those configurable.

For example, if I'm downloading a lot of files but I don't want to
saturate the downstream on my Internet connection, I might choose to
use only 1 or 2 threads for object downloads. Conversely, if I'm
uploading a lot of small files across a fast network, I would want
lots of threads to speed things along.

The default number of threads is 10, so the default behavior is
unchanged.

Change-Id: I64c06741b24ca97fef5ded206d7e898bf5cab3b8
2012-06-27 12:31:21 -07:00
Jenkins
2e05673e5c Merge "Make CLI exit nonzero on error." 2012-06-27 19:30:15 +00:00
Samuel Merritt
c6cc7eaa81 Make swift exit on ctrl-c.
The first time the user presses ctrl-c, all QueueFunctionThreads will
have abort=True set on them. This will cause them to finish the work
they're doing (e.g. finish uploading the current file) but then ignore
any further work and let the process exit. Also, a notification of
this is written to stderr so the user understands why the process
didn't exit immediately.

The second time the user presses ctrl-c, the process will exit
immediately. Any in-progress operations are abandoned.

Change-Id: Ie6927f78726ac1c7998e920cb608682ead10f25b
2012-06-27 12:03:46 -07:00
Jenkins
8396e3a4cb Merge "Make swift not hang on error." 2012-06-27 19:02:58 +00:00
Dan Prince
3a11e185b3 Don't suppress openstack auth options.
Fixes LP Bug #1016600.

Change-Id: I837728aa5445b6ccd07c47bdb4d99f0c84a1d7b2
2012-06-22 11:12:21 -04:00