summaryrefslogtreecommitdiff
path: root/swiftclient
Commit message (Collapse)AuthorAgeFilesLines
* Expose --prefix as an option for st_deleteJoel Wright2017-02-231-1/+3
| | | | | | | | | The SwiftService and shell support the ability to limit deletions to only those objects that match a specified prefix, so let's expose that (really useful) behaviour in the command line help as well :) Change-Id: I9ef177aa96e4829196b5200dd8e9d0d2f7f89b63
* Merge "Accept more types of input for headers/meta"Jenkins2017-01-242-9/+21
|\
| * Accept more types of input for headers/metaTim Burke2016-11-182-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | Previously, we only accepted iterables of strings like 'Header: Value'. Now, we'll also accept lists of tuples like ('Header', 'Value') as well as dictionaries like {'Header': 'Value'}. This should be more intuitive for application developers, who are already used to being able to pass dicts or lists of tuples to libraries like requests. Change-Id: I93ed2f1e8305f0168b7a4bd90c205b04730da836
* | prefix-based tempurls supportChristopher Bartz2017-01-192-11/+28
| | | | | | | | | | | | | | | | | | Implements client-side functionality for prefix-based tempurls. Please see: https://review.openstack.org/#/c/274048/ Change-Id: I8d7701daee888ed1120271a96c0660b01543ca2d
* | Fix typo in shell.pyzhangyanxian2016-12-161-1/+1
| | | | | | | | | | | | TrivialFix Change-Id: I0b0a21df1433ec8f355c452c91a818feb9f6f134
* | Merge "modify 'swift <sub_command> —help' display"Jenkins2016-12-131-6/+12
|\ \ | |/ |/|
| * modify 'swift <sub_command> —help' displayShashirekha Gundur2016-12-131-6/+12
| | | | | | | | | | | | | | | | | | In python swiftclient: swift <sub_command> —help will now display st_<sub_command>_options + st_<sub_command>_help texts e.g. http://paste.openstack.org/show/589752/ Change-Id: I34e4b2ac29ef395f8ca474ce7a82f59a1fd8c7f4 Closes-Bug: #1621415
* | Merge "Add additional headers for HEAD/GET/DELETE requests."Jenkins2016-11-085-47/+119
|\ \
| * | Add additional headers for HEAD/GET/DELETE requests.Charles Hsu2016-11-075-47/+119
| | | | | | | | | | | | | | | Change-Id: I69276ba711057c122f97deac412e492e313c34dd Closes-Bug: 1615830
* | | Merge "Add v1password keystoneauth plugin"Jenkins2016-11-081-0/+350
|\ \ \
| * | | Add v1password keystoneauth pluginTim Burke2016-10-241-0/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets us use Keystone sessions against endpoints like swauth and tempauth with code like: import keystoneauth1.loading import keystoneauth1.session import swiftclient loader = keystoneauth1.loading.get_plugin_loader('v1password') auth_plugin = loader.load_from_options( auth_url='http://saio:8080/auth/v1.0', username='test:tester', password='testing') 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 in python-openstackclient>=3.0: export OS_AUTH_TYPE=v1password export OS_AUTH_URL=http://saio:8080/auth/v1.0 export OS_PROJECT_NAME=AUTH_test2 export OS_USERNAME=test:tester export OS_PASSWORD=testing 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> Change-Id: Ia963dc44415f72a6518227e86d9528a987e07491
* | | | Low-level API: Don't log just before raising an exceptionTim Burke2016-10-281-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only logging we should do is when we've encountered a problem *and we've dealt with it ourselves*. When we're raising an exception, it should be up to the caller to decide whether to log anything about it. Anything else is just rude. Change-Id: I1c96b76d90a78b7a10ffe63e4a7440c8f579147c Closes-Bug: 1213179 Related-Bug: 1202229
* | | | Merge "Adding keystoneauth sessions support"Jenkins2016-10-261-10/+25
|\ \ \ \ | |/ / / | | | / | |_|/ |/| |
| * | Adding keystoneauth sessions supportPaulo Ewerton2016-05-191-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows authentication in swiftclient with a keystonauth session. Co-Authored-By: Tim Burke <tim@swiftstack.com> Change-Id: Ia3fd947ff619c11ff0ce474897533dcf7b49d9b3 Closes-Bug: 1518938
* | | Remove redundant space in docstringAnh Tran2016-09-281-4/+4
| | | | | | | | | | | | | | | | | | TrivialFix Change-Id: I7012fb7bbbedfba30b8e0450a449787e9076f4ef
* | | TrivialFix: Removed redundant 'the'Anh Tran2016-09-271-2/+2
| | | | | | | | | | | | Change-Id: I3b3c0e7e4d5c8a1934378e2083a64bb686754f18
* | | Merge "Update help text around container ACL syntax"Jenkins2016-09-191-3/+5
|\ \ \ | |_|/ |/| |
| * | Update help text around container ACL syntaxMohit Motiani2016-09-141-3/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch add the information about the syntax of provding read and write access to the users within a project. The current status is: account:* does not work with tempauth account does not work with keystoneauth Furthermore, the concept of "account" is fuzzy. It could be a "project", but even that doesn't distinguish between a project id and a project name. Change-Id: I4462230fe05aa4a742e825f5b6312deb93bc1170 Closes-Bug: #1587677
* | Merge "Make tempurl subcommand insist on whole number seconds"Jenkins2016-09-151-5/+7
|\ \
| * | Make tempurl subcommand insist on whole number secondsAlistair Coles2016-09-141-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the tempurl subcommand would dump a traceback due to a TypeError if the seconds option was not an int value. With this patch it will now return the same error message as if the seconds option were negative or not a number. Also changes the error message to state that the seconds option should be a "whole number" rather than a "positive integer", since 0 is a valid value. Change-Id: Ie940d470f2be8006aa8eb7fe242f092457aeae21 Closes-Bug: #1621817
* | | Merge "Make object option dependent on container in usage strings"Jenkins2016-09-141-4/+4
|\ \ \
| * | | Make object option dependent on container in usage stringsAlistair Coles2016-09-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In usage messages, it only makes sense to have an object option if the container option has been specified. Fixes the parentheses to indicate this. Change-Id: I550ba99879ea6ce5489617a94cec36b66be270c8 Related-Change: Ie84a90eb0278dd2cdf5775948572bb140f8d2c4b
* | | | Merge "Make tempurl command check for valid object path"Jenkins2016-09-142-10/+20
|\ \ \ \ | | |/ / | |/| |
| * | | Make tempurl command check for valid object pathAlistair Coles2016-09-142-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the supplied path is not of the form /v1/a/c/o then swift tempurl subcommand will now return an error message. Also removes redundant check for seconds parameter being an int from shell.py because the same check is made when calling utils.generate_temp_url. Drive-by fix for missing param definition for generate_temp_url. Change-Id: I41f4389948b01fadaa5fc4939ea12e0ed2167345 Related-Change: I0fb2ce125fe12d660e4deb778265016bdd5ff31b
* | | | Merge "Make options arguments truely optional"Jenkins2016-09-081-9/+17
|\ \ \ \ | |/ / / | | / / | |/ / |/| |
| * | Make options arguments truely optionalChristian Schwede2016-09-061-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the options help, info and debug must exist in the options dictionary; however it might be that this is not the case if a method is imported externally. This patch fixes this. Also support using a storage URL or path as an argument for tempurl, and adding a test to verify correct output in both cases. Related-Bug: 1607519 Related-Bug: 1607523 Closes-Bug: 1607521 Change-Id: I0fb2ce125fe12d660e4deb778265016bdd5ff31b
* | | Fixed inconsistent positional arguments namingNandini Tata2016-09-071-18/+19
|/ / | | | | | | | | | | | | | | | | When printing the help menu for Swift commands, it is confusing to see both positional arguments and options not distinguished. The positional arguments are supposed to be enclosed in angular braces <>, options in square braces [] and optional positional arguments in [<>]. Change-Id: Ie84a90eb0278dd2cdf5775948572bb140f8d2c4b
* | Merge "Accept gzip-encoded API responses"Jenkins2016-09-012-3/+10
|\ \
| * | Accept gzip-encoded API responsesTim Burke2016-08-302-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we would accept gzip-encoded responses, but only because we were letting requests decode *all* responses (even object data). This restores the previous capability, but with tighter controls about which requests will accept gzipped responses and where the decoding happens. Change-Id: I4fd8b97207b9ab01b1bcf825cc16efd8ad46344a Related-Bug: 1282861 Related-Bug: 1338464
* | | Merge "Convert numeric and boolean header values to strings"Jenkins2016-08-311-0/+7
|\ \ \ | |/ / |/| |
| * | Convert numeric and boolean header values to stringsTim Burke2016-08-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently, requests got a bit more picky about what types of data it will accept as header values [1]. The reasons for this are generally sound; str()ing arbitrary objects just before pushing them out a socket may not do what the developer wanted/expected. However, there are a few standard types that developers may be sending that we should convert for them as a convenience. Now, we'll convert all int, float, and bool values to strings before sending them on to requests. Change-Id: I6c2f451009cb03cb78812f54e4ed8566076de821 Closes-Bug: 1614932
* | | Merge "client: renew token on 401 even if retries is 0"Jenkins2016-08-261-4/+4
|\ \ \
| * | | client: renew token on 401 even if retries is 0Julien Danjou2016-06-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gnocchi uses a client with retries=0 to maximize throughtput and not retry N times on e.g. 404 when checking existence of an object. However, this as the side effect of never renewing the token since there' no retry on 401 either. This patches change the behavior so that 401 errors are always retried, whatever the retries value is. Closes-Bug: #1589926 Change-Id: Ie06adf4cf17ea4592b5bbd7bbde9828e5e134e3e
* | | | boolean logic cleanup in service.Swift[Copy|Post]ObjectClay Gerrard2016-08-251-5/+4
| |/ / |/| | | | | | | | Change-Id: I07e74536502ec2479b22a825f684703d65924563
* | | Merge "Strip leading/trailing whitespace from headers"Jenkins2016-08-251-1/+1
|\ \ \
| * | | Strip leading/trailing whitespace from headersTim Burke2016-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New versions of requests will raise an InvalidHeader error otherwise. Change-Id: Idf3bcd8ac359bdda9a847bf99a78988943374134 Closes-Bug: #1614280 Closes-Bug: #1613814
* | | | Merge "Add copy object method"Jenkins2016-08-243-2/+396
|\ \ \ \ | |/ / / |/| | |
| * | | Add copy object methodMarek Kaleta2016-08-233-2/+396
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Fix unicode issues in tempurl command"Jenkins2016-08-071-17/+28
|\ \ \
| * | | Fix unicode issues in tempurl commandTim Burke2016-07-191-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we weren't encoding paths and keys as UTF-8, which would trigger a UnicodeEncodeError on py27. Change-Id: I2fad428369406c2ae32343a5e943ffb2cd1ca6ef
* | | | Add --json option to `swift capabilities` / `swift info`Tim Burke2016-08-021-7/+18
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Query string functionality for containers"Jenkins2016-06-141-9/+25
|\ \ \ | |_|/ |/| |
| * | Query string functionality for containersAndrew Welleck2016-06-091-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Added functionality for arbitrary query strings to be passed into container functions. Additionally a minor typo correction in the README. Added unit tests for query string functionality. Closes-Bug: #1542459 Change-Id: Ica2cb3ea439632588388e748d8d2e944e9ed4fa4
* | | Merge "Add an option: disable etag check on downloads"Jenkins2016-06-062-4/+10
|\ \ \
| * | | Add an option: disable etag check on downloadsCheng Li2016-06-022-4/+10
| | |/ | |/| | | | | | | | | | | | | | | | | | | This patch is to add an option of disable etag check on downloads. Change-Id: I9ad389dd691942dea6db470ca3f0543eb6e9703e Closes-bug: #1581147
* | | Suppress InsecureRequestWarning when using --insecureTim Burke2016-06-011-0/+5
|/ / | | | | | | | | | | | | | | | | The user already knows this is insecure, there's no point in bringing it up again and again. See also: https://github.com/kennethreitz/requests/issues/2214 Change-Id: I7991b2e568407269f84138bc03711147ed080c9c
* | Merge "Support client certificate/key"Jenkins2016-05-193-3/+52
|\ \
| * | Support client certificate/keyCedric Brandily2016-04-103-3/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change enables to specify a client certificate/key with: * usual CLI options (--os-cert/--os-key) * usual environment variables ($OS_CERT/$OS_KEY) Closes-Bug: #1565112 Change-Id: I12e151adcb6084d801c6dfed21d82232a3259aea
* | | Merge "Use application/directory content-type for dir markers"Jenkins2016-05-191-6/+9
|\ \ \
| * | | Use application/directory content-type for dir markersTim Burke2016-04-081-6/+9
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we were using a content-type of text/directory, but that is already defined in RFC 2425 and doesn't reflect our usage: The text/directory Content-Type is defined for holding a variety of directory information, for example, name, or email address, or logo. (From there it goes on to describe a superset of the vCard format defined in RFC 2426.) application/directory, on the other hand, is used by Static Web [1] and is used by cloudfuse [2]. Seems like as sane a choice as any to standardize on. [1] https://github.com/openstack/swift/blob/2.5.0/swift/common/middleware/staticweb.py#L71-L75 [2] https://github.com/redbo/cloudfuse/blob/1.0/README#L105-L106 Change-Id: I19e30484270886292d83f50e7ee997b6e1623ec7