List volume types should support search extra_specs options (filters)

Registered by Rohit Karajgi

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.

Blueprint information

Status:
Complete
Approver:
John Griffith
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
Abhijeet Malawade
Definition:
Obsolete
Series goal:
Proposed for alpha-trunk
Implementation:
Unknown
Milestone target:
None
Completed by
Sean McGinnis

Related branches

Sprints

Whiteboard

(smcginnis): Marking obsolete as this has been sitting out there for a long time. If this is still needed, please submit a new bp.

None

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.