'Create a new backup.'

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

    LOG.debug('Creating    new    backup    %s', body)
    self.assert_valid_body(body, 'backup')
    context = req.environ['cinder.context']
    backup = body['backup']
    req_version = req.api_version_request
    try:
        volume_id = backup['volume_id']
    except KeyError:
        msg = _('Incorrect    request    body    format')
        raise exc.HTTPBadRequest(explanation=msg)
    container = backup.get('container', None)
    if container:
        utils.check_string_length(container, 'Backup    container', min_length=0, max_length=255)
    self.validate_name_and_description(backup)
    name = backup.get('name', None)
    description = backup.get('description', None)
    incremental = backup.get('incremental', False)
    force = backup.get('force', False)
    snapshot_id = backup.get('snapshot_id', None)
    metadata = (backup.get('metadata', None) if req_version.matches('3.43') else None)
    LOG.info('Creating    backup    of    volume    %(volume_id)s    in    container    %(container)s', {'volume_id': volume_id, 'container': container}, context=context)
    try:
        new_backup = self.backup_api.create(context, name, description, volume_id, container, incremental, None, force, snapshot_id, metadata)
    except (exception.InvalidVolume, exception.InvalidSnapshot, exception.InvalidVolumeMetadata, exception.InvalidVolumeMetadataSize) as error:
        raise exc.HTTPBadRequest(explanation=error.msg)
    except exception.ServiceNotFound as error:
        raise exc.HTTPServiceUnavailable(explanation=error.msg)
    retval = self._view_builder.summary(req, dict(new_backup))
    return retval
