Commit Graph

94 Commits

Author SHA1 Message Date
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 8bf9e11244 Align print_dict to the left
Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a10
2012-07-13 20:11:52 -07:00
Brian Waldon e5f038b62a Convert v2 images list method to generator
We will want this to be a generator as soon as we implement
pagination. Let's establish the interface now.

Related to bp glance-client-v2

Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a07
2012-07-13 18:38:41 -07:00
Brian Waldon c398af18b0 Replace static v2 Image model with warlock model
* Add warlock v0.1.0 as a dependency
* Generate a pythonic, self-validating Image model using warlock
* Add raw method to Schema model
* Related to bp glance-client-v2

Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a04
2012-07-13 18:38:41 -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 53acf1a0ca Establish the supported importable interface
* Consumers of this client should not depend on being able to import
  any module other than glanceclient and glanceclient
* The only attributs of the glanceclient module are Client
  and __version__
* The attributes of the glanceclient.exc modules have yet to be
  locked down
* glanceclient.common.exceptions was replaced with a placeholder
  module until consumers of it are updated

Change-Id: Iea9648cd06906d65764987c1f2ee5a88ebeee748
2012-07-13 18:38:15 -07:00
Brian Waldon 49bc6f94f2 Add --is-public to image-create
This moves image-create closer to image-update by adding
--is-public and hiding the help output of --public. The
--public option will be removed once devstack no longer
depends on it.

Fix bug 1023632

Change-Id: I2c58655ba56eef1fa486246618c4fb5bd3c6c8cf
2012-07-13 08:12:45 -07:00
Jenkins c097432828 Merge "Translate is_protected to protected" 2012-07-12 22:55:10 +00:00
Jenkins 1a8ab3c3f2 Merge changes I02ddeb59,Ife231377
* changes:
  Change --protected to --is-protected in create
  Properly map boolean-like arguments to True/False
2012-07-12 22:55:02 +00:00
Jenkins 4e9bac2d0a Merge "Remove AuthorizationFailure exception" 2012-07-12 19:42:38 +00:00
Brian Waldon b7f476e211 Translate is_protected to protected
When creating or updating an image, translate the 'is_protected'
argument into the proper 'protected' image attribute.

Fix bug 1023653

Change-Id: Icfe6c38e4fda098ce3f90fd94c8fbbc18be2f4a8
2012-07-11 16:37:28 -07:00
Brian Waldon d8433ee40a Change --protected to --is-protected in create
Make image-create match image-update when specifying a specific
value for 'protected'.

Fix bug 1023650

Change-Id: I02ddeb59c1f6882b206279a71f7af8889ce4602c
2012-07-11 16:28:24 -07:00
Brian Waldon db1fabed11 Properly map boolean-like arguments to True/False
--is-public and --is-protected are now evaluated as True and False

Fix bug 1023652

Change-Id: Ife2313770eebc176e7744711956aed20f16576a5
2012-07-11 16:25:13 -07:00
Monty Taylor a814c15465 Add ability to get version information in python
* A user can access glanceclient.__version__ to get a string
  representing the version of the installed library.
* Add openstack-common's 'version' module.

Change-Id: Ib14c561d8ac0b126617a20acfbd5fdb61c54f2c7
2012-07-11 14:04:09 -07:00
Monty Taylor c315c5274f Latest setup goodness.
Upgrade the common setup code to the latest versions, and use setuptools-git
for sdist tarball generation.

Change-Id: I81eca9199b7d330ef8ec80482565a75f8475a78c
2012-07-11 12:21:29 -05:00
Brian Waldon d2ab65255f Remove AuthorizationFailure exception
The AuthorizationFailure exception isn't used anywhere, so
remove it.

Fix bug 1015940.

Change-Id: Ie6da74b63e3d1658c8ae26c272222f00f1209e38
2012-07-10 21:10:40 -07:00
Brian Waldon cf8613e76d Preserve image properties on update
* By default, image properties should not be deleted on image update.
* A user can specify --purge-props through the CLI or purge_props
  as a keyword argument to ImageManager.update to override the default
  behavior and force properties to be deleted.
* Fixes bug 1022758

