---
schema_version: "1"
id: a7c95dbf2c201ed4b266c7734d340e216cecf4e78286b8044e0024e9d81475d5
title: 獲取初始擷取狀態
collection: tableau
version: current
locale: zh-tw
portal_url: https://docs.salesforce.com/tableau/current/zh-tw/server-linux/dm_tools_backfill.md
canonical_url: https://help.tableau.com/current/server-linux/zh-tw/dm_tools_backfill.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 9bf7cd20e43ac11e36c34193d7b1adaf5f52430d9984bfff3616121ee6ced255
description: Use the Backfill API to monitor initial Metadata API ingestion status for content and lineage.
---
[跳至主要內容](#main-content)

# 獲取初始擷取狀態

在使用 `tsm maintenance metadata-services` 指令啟用 Tableau Metadata API 後，您可以使用回填 API 來監視初始擷取的進度並取得內容和歷程回填的狀態資訊。

下面描述的步驟必須由伺服器管理員執行，並建議與「啟用 Tableau Catalog」主題中的[步驟 7：監視初始擷取進度並驗證其狀態](https://help.tableau.com/current/server-linux/zh-tw/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-tw/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

    }

}