]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Added volume type description for volume type API
authorGloria Gu <gloria.gu@hp.com>
Fri, 5 Dec 2014 01:59:10 +0000 (17:59 -0800)
committerGloria Gu <gloria.gu@hp.com>
Wed, 17 Dec 2014 02:13:24 +0000 (18:13 -0800)
commitcf7381598262a70ab679bdb0417a57dfd361fbbb
treee7d1fb25aef97016eec8715e979d53615180aced
parent46235141584c072d8065ffda81fdbdef7c8b5e2e
Added volume type description for volume type API

- Added the following APIs and tests for volume type
* update volume type
PUT http://<openstackhost>:8776/v2/${tenant_id}/types/${vol_type_id}
body
{
    "volume_type": {
      "description":"updated_desc"
    }
}
** user can update description.
** if update description, descripiton can be empty spaces.
** description can not be None
** only admin can access this API

*get default volume type
GET http://<openstackhost>:8776/v2/${tenant_id}/types/default
** if default_volume_type is specified in cinder.conf and is valid,
the default volume type will be returned.
** if default_volume_type is not specified in cinder.conf or is not
valid, it will return 404 with a message saying default volume type
can not be found.

- Updated the following APIs and tests for volume type
* create volume type should take description as an option.
* list volume types or get one volume type will include description for
volume type if the description is not None.

- Upgraded the database cinder on table volume_types to include
the description. database upgrade/downgrade scripts and tests
are added.

- update API should send a notification to the message bus when
updating succeeds or fails.

- as of 12/5/2014, had to rebase with master which has volume type
access change, I also fixed the tests in that area in order to get
the unit tests pass.

Implements: blueprint volume-type-description
Change-Id: I3100a8f74fa1c0cc8d9293bf30e17b6ac4c72edb
18 files changed:
cinder/api/contrib/types_manage.py
cinder/api/contrib/volume_type_access.py
cinder/api/openstack/wsgi.py
cinder/api/v2/types.py
cinder/api/views/types.py
cinder/db/api.py
cinder/db/sqlalchemy/api.py
cinder/db/sqlalchemy/migrate_repo/versions/034_sqlite_downgrade.sql [new file with mode: 0644]
cinder/db/sqlalchemy/migrate_repo/versions/034_volume_type_add_desc_column.py [new file with mode: 0644]
cinder/db/sqlalchemy/models.py
cinder/exception.py
cinder/tests/api/contrib/test_types_manage.py
cinder/tests/api/contrib/test_volume_type_access.py
cinder/tests/api/v1/test_types.py
cinder/tests/api/v2/test_types.py
cinder/tests/test_migrations.py
cinder/tests/test_volume_types.py
cinder/volume/volume_types.py