---
schema_version: "1"
id: 32aceee68119e89902a586bdae65663fa58a5233ae380aa3d067b7a0676a15af
title: 获取初始摄取状态
collection: tableau
version: current
locale: zh-cn
portal_url: https://docs.salesforce.com/tableau/current/zh-cn/server-linux/dm_tools_backfill.md
canonical_url: https://help.tableau.com/current/server-linux/zh-cn/dm_tools_backfill.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 5c295aa4fe6ea838c5f6f76a48f83599a4f6d5b9bd500e725c734c7ad4bd917b
description: Use the Backfill API to monitor initial Metadata API ingestion status for content and lineage.
---
[跳转到主要内容](#main-content)

# 获取初始摄取状态

使用 `tsm maintenance metadata-services` 命令启用 Tableau 元数据 API 后，可以使用回填 API 监视初始摄取的进度，并获取内容和世系回填的状态信息。

下面描述的步骤必须由服务器管理员执行，并建议与“启用 Tableau Catalog”主题中的[第 7 步：监控初始摄取进度并验证其状态](https://help.tableau.com/current/server-linux/zh-cn/dm_catalog_enable.htm#step7)结合使用。

## 步骤 1：使用 REST API 进行身份验证

若要访问回填 API，必须首先针对 Tableau Server 进行身份验证并获取令牌。可以使用 Tableau REST API 执行此操作。有关详细信息，请参见 REST API 帮助中的[登录和注销（身份验证）](https://help.tableau.com/current/api/rest_api/zh-cn/REST/rest_api_concepts_auth.htm)。

或者，您可以使用管理员凭据登录到 Tableau Server。

## 步骤 2：发出 GET 请求

发出以下 GET 请求或将 URL 粘贴到浏览器中：

http://my\_tableau\_server/api/metadata/v1/control/backfill/status

请求最初返回有关内容回填的信息。内容回填完成后，将返回世系回填信息。

- 对于内容回填，请求会根据 Tableau Server 上提供的内容，返回每种内容类型的状态摘要和其他状态信息。每种内容类型的索引编制操作同时进行。
- 对于世系回填，请求返回状态摘要。

### 响应中的状态值

回填 API 返回以下值。

- `contentBackfillTotalDurationSeconds` 和 `lineageBackfillTotalDurationSeconds` 是各个回填类型的进度，以秒为单位。当 `backfillComplete` 为 `true` 时，`contentBackfillTotalDurationSeconds` 和 `lineageBackfillTotalDurationSeconds` 是完成相应回填类型所花费的总时间。

对于内容回填： 

- `contentType` 可显示以下内容类型：`PublishedDatasource`、`Database`、`DatabaseTable`、`Metric`、`Workbook` 和 `Flow`。
- `contentId` 是最后一个索引项的标识符。
- `successfullyIngestedCount` 是成功编制索引的项数。
- `failedIngestedCount` 是无法编制索引的项数。
- `durationSeconds` 是为内容类型建立项索引所花费的时间（以秒为单位）。
- `totalCount` 是要编制索引的项总数。
- `checkpointCreatedTime` 是最后一次记录的为项编制索引的时间（UTC 格式）。回填 API 每五分钟检查一次是否有最后的索引项。
- 为内容类型的所有项编制索引未完成时，`backfillComplete` 为 `true`。

对于世系回填：

- `totalCount` 是要编制索引的世系关系的总数。
- `processedCount` 是已编制索引的世系关系的数量。
- `lastLineageConnection` 是最后一个编制索引的世系关系。
- 为所有世系关系编制索引完成时，`backfillComplete` 为 `true`。

### 示例响应

请求返回 JSON 文本。若要以更具可读性的形式查看 JSON，可以使用 JSON 查看器或浏览器加载项。

{        

  "contentBackfillTotalDurationSeconds": 362,

  "lineageBackfillTotalDurationSeconds": 14,

  "contentBackfillStatuses": \[

    {

	"contentType": "PublishedDatasource",

	"contentId": "sites/1/datasources/-631379806-1912815680",

	"successfullyIngestedCount": 20,

	"failedToIngestCount": 0,

	"durationSeconds": 312,

	"totalCount": 20,

	"checkpointCreatedTime": "2020-07-29T23:50:25.763Z",

	"backfillComplete": true

    },

    {

	"contentType": "Database",

	"contentId": "sites/1/databases/e1331f9d-4d73-ee04-9edf-96fd1c37cb8e",

	"successfullyIngestedCount": 35,

	"failedToIngestCount": 0,

	"durationSeconds": 26,

	"totalCount": 35,

	"checkpointCreatedTime": "2020-04-29T23:50:25.769Z",

	"backfillComplete": true

    },

    {

	"contentType": "DatabaseTable",

	"contentId": "sites/1/tables/d946d084-53a8-09b6-2ad2-93301e6b4b15",

	"successfullyIngestedCount": 64,

	"failedToIngestCount": 0,

	"durationSeconds": 49,

	"totalCount": 64,

	"checkpointCreatedTime": "2020-04-29T23:50:25.774Z",

	"backfillComplete": true

    },

    {

	"contentType": "Metric",

	"contentId": "sites/1/metrics/metric1",

	"successfullyIngestedCount": 2,

	"failedToIngestCount": 0,

	"durationSeconds": 254,

	"totalCount": 2,

	"checkpointCreatedTime": "2020-04-29T23:50:25.779Z",

	"backfillComplete": true

    },

    {

	"contentType": "Workbook",

	"contentId": "sites/1/workbooks/6749399-1501801290",

	"successfullyIngestedCount": 10,

	"failedToIngestCount": 0,

	"durationSeconds": 267,

	"totalCount": 10,

	"checkpointCreatedTime": "2020-04-29T23:50:25.784Z",

	"backfillComplete": true

    },

    {

	"contentType": "Flow",

	"contentId": "sites/1/flows/4",

	"successfullyIngestedCount": 4,

	"failedToIngestCount": 0,

	"durationSeconds": 195,

	"totalCount": 4,

	"checkpointCreatedTime": "2020-04-29T23:50:25.788Z",

	"backfillComplete": true

    }

   \],

  "lineageBackfillStatus": {

	"totalCount": 45,

	"processedCount": 18,

	"lastLineageConnection": "CloudFile downstreamWorkbooks Workbook",

	"backfillComplete": false

    }

}