Method: projects.locations.collections.dataStores.branches.documents.purge

永久删除分支中的所有选定 Document

此过程是异步的。根据待删除 Document 的数量,此操作可能耗时数小时才能完成。在删除操作完成之前,DocumentService.GetDocumentDocumentService.ListDocuments 仍可能返回部分 Document

如要获取待删除 Document 的列表,请将 PurgeDocumentsRequest.force 设置为 false。

HTTP 请求

POST https://discoveryengine.googleapis.com/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge

网址采用 gRPC 转码语法。

路径参数

参数
parent

string

必需。父级资源的名称,例如 projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}

请求正文

请求正文中包含结构如下的数据:

JSON 表示法
{
  "filter": string,
  "errorConfig": {
    object (PurgeErrorConfig)
  },
  "force": boolean,

  // Union field source can be only one of the following:
  "gcsSource": {
    object (GcsSource)
  },
  "inlineSource": {
    object (InlineSource)
  }
  // End of list of possible types for union field source.
}
字段
filter

string

必需。用于匹配要完全清除的文档的过滤条件。目前唯一支持的值是 *(所有项)。

errorConfig

object (PurgeErrorConfig)

完全清除过程中发生的错误的预期存储位置。

force

boolean

实际执行完全清除操作。如果 force 设置为 false,则返回预期的完全清除计数,但不删除任何文档。

联合字段 source。要根据文档 ID 完全清除文档的预期输入源。source 只能是下列其中一项:
gcsSource

object (GcsSource)

输入内容所在的 Cloud Storage 位置。支持的 dataSchema:* documentId:每行一个有效的 Document.id

inlineSource

object (InlineSource)

用作完全清除操作的输入内容的内嵌来源。

响应正文

如果成功,则响应正文包含一个 Operation 实例。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.readwrite

如需了解详情,请参阅 Authentication Overview

IAM 权限

需要拥有 parent 资源的以下 IAM 权限:

  • discoveryengine.documents.purge

如需了解详情,请参阅 IAM 文档