'Accept a new volume transfer.'

@wsgi.response(http_client.ACCEPTED)
def accept(self, req, id, body):

    transfer_id = id
    LOG.debug('Accepting    volume    transfer    %s', transfer_id)
    self.assert_valid_body(body, 'accept')
    context = req.environ['cinder.context']
    accept = body['accept']
    try:
        auth_key = accept['auth_key']
    except KeyError:
        msg = _('Incorrect    request    body    format')
        raise exc.HTTPBadRequest(explanation=msg)
    LOG.info('Accepting    transfer    %s', transfer_id)
    try:
        accepted_transfer = self.transfer_api.accept(context, transfer_id, auth_key)
    except exception.VolumeSizeExceedsAvailableQuota as error:
        raise exc.HTTPRequestEntityTooLarge(explanation=error.msg, headers={'Retry-After': '0'})
    except exception.InvalidVolume as error:
        raise exc.HTTPBadRequest(explanation=error.msg)
    transfer = self._view_builder.summary(req, dict(accepted_transfer))
    return transfer
