summaryrefslogtreecommitdiff
path: root/glanceclient/v2
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Adds support for Glance Tasks calls"Jenkins2014-10-163-0/+188
|\
| * Adds support for Glance Tasks callsFei Long Wang2014-09-223-0/+188
| | | | | | | | | | | | | | | | | | | | Add tasks operations on client side to support task create, list all and show. DocImpact Implement blueprint async-glance-workers Change-Id: Ib4b8e347a8a47817e3b427c8ba024e8c32f65155
* | Merge "Skip non-base properties in patch method"Jenkins2014-10-031-3/+5
|\ \
| * | Skip non-base properties in patch methodKamil Rykowski2014-09-291-3/+5
| |/ | | | | | | | | | | | | | | | | | | It's currently impossible to update properties which are defined in image schema and which are not a base image property. Proposed fix skips every non-base property when building a json patch, that is used to update image properties through glance API. Change-Id: I3b35cef379fcf437715e2966f9a0d25c1b4e4016 Closes-Bug: #1371559
* | Merge "CLI image-update gives a wrong help on '--tags' param"0.14.1Jenkins2014-09-191-1/+1
|\ \ | |/ |/|
| * CLI image-update gives a wrong help on '--tags' paramZhi Yan Liu2014-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The help message tells end user image-update interface accepts 'tags' param and could be used to update tag of image [0], but actually it could trigger an 400 exception [1] due to wrong PATCH calls, and the correct way is to use image-tag-update interface [2] as designed. [0] glance image-update <IMG_ID> --tags <TAG_VALUE> [1] 400 Bad Request Invalid JSON pointer for this resource: '/tags/0' (HTTP 400) [2] glance image-tag-update <IMG_ID> <TAG_VALUE> Change-Id: Iaa8041779510192dc08f7b898b8a1beda29a6398 Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
* | Fix v2 requests to non-bleeding edge serversLakshmi N Sampath2014-09-125-54/+71
| | | | | | | | | | | | | | | | | | | | | | | | In the case where v2 requests are sent to a server which is not running head of tree which includes the v2 metadef code some 404 cases need to be handled to enable standard requests to complete. This patch aslo improves fetching schemas -- they are now only fetched as needed. Change-Id: I8c871f11b909337bd7df19b77e606772dbc634b2 Closes-bug: #1367326
* | Support for Metadata Definitions Catalog API0.14.0Pawel Koniszewski2014-09-033-0/+756
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | API calls and shell commands added in this patch: - CRUD for metadefs namespaces; - CRUD for metadefs objects; - CRUD for metadefs properites; - CRD for metadefs resource types and resource type associations. Change-Id: I6d15f749038e8fd24fc651f0b314df5be7c673ef Implements: blueprint metadata-schema-catalog-support Co-Authored-By: Facundo Maldonado <facundo.n.maldonado@intel.com> Co-Authored-By: Michal Dulko <michal.dulko@intel.com> Co-Authored-By: Lakshmi N Sampath <lakshmi.sampath@hp.com> Co-Authored-By: Pawel Koniszewski <pawel.koniszewski@intel.com>
* | Replace old httpclient with requestsAmalaBasha2014-07-104-30/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This review implements blueprint python-request and replaces the old http client implementation in favor of a new one based on python-requests. Major changes: * raw_request and json_request removed since everything is now being handled by the same method "_request" * New methods that match HTTP's methods were added: - get - put - post - head - patch - delete * Content-Type is now being "inferred" based on the data being sent: - if it is file-like object it chunks the request - if it is a python type not instance of basestring then it'll try to serialize it to json - Every other case will keep the incoming content-type and will send the data as is. * Glanceclient's HTTPSConnection implementation will be used if no-compression flag is set to True. Co-Author: Flavio Percoco<flaper87@gmail.com> Change-Id: I09f70eee3e2777f52ce040296015d41649c2586a
* | Enable F841ChangBo Guo(gcb)2014-07-091-2/+1
|/ | | | | | | F841 detects local variable is assigned to but never used. This commit fixes the violations and enables F841 in gate. Change-Id: Ic4dcac2733dfe334009327ac17aa3952cafaa63a
* Resolving the performance issue for image listing of v2 APIZhi Yan Liu2014-07-081-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to my diagnosis [1], currently v2 API client consumed a lot of CPU times by JSON schema validation on image model initialization stage for image listing case. Because each image entry will triggers one validation operation which spent most CPU clocks. (My test env has 1002 image entries now, so it's O(N) logic obviously). This fix changed the original logic, it doesn't validate each image entry but do it only on first image entry for each page. This approach is a trade-off, it balanced the data validity and performance. As comparison [3], under the fixed new logic, the execution time of image listing is about four times as fast as old logic. [1] Clock type: CPU Ordered by: totaltime, desc name ncall ttot ..nt/v2/images.py:34 Controller.list 1003 12.08480 ../warlock/core.py:30 image.__init__ 1002 11.91074 ..warlock/model.py:28 image.__init__ 1002 11.90463 ..arlock/model.py:130 image.validate 1002 11.73838 ..nschema/validators.py:388 validate 1002 11.73682 [2] name ncall ttot ..nt/v2/images.py:35 Controller.list 1003 1.100710 ..nceclient/v2/images.py:45 paginate 256.. 1.099965 ../warlock/core.py:30 image.__init__ 1002 0.944762 ..warlock/model.py:28 image.__init__ 1002 0.939725 ..arlock/model.py:130 image.validate 51 0.779653 ..nschema/validators.py:388 validate 51 0.779431 [3] $ time glance --os-image-api-version 2 image-list | grep 'test-' | wc -l 1000 real 0m16.606s user 0m10.629s sys 0m2.540s $ time glance --os-image-api-version 2 image-list | grep 'test-' | wc -l 1000 real 0m4.151s user 0m1.080s sys 0m0.092s Change-Id: Ia6598d3c06a5ff516277053c2b6fa5db744fe9cf Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
* Prepend '/' to the delete url for the v2 clientManuel Desbonnet2014-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | ... and update tests to match. The missing slash results in a non-absolute DELETE request being sent to the API. E.g. DELETE v2/images/62fac489-23b4-4929-87af-2e7236e8542b HTTP/1.1 This is not strictly valid http/1.1 - rfc2616 specifies that the path must be absolute. This doesn't cause a problem for the API server, but this can cause problems if the API server is fronted by something else (see #133161). It also means that the curl command logged in debug mode has a bad url. E.g. curl -i -X DELETE ... http://10.0.0.13:9292v2/images/... Change-Id: Ib0c749dedbfcf07303fcddae4512db61b0f3fd78 Closes-bug: #1327101
* Merge "Add support for location parameters in v2 commands"Jenkins2014-06-172-13/+142
|\
| * Add support for location parameters in v2 commandsDavid Koo2014-06-162-13/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently glanceclient's v2 commands don't support modification operations on an image's location attribute - the argparse specification for the location attribute of the image-update command causes the image id argument to be included in list of locations and so the command parsing fails (because it causes the image id to appear to be missing). Furthermore even if the 'locations' argument were to be accepted by argparse (e.g. by changing the argument specs and using --id to specify the image id) the command would still fail because the arguments are passed directly to the schema which expects the value of the 'locations' argument to be a valid dictionary (there is nobody to convert the argument string to a python dictionary that the schema expects). This commit adds the following location related commands to glanceclient: --location-add: Add a new location to the list of image locations. --location-delete: Remove an existing location from the list of image locations. --location-update: Update the metadata of existing location. The glanceclient.v2.images.Controller class has been agumented with three new methods to support the commands listed above: - add_location - delete_locations - update_location The server has not been modified, i.e. all location related API requests are passed to the server via HTTP PATCH requests and handled by the server's image update function. The v2 'image' and 'shell' related tests have also been supplemented. Note that in order to use these options the server must be first configured to expose location related info to the clients (i.e. 'show_multiple_locations' must be set to 'True"). I also added a mailmap entry for myself. DocImpact Closes-bug: #1271452 Co-Author: David Koo (koofoss) <david.koo@huawei.com> Change-Id: Id1f320af05d9344645836359758e4aa227aafc69
* | Merge "progress flag not supported in v2 API"Jenkins2014-06-171-2/+7
|\ \ | |/ |/|
| * progress flag not supported in v2 APIwanghong2014-04-161-2/+7
| | | | | | | | | | | | | | | | Currently only download method supports --progress flag in v2 API. This patch let upload method in v2 API support this flag too. Change-Id: I1d22379c320adb47a2178697e546413b9257f987 Closes-Bug: #1286265
* | fixed typos found by RETF rulesChristian Berendt2014-05-051-1/+1
|/ | | | | | rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos Change-Id: I70245e5ddf342762eb76d8e2e74b6363767726ef
* Merge "Improve help strings"Jenkins2014-03-161-14/+14
|\
| * Improve help stringsAndreas Jaeger2014-02-261-14/+14
| | | | | | | | | | | | | | | | Make help strings consistent to use "." at end of string. Fix capitalization of API in one help string. Change-Id: I7cc5289d881c5e58aad9c69b4668584cdeb0b376
* | Merge "Python 3: do not use the unicode() function"Jenkins2014-03-041-2/+3
|\ \
| * | Python 3: do not use the unicode() functionCyril Roelandt2014-03-031-2/+3
| |/ | | | | | | | | | | | | It is Python2-specific, and should not be used in code intended to be portable. Change-Id: Ibebef1a7e51a7444538275d22d444c926b8b4dec Closes-Bug: 1284677
* | Replace file with open, which is Python 3 compatibleAlex Gaynor2014-02-131-1/+1
|/ | | | Change-Id: I471ae9b372f88a508d4654b1a18c6da90397a828
* Add support for image size in v2 api uploadEdward Hope-Morley2014-02-032-3/+10
| | | | | | | | | | | | Some backend stores e.g. RBD, will fail if told to create an image without a valid size (RBD will fail to write to a zero-size image). Here we add support to allow the image size to be provided when doing an upload. The result is that the upload content-length will be set if available either from checking the supplied file object or as provided by user. Closes-Bug: 1220197 Change-Id: Ia1f2ea5680a139750d931591949b3e0058148b4b
* Merge "Handle endpoints with versions consistently"Jenkins2014-01-241-2/+4
|\
| * Handle endpoints with versions consistentlyStuart McLaren2014-01-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using the cli the Glance client wraps the endpoint in a 'strip version' function. This means that endpoints of the following forms can both be used: https://region-x.images.example.com:443/v1 https://region-x.images.example.com:443 When calling the client library directly (as Ceilometer does) however only endpoints of the second form work. The cli and library should handle the two cases consistently. Addresses bug 1243276. Change-Id: Ice7b581fee32540a7057ba47433a10166a3caed2
* | It was removed urllib, urllib2 & urlparse modulesVictor Morales2014-01-181-3/+3
|/ | | | | | | | Those modules have been combined in python 3. Therefore, implementing the six module helps to have support to both versions. Change-Id: I164a0f19790ff066d16d0cf4f0daa6f1097c848e Closes-Bug: #1267181
* Python 3: use six.iteritems and six.string_typesYassine Lamgarchal2014-01-131-2/+2
| | | | | | | | | | six.iteritems() replaces dictionary.iteritems() on Python 2 and dictionary.items() on Python 3. six.string_types replaces basestring() in Python 2 and str in Python 3. Change-Id: Ia18510d167df35caec83626718010228e2140bc0
* Python 3: use six.iteritems() instead of iteritems()Yassine Lamgarchal2014-01-092-4/+7
| | | | | | | six.iteritems() replaces dictionary.iteritems() on Python 2 and dictionary.items() on Python 3. Change-Id: Ie5efa65c0a992e8136087a7b78ab8e8ce967326e
* Get better format for long lines with PrettyTableFei Long Wang2014-01-061-1/+3
| | | | | | | | | | | | | Based on current implement, the cli output format will be bad if the lines are too long. This issue can be fixed by setting 'max_width'. However, there is a bug against it, see https://code.google.com/p/prettytable/source/browse/trunk/CHANGELOG?r=85 line 3. So the requirements.txt is updated as well. docImpact Fixes bug 1251283 Change-Id: I0d4192ad9d10a3d6d47a8319463a5edb57719a68
* Fix and enable gating on H306Dirk Mueller2013-12-161-1/+1
| | | | | | H306 - module imports should be in alphabetical order Change-Id: I1f8fc25b0e6ca23c21c90bda420f42a45141c2e2
* Merge "Fix Pep8 errors found by Pep8 1.4.6"Jenkins2013-11-151-2/+2
|\
| * Fix Pep8 errors found by Pep8 1.4.6Dirk Mueller2013-10-181-2/+2
| | | | | | | | | | | | | | These missed E128 warnings were missed by 1.4.5, adjust the indentation. Change-Id: I7b459113a6f5143012acf959639b725238ca8a11
* | Merge "Replace OpenStack LLC with OpenStack Foundation"Jenkins2013-11-154-4/+4
|\ \ | |/ |/|
| * Replace OpenStack LLC with OpenStack FoundationZhiQiang Fan2013-09-204-4/+4
| | | | | | | | | | Change-Id: I38dcbcf1a6c8efe540fcf5f29e782cb3826e583d Fixes-Bug: #1214176
* | Add CLI for V2 image create, update, and uploadeddie-sheffield2013-10-023-2/+117
|/ | | | | | | | | | | | | | | Provides command line support for image-create, image-update, and image-upload using the Glance V2 API. This includes building help text for create and update based on the image jsonschema as fetched from the server. Also fixes bug caused by default warlock patch generation not matching what Glance expects when updating a core property which had not originally been set when the image was created. Related to bp glance-client-v2 Change-Id: I841f9e3d05802f4b794cb6f4849abe03ff0324d9
* Merge "Use openstack-images-v2.1-json-patch for update method"Jenkins2013-09-191-1/+1
|\
| * Use openstack-images-v2.1-json-patch for update methodGhe Rivero2013-08-231-1/+1
| | | | | | | | | | | | | | | | | | image.patch returns a JSON schema Draft 10 (application/openstack-images-v2.1-json-patch) while the glaceclient update method specify a Content-Type header application/openstack-images-v2.0-json-patch with correspond to a JSON schemea Draft 4. Fixes bug 1206095 Change-Id: I8c5a96f0e117a81b5b527a96ef45758fc69b518d
* | Enable query image by tagFei Long Wang2013-08-282-1/+13
|/ | | | | | | | | | This patch will enable Glance client to query images by user defined tags. Implement bp image-query-by-tag Implement bp glance-client-v2 Change-Id: I6f54630c5b7c9c567d85485ad4289284e5486814
* \Allow removal of properties using glance v2 apieddie-sheffield2013-08-131-4/+18
| | | | | | | | | | | | | | This adds support to the glance client library for removing properties from an image. Properties to be removed must be explicitly listed. There is no equivalent of the 'purge_props' functionality in v1. Also beefed up testing around create since some of the functionality is the same as update. Fixes bug 1206472 Change-Id: I16f4c39cdfc8a0cd07bede600461b7a289fbb080
* Updated from global requirementsMonty Taylor2013-08-101-1/+1
| | | | Change-Id: I2e2bd3a38458e1307bcc0410da74dc76c0a5987a
* Revert 02116565d358a4fa254217779fef82b14b38d8ca0.10.0Mark J. Washenberger2013-08-081-1/+1
| | | | | | | | A patch slipped in that modified the default image list limit in a backwards-incompatible way. This change reverts that patch, but preserves some of the formatting improvements. Change-Id: I17ae5024896ca7b1064be66b9e47653e953771d6
* Show a pretty progressbar when uploading and downloading an image.mouad benchchaoui2013-08-082-4/+8
| | | | | | | | | | | | Add a new module that contain generic wrapper for file and iterator, which are used to wrap image to upload and the request body iterator in upload and download cases repectively, to show and advance a pretty progress bar when this laters are consumed, The progress bar is triggered by adding a --progress command line argument to commands: image-create, image-download or image-update. Change-Id: I2ba42fd0c58f4fa087adb568ec3f08246cae3759 bug fix: LP#1112309 blueprint: progressbar-when-uploading
* Changes to allow image upload with V2 apieddie-sheffield2013-07-311-0/+13
| | | | | | Related to bp glance-client-v2 Change-Id: I72a1d2825dd5c1ff4890e8be477cb4447d59f136
* Enable client library V2 to create an image.eddie-sheffield2013-07-251-0/+19
| | | | | | | | | Adds support for creating an image to the client library only, not the CLI. Replaced reference to deprecated BaseException.message Related to bp glance-client-v2 Change-Id: I8e3d09d89493368d22f7b1f69f79ebd2518e289d
* Merge "Increase default page_size value"Jenkins2013-07-191-1/+1
|\
| * Increase default page_size valueJared Culp2013-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | This is a temporary solution. Increasing the default page size (which is being used everytime, since the client is ignoring nova's --limit param). This should decrease the number of queries that glance does when nova requests an image detail list. Bug 1200257 Change-Id: I7ed4521698570cbae9c20e69ddca8b11b57c65ad
* | Merge "Expose checksum index image property in client"Jenkins2013-07-171-1/+3
|\ \ | |/ |/|
| * Expose checksum index image property in clientamalaba2013-07-121-1/+3
| | | | | | | | | | | | | | Implement checksum image index property in the python-glanceclient Change-Id: If1426b7938457014ef27a86d3902d53854161627 Implements: blueprint index-using-checksum-image-property
* | Enable client V2 to update/delete tags for a given image.Venkatesh Sampath2013-07-023-1/+72
|/ | | | | | | | | Added the CLI option image-tag-update to associate a tag to an image via API V2. Added the CLI option image-tag-delete to delete a tag associated with an image via API V2. Related to bp glance-client-v2 Change-Id: I76060e1982223770a6c2c0bd9376d568af0df456
* Start using Pyflakes and HackingDirk Mueller2013-06-222-3/+1
| | | | | | | | | | Instead of globally ignoring pyflakes and hacking warnings, only blacklist those that trigger very frequently so far, in order to clean them up in followup commits. Fix and start gating on the rest already. Change-Id: Ied7c7250061e3bf379e8286e8ce3b9e4af817faf