Hide Forgot
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