'Deletes an existing volume type.'

@wsgi.action('delete')
def _delete(self, req, id):

    context = req.environ['cinder.context']
    authorize(context)
    try:
        vol_type = volume_types.get_volume_type(context, id)
        volume_types.destroy(context, vol_type['id'])
        self._notify_volume_type_info(context, 'volume_type.delete', vol_type)
    except exception.VolumeTypeInUse as err:
        self._notify_volume_type_error(context, 'volume_type.delete', err, volume_type=vol_type)
        msg = _('Target    volume    type    is    still    in    use.')
        raise webob.exc.HTTPBadRequest(explanation=msg)
    except exception.VolumeTypeNotFound as err:
        self._notify_volume_type_error(context, 'volume_type.delete', err, id=id)
        raise
    return webob.Response(status_int=http_client.ACCEPTED)