Change-Id: Ib079378cb765552fc29a66913aefbbcd934d2065
2012-07-09 21:03:46 -07:00
Brian Waldon 0e8ab72357 Add --file to image-update and correct bad name
* Add the --file option to the image-update action, as it was left out
  of a previous patch
* Additionally, change a bad reference (args.fields) to args.file
* Fix bug 1022750

Change-Id: Idde127ec3f138f718d671b2133d50debec26236e
2012-07-09 15:25:10 -07:00
Jenkins 88a039488b Merge "Allow image filtering by custom properties" 2012-07-09 17:42:13 +00:00
Jenkins 7a2b39727b Merge "Expand v1 image-list filters" 2012-07-09 17:42:11 +00:00
Jenkins 12c51bbcad Merge "Add --timeout option to cli" 2012-07-09 17:42:10 +00:00
Jenkins ce806d615b Merge "Add size filtering to image-list action" 2012-07-09 17:34:41 +00:00
Jenkins cc9e28a4c1 Merge "Use PyPI for keystoneclient." 2012-07-05 20:56:15 +00:00
Brian Waldon a1691ddc10 Allow image filtering by custom properties
A user can filter a list of images by passing in a 'properties'
sub-dictionary inside of the 'filters' keyword argumen to
ImageManager.list(). The same functionality can be used through
the CLI through the use of one or more'--property-filter' options.

Related to bp glance-client-parity.

Change-Id: I7d119174d83faa894dde557e1944289de296a02c
2012-07-04 15:49:41 -07:00
Brian Waldon e7db533bc0 Expand v1 image-list filters
Add comparison filters for the v1 image-list command: --name,
--status, --container-format, --disk-format.

Related to bp glance-client-parity.

Change-Id: I27377764ea5543a4bef593f0a731b09a914a9265
2012-07-04 15:24:08 -07:00
Brian Waldon b05a9c0200 Add --timeout option to cli
Create a --timeout option to allow users to provide a custom timeout
for requests from the command line. The timeout functonality already
exists in both v1 and v2 client classes.

Related to bp glance-client-parity

Change-Id: Ic91de5eae2824b37f6aad3adc5fda28b9674250e
2012-07-04 14:52:33 -07:00
Brian Waldon 9aad246f0e Add size filtering to image-list action
Add --size-min and --size-max options to image-list to
represent the size_min and size_max filters passed to
the ImageManager.list method.

Related to bp glance-client-parity

Change-Id: Icb5458c3ed26ea754cff6360b741b3af99d1beb5
2012-07-04 14:24:38 -07:00
Adam Gandelman 2713ca1bdc Allow image upload from local file to v1 API
Allow an image to be read from a local file as an alternative to
stdin (which remains the default).

Change-Id: I81070ded9c505df7924c4efd5ae54cf3c0fa534d
2012-07-03 10:52:37 -07:00
Monty Taylor ac7121fc0e Use PyPI for keystoneclient.
Change-Id: Ib1ce43cde3e6848a873778dd9fc6aa4709df6452
2012-07-02 18:24:05 -04:00
Dan Prince e9b8f8ec2f Switch CLI to support underscores and dashes.
Update the glanceclient CLI to support both underscores and dashes.

Dashes are prefered and show up in help.

This will hopefully keep the CLI more consistent with the other
OpenStack client projects like Nova, Swift, Keystone in addition to the
old Glance client which all seem to prefer underscores to dashes.

Fixes LP Bug #1018467.

Change-Id: I80d7a19f94033554f7f639166911726de4a5159f
2012-06-29 16:47:18 -04:00
Monty Taylor 089d509f35 Split reading of versioninfo out into a method
Make the read_versioninfo to match write_versioninfo.

Additionally, there is an edge case where if the code is installed from a
github zipball, versioning info is missing. Now that we're using this,
there should be virtual no instances where a zipball will be easier or
less cost than an sdist created tarball, all of which should be public and
accessible, but during the transition, we need to account for the codepath.

Change-Id: Icd3fe97c6341bb04da27adc55a85f1ab6b525c46
2012-06-26 14:05:36 -05:00
Jenkins 993a7b7dd6 Merge "Add support for tag-based version numbers." 2012-06-26 16:58:08 +00:00
Monty Taylor 03efd16896 Add support for tag-based version numbers.
Change-Id: I9b0e24f65e9b79c39bdf279b7af9c1040ded7952
2012-06-25 10:09:44 -05:00
Bhuvan Arumugam d6e0a03a93 Support --os-endpoint-type in glanceclient.
Bug: 993993

* glanceclient/shellp.py
  OpenStackImagesShell.get_base_parser(): Parse --os-endpoint-type
  argument. Default to one defined in os.environ.
  OpenStackImagesShell._authenticate(): Define endpoint type based
  on command line argument. Use 'publicURL', if it's not specified
  in command line and also not defined in os.environ.
  OpenStackImagesShell.main(): Pass this value to authenticate.

Change-Id: I0c0cde5212198eec2a7d75fb2a7cad1cde048c7c
2012-06-23 22:28:21 -07:00
Brian Waldon 99e872a57b Hook up GET /v1/images/<id>
This allows us to get raw image data out of the API! Related to
bp glance-client-parity

Change-Id: Id5f55553d2ff3b7bf58515062afdfd4b9b183a54
2012-06-21 13:06:18 -07:00
Monty Taylor 6e1157059e Add initial docs.
Change-Id: I1f8407597105a914945c932ff55945c8005e273c
2012-06-14 14:24:05 -04:00
Clark Boylan a8d7043266 Edit build_sphinx options.
To better facilitate the building and publishing of sphinx
documentation by Jenkins we are moving all openstack projects with
sphinx documentation to a common doc tree structure. Documentation
goes in project/doc/source and build results go in project/doc/build.

Change-Id: Idf3e4472f91a1f5ae36e64b339bef99d4d960b88
2012-06-08 15:23:58 -07:00
Jenkins 0d53efe930 Merge "Add 'explain' command to v2 that describes schemas" 2012-06-08 21:29:59 +00:00
Jenkins 0246e99817 Merge "Minimize tox.ini" 2012-06-07 22:43:34 +00:00
Brian Waldon 1c3db6c756 Minimize tox.ini
Change-Id: I77d0873cbd789726b93b059429d742f1cbdc57c1
2012-06-07 14:51:29 -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 2822748bc1 Stick prettytable at v0.6
Doing this so we can align columns reliably

Change-Id: Ibdbc6f3df08d6f9c45b6e0a0f5a2440ba2637dbd
2012-06-07 14:41:14 -07:00
Brian Waldon 0935e38113 Add tests dir to pep8 command
Change-Id: I28120c67e157277202976696eea37023fb719d6d
2012-06-07 14:37:56 -07:00
Jenkins 2e81493192 Merge "Auto generate AUTHORS file for glanceclient component." 2012-06-06 20:48:14 +00:00
Brian Waldon bcff183f9a Set pep8 dependency at v1.2
Additionally, remove the pep8 dep override in tox.ini so the dep we
set in tools/test-requires is actually used

Change-Id: Iceb6d7a5dd8eceeebc1408e8a5edfabb48462d3e
2012-06-04 09:12:36 -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
Bhuvan Arumugam a1f8ea1c7f Auto generate AUTHORS file for glanceclient component.
Bug: 976267

Now that git commits are gated by CLA, we shouldn't enforce
committers to add an entry in AUTHORS file. The AUTHORS file
should be generated automatically, based on git commits.

This commit fixes the problem.

* AUTHORS
  Remove this file.

* .gitignore
  Add AUTHORS file.

* glanceclient/openstack/common/setup.py
  Sync changes from openstack-common.

* setup.py
  Generate AUTHORS file before creating the package.

* glanceclient/shell.py
  Pep8 fix.

* tests/test_authors.py
  Remove this test case.

Change-Id: I9e9d4da5ca3b147b483250dcf25a3b2a840123c2
2012-06-02 00:04:12 -07:00
Chuck Short b9b8972528 Include ChangeLog in tarball
Include ChangeLog when generating the tarball.

Change-Id: I4a65b82928e3f55775cfa5d3d51b3c3b4e1ef079
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2012-05-29 08:32:19 -04:00
Monty Taylor 32ba1385ef Properly install from zipball.
Change-Id: I505a42ec11b388e3ee5c818a1aadf0f70d5565c5
2012-05-25 14:38:33 -04:00