cinder/cinder/db/sqlalchemy/migrate_repo/versions/034_sqlite_downgrade.sql
Gloria Gu cf73815982 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
2014-12-16 18:13:24 -08:00

26 lines
535 B
SQL

CREATE TABLE volume_types_v33 (
created_at DATETIME,
updated_at DATETIME,
deleted_at DATETIME,
deleted BOOLEAN,
id VARCHAR(36) NOT NULL,
name VARCHAR(255),
is_public BOOLEAN,
qos_specs_id VARCHAR(36),
PRIMARY KEY (id)
);
INSERT INTO volume_types_v33
SELECT created_at,
updated_at,
deleted_at,
deleted,
id,
name,
is_public,
qos_specs_id
FROM volume_types;
DROP TABLE volume_types;
ALTER TABLE volume_types_v33 RENAME TO volume_types;