24 Commits

Author SHA1 Message Date
Edward Hope-Morley
4a41358cea Add support for image size in v2 api upload
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
2014-02-03 11:10:50 +00:00
Yassine Lamgarchal
2c2fdcbb39 Python 3: use six.iteritems() instead of iteritems()
six.iteritems() replaces dictionary.iteritems() on Python 2 and
dictionary.items() on Python 3.

Change-Id: Ie5efa65c0a992e8136087a7b78ab8e8ce967326e
2014-01-09 14:52:19 +01:00
Fei Long Wang
336feeb523 Get better format for long lines with PrettyTable
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
2014-01-06 20:48:54 +08:00
Jenkins
9a649d46ea Merge "Replace OpenStack LLC with OpenStack Foundation" 2013-11-15 06:33:28 +00:00
eddie-sheffield
32d9c42816 Add CLI for V2 image create, update, and upload
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
2013-10-02 13:22:55 -04:00
ZhiQiang Fan
2517203975 Replace OpenStack LLC with OpenStack Foundation
Change-Id: I38dcbcf1a6c8efe540fcf5f29e782cb3826e583d
Fixes-Bug: #1214176
2013-09-20 04:05:51 +08:00
Fei Long Wang
897ae3d795 Enable query image by tag
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
2013-08-28 14:13:27 +08:00
mouad benchchaoui
1d7da740b2 Show a pretty progressbar when uploading and downloading an image.
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
2013-08-08 15:40:15 +02:00
Jenkins
eb6ed51647 Merge "Expose checksum index image property in client" 2013-07-17 19:00:48 +00:00
amalaba
09b29aac12 Expose checksum index image property in client
Implement checksum image index property in the python-glanceclient

Change-Id: If1426b7938457014ef27a86d3902d53854161627
Implements: blueprint index-using-checksum-image-property
2013-07-12 15:05:26 +05:30
Venkatesh Sampath
b9c1df8dfc Enable client V2 to update/delete tags for a given image.
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
2013-07-02 21:32:49 +05:30
Dirk Mueller
62579fbb21 Start using Pyflakes and Hacking
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
2013-06-22 16:00:26 +02:00
iccha-sethi
18795f590a Image Members for glance v2 api
Lists, creates, deletes, updates image members using glance
v2 api.

Related to bp glance-api-v2-image-members

Change-Id: Ic018a265a1676bb0a5638a55e70a527ce6b447fc
2013-05-09 10:54:12 +00:00
Brian Rosmaita
552a68d2bf Implements filters: visibility, owner, member_status.
Includes tests.

Related to bp glance-api-v2-image-members

Change-Id: Ic48f54639fec4dc9b48819a8ffb1f0097001894c
2013-03-08 14:01:34 +00:00
Brian Waldon
8ec7468134 Replace SchemaNotFound with HTTPNotFound
Fixes bug 1131682

Change-Id: I615acbef0411677cae5d30262702babd900c0c81
2013-02-22 10:21:00 -08:00
Anita Kuno
a6ef8ed7da Adds image-delete functionality.
Change-Id: Ic10433f6eb484a4760f3e61f040e903e86b95d91
2013-01-29 15:39:46 +00:00
Brian Waldon
5069d66d51 Update command descriptions
Several commands did not have descriptions or the descriptions
they had were insufficient. This adds mission descriptions
and fattens up those that were too lean.

Change-Id: I091ae70cdae5d3f72f273519d88873cb5392ba3b
2012-08-21 13:13:09 -07:00
Lars Gellrich
137b3cf975 Enable client V2 to download images
Added the CLI option image-download to download an image via API V2.
Added utility function to save an image.
Added common iterator to validate the checksum.

Related to bp glance-client-v2

Change-Id: I0247f5a3462142dc5e9f3dc16cbe00c8e3d42f42
2012-08-09 17:14:22 +00:00
Brian Waldon
d88d8fc462 Add pagination to v2 image-list
* Use a recursive generator function to iterate over the image
  container. The presence of next links are indicators to
  continue pagination while their value drives the location of
  the next page.
* A user can pass in --page-size on the command line, or page_size
  when using the controller directly, to control how many images
  are requested with each subsequent paginated request. Default page
  size is 20.
* Add a flag (strict_url_check) for the FakeAPI class to control
  whether it chops off query params when trying to match a request
  to a fixture.
* Related to bp glance-client-v2.

Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a12
2012-07-13 20:12:06 -07:00
Brian Waldon
95a7f9dffe Prevent links from being printed in v2 CLI
Nobody wants to see links in a human interface. This prevents the
file, access, self and schema links from being printed when calling
image-show or explain.

Related to bp glance-client-v2

Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a11
2012-07-13 20:12:00 -07:00
Brian Waldon
b6cef9d145 Add support for viewing a single image through v2
* Add image-create command
* Add tests for Image model, Controller.get, and Controller.list
* Related to bp glance-client-v2

Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a06
2012-07-13 18:38:40 -07:00
Brian Waldon
f0445a1b44 Rewrite link parsing for finding v2 schemas
What we called 'links' are no longer returned in a container of
objects, they are top-level entity attribtues. This fixes the
parsing of the entities to look in the correct place when trying
to locate a specific schema.

Add a helper for printing to stderr and exiting with a non-zero
exit code.

Map 'name' to 'Attribute' when explaining a schema.

Related to bp glance-client-v2

Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a05
2012-07-13 18:38:40 -07:00
Brian Waldon
7f48506781 Add 'explain' command to v2 that describes schemas
At its core, this is adding the ability to finx a schema through
published links and convert it to a usable object.

Related to bp glance-client-v2

Change-Id: I7b38ad091c6b0ad80197eb789503cf73989893e5
2012-06-07 14:43:00 -07:00
Brian Waldon
4b62848a4c Add minimal support for the v2 API
This only allows you to run image-list, but sets up a framework
that we can use to fill in the rest of the v2 functionality.

* Related to bp glance-client-v2

Change-Id: I8827e36fdcf79fe402990a6d05898ec00cbd54c6
2012-06-04 08:49:26 -07:00