

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 存取資料儲存庫任務
<a name="view-data-repo-tasks"></a>

建立資料儲存庫任務之後，您可以使用 Amazon FSx 主控台、CLI 和 API 來存取任務，以及帳戶中所有現有的任務。Amazon FSx 提供下列詳細任務資訊：
+ 所有現有的任務。
+ 特定檔案系統的所有任務。
+ 特定資料儲存庫關聯的所有任務。
+ 具有特定生命週期狀態的所有任務。如需任務生命週期狀態值的詳細資訊，請參閱 [了解任務的狀態和詳細資訊](data-repo-task-status.md)。

您可以使用 Amazon FSx 主控台、CLI 或 API 存取帳戶中所有現有的資料儲存庫任務，如下所述。

## 檢視資料儲存庫任務和任務詳細資訊 （主控台）
<a name="access-all-tasks-console"></a>

1. 在 [https://console.aws.amazon.com/fsx/](https://console.aws.amazon.com/fsx/)：// 開啟 Amazon FSx 主控台。

1. 在導覽窗格中，選擇要檢視資料儲存庫任務的檔案系統。檔案系統詳細資訊頁面隨即出現。

1. 在檔案系統詳細資訊頁面上，選擇**資料儲存庫**索引標籤。此檔案系統的任何任務都會出現在**資料儲存庫任務**面板上。

1. 若要查看任務的詳細資訊，請在資料儲存庫任務面板中選擇任務 **ID** 或**任務名稱**。 ****任務詳細資訊頁面隨即出現。  
![\[資料儲存庫任務頁面\]](http://docs.aws.amazon.com/zh_tw/fsx/latest/LustreGuide/images/task-details-rprt.png)

## 擷取資料儲存庫任務和任務詳細資訊 (CLI)
<a name="task-details-cli"></a>

使用 Amazon FSx [https://docs.aws.amazon.com/cli/latest/reference/fsx/describe-data-repository-tasks.html](https://docs.aws.amazon.com/cli/latest/reference/fsx/describe-data-repository-tasks.html) CLI 命令，您可以檢視帳戶中所有資料儲存庫任務及其詳細資訊。 [https://docs.aws.amazon.com/fsx/latest/APIReference/API_DescribeDataRepositoryTasks.html](https://docs.aws.amazon.com/fsx/latest/APIReference/API_DescribeDataRepositoryTasks.html)是同等的 API 命令。
+ 使用下列命令來檢視您帳戶中的所有資料儲存庫任務物件。

  ```
  aws fsx describe-data-repository-tasks
  ```

  如果命令成功，Amazon FSx 會以 JSON 格式傳回回應。

  ```
  {
      "DataRepositoryTasks": [
          {
              "Lifecycle": "EXECUTING",
              "Paths": [],
              "Report": {
                  "Path":"s3://dataset-01/reports",
                  "Format":"REPORT_CSV_20191124",
                  "Enabled":true,
                  "Scope":"FAILED_FILES_ONLY"
              },
              "StartTime": 1591863862.288,
              "EndTime": ,
              "Type": "EXPORT_TO_REPOSITORY",
              "Tags": [],
              "TaskId": "task-0123456789abcdef3",
              "Status": {
                  "SucceededCount": 4255,
                  "TotalCount": 4200,
                  "FailedCount": 55,
                  "LastUpdatedTime": 1571863875.289
              },
              "FileSystemId": "fs-0123456789a7",
              "CreationTime": 1571863850.075,
              "ResourceARN": "arn:aws:fsx:us-east-1:1234567890:task/task-0123456789abcdef3"
          },
          {
              "Lifecycle": "FAILED",
              "Paths": [],
              "Report": {
                  "Enabled": false,
              },
              "StartTime": 1571863862.288,
              "EndTime": 1571863905.292,
              "Type": "EXPORT_TO_REPOSITORY",
              "Tags": [],
              "TaskId": "task-0123456789abcdef1",
              "Status": {
                  "SucceededCount": 1153,
                  "TotalCount": 1156,
                  "FailedCount": 3,
                  "LastUpdatedTime": 1571863875.289
              },
              "FileSystemId": "fs-0123456789abcdef0",
              "CreationTime": 1571863850.075,
              "ResourceARN": "arn:aws:fsx:us-east-1:1234567890:task/task-0123456789abcdef1"
          },
          {
              "Lifecycle": "SUCCEEDED",
              "Paths": [],
              "Report": {
                  "Path":"s3://dataset-04/reports",
                  "Format":"REPORT_CSV_20191124",
                  "Enabled":true,
                  "Scope":"FAILED_FILES_ONLY"
              },
              "StartTime": 1571863862.288,
              "EndTime": 1571863905.292,
              "Type": "EXPORT_TO_REPOSITORY",
              "Tags": [],
              "TaskId": "task-04299453935122318",
              "Status": {
                  "SucceededCount": 258,
                  "TotalCount": 258,
                  "FailedCount": 0,
                  "LastUpdatedTime": 1771848950.012,
              },
              "FileSystemId": "fs-0123456789abcdef0",
              "CreationTime": 1771848950.012,
              "ResourceARN": "arn:aws:fsx:us-east-1:1234567890:task/task-0123456789abcdef0"
          }
      ]
  }
  ```

## 依檔案系統檢視任務
<a name="view-tasks-by-fs"></a>

您可以使用 Amazon FSx 主控台、CLI 或 API 檢視特定檔案系統的所有任務，如下所述。

### 依檔案系統檢視任務 （主控台）
<a name="tasks-by-fs-console"></a>

1. 在導覽窗格中選擇**檔案系統**。**檔案系統**頁面隨即出現。

1. 選擇您要檢視資料儲存庫任務的檔案系統。檔案系統詳細資訊頁面隨即出現。

1. 在檔案系統詳細資訊頁面上，選擇**資料儲存庫**索引標籤。此檔案系統的任何任務都會出現在**資料儲存庫任務**面板上。

### 依檔案系統擷取任務 (CLI)
<a name="task-by-fs-cli"></a>
+ 使用下列命令來檢視檔案系統 的所有資料儲存庫任務`fs-0123456789abcdef0`。

  ```
  aws fsx describe-data-repository-tasks \
      --filters Name=file-system-id,Values=fs-0123456789abcdef0
  ```

  如果命令成功，Amazon FSx 會以 JSON 格式傳回回應。

  ```
  {
      "DataRepositoryTasks": [
          {
              "Lifecycle": "FAILED",
              "Paths": [],
              "Report": {
                  "Path":"s3://dataset-04/reports",
                  "Format":"REPORT_CSV_20191124",
                  "Enabled":true,
                  "Scope":"FAILED_FILES_ONLY"
              },
              "StartTime": 1571863862.288,
              "EndTime": 1571863905.292,
              "Type": "EXPORT_TO_REPOSITORY",
              "Tags": [],
              "TaskId": "task-0123456789abcdef1",
              "Status": {
                  "SucceededCount": 1153,
                  "TotalCount": 1156,
                  "FailedCount": 3,
                  "LastUpdatedTime": 1571863875.289
              },
              "FileSystemId": "fs-0123456789abcdef0",
              "CreationTime": 1571863850.075,
              "ResourceARN": "arn:aws:fsx:us-east-1:1234567890:task/task-0123456789abcdef1"
          },
          {
              "Lifecycle": "SUCCEEDED",
              "Paths": [],
              "Report": {
                  "Enabled": false,
              },
              "StartTime": 1571863862.288,
              "EndTime": 1571863905.292,
              "Type": "EXPORT_TO_REPOSITORY",
              "Tags": [],
              "TaskId": "task-0123456789abcdef0",
              "Status": {
                  "SucceededCount": 258,
                  "TotalCount": 258,
                  "FailedCount": 0,
                  "LastUpdatedTime": 1771848950.012,
              },
              "FileSystemId": "fs-0123456789abcdef0",
              "CreationTime": 1771848950.012,
              "ResourceARN": "arn:aws:fsx:us-east-1:1234567890:task/task-0123456789abcdef0"
          }
      ]
  }
  ```