Bug 1041711 - [RFE][cinder]: List volume types should support search extra_specs options (filters)
Summary: [RFE][cinder]: List volume types should support search extra_specs options (f...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: RFEs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: RHOS Maint
QA Contact:
URL: https://blueprints.launchpad.net/cind...
Whiteboard: upstream_milestone_none upstream_stat...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-12 18:45 UTC by RHOS Integration
Modified: 2015-11-20 19:54 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-19 17:14:26 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description RHOS Integration 2013-12-12 18:45:50 UTC
Cloned from launchpad blueprint https://blueprints.launchpad.net/cinder/+spec/list-volume-types-filters.

Description:

The list volume types (GET) API currently only lists all the existing volume types.
​https://github.com/openstack/cinder/blob/master/cinder/api/v2/types.py#L58

However, the internal method called by this API supports searching the volume types by accepting search_options. This is not utilized by the list volume types method, hence user cannot leverage this filter functionality.
Update cinder volume_types index() method to accept search options according to the volume type's extra specs, and display the filtered results.
Eg: There are two volume types in the system:
{
    "volume_types": [
        {
            "extra_specs": {'capabilities': 'gpu'},
            "id": "6685584b-1eac-4da6-b5c3-555430cf68ff",
            "name": "SSD"
        },
        {
            "extra_specs": {'capabilities': 'datamotion'},
            "id": "8eb69a46-df97-4e41-9586-9a40a7533803",
            "name": "SATA"
        }
    ]
}
GET ​http://10.2.3.102:8776/v2/73918d5d3656403e9c76f76c26a1f6e0/types?extra_specs={"capabilities":"gpu"}
should return only:
{
    "volume_types": [
        {
            "extra_specs": {'capabilities': 'gpu'},
            "id": "6685584b-1eac-4da6-b5c3-555430cf68ff",
            "name": "SSD"
        }
     ]
}
If user requests for all the volume types that support 'gpu' capability, then only those volume types should be displayed. Currently this functionality is not provided by the public API but internal support is there as per
​https://github.com/openstack/cinder/blob/master/cinder/volume/volume_types.py#L60

Here 'user' ==> admin user.

Add the above support in Cinder.

Specification URL (additional information):

None


Note You need to log in before you can comment on or make changes to this bug.