'Delete a volume.'

@wsgi.Controller.api_version('2.1', MAX_PROXY_API_SUPPORT_VERSION)
@wsgi.response(202)
@extensions.expected_errors((400, 404))
def delete(self, req, id):

    context = req.environ['nova.context']
    context.can(vol_policies.BASE_POLICY_NAME)
    try:
        self.volume_api.delete(context, id)
    except exception.InvalidInput as e:
        raise exc.HTTPBadRequest(explanation=e.format_message())
    except exception.VolumeNotFound as e:
        raise exc.HTTPNotFound(explanation=e.format_message())
