

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

# 尋找您的清查清單
<a name="storage-inventory-location"></a>

發佈清查清單時，資訊清單檔案會發佈到目的地儲存貯體的以下位置。

```
{{destination-prefix}}/{{{{amzn-s3-demo-source-bucket}}}}/{{config-ID}}/{{YYYY-MM-DDTHH-MMZ}}/manifest.json
 {{destination-prefix}}/{{{{amzn-s3-demo-source-bucket}}}}/{{config-ID}}/{{YYYY-MM-DDTHH-MMZ}}/manifest.checksum
 {{destination-prefix}}/{{{{amzn-s3-demo-source-bucket}}}}/{{config-ID}}/hive/dt={{YYYY-MM-DD-HH-MM}}/symlink.txt
```
+ `{{destination-prefix}}` 是物件金鑰名稱字首，可在庫存清單組態中選擇性地指定。您可以使用此字首將所有庫存清單檔案集合到目的地儲存貯體內的共同位置。
+ `{{{{amzn-s3-demo-source-bucket}}}}` 是庫存清單所適用的來源儲存貯體。當來自不同來源儲存貯體的多份庫存清單報告傳送至相同目的地儲存貯體時，會加入來源儲存貯體名稱以避免衝突。
+ 當來自相同來源儲存貯體的多份庫存清單報告傳送至相同目的地儲存貯體時，會加入 `{{config-ID}}` 以避免衝突。`{{config-ID}}` 來自庫存清單報告組態，並且是設定時定義的報告名稱。
+ `{{YYYY-MM-DDTHH-MMZ}}` 是時間戳記，由庫存清單報告產生程序開始掃描儲存貯體的開始時間與日期所組成，例如 `2016-11-06T21-32Z`。
+ `manifest.json` 是資訊清單檔案。
+ `manifest.checksum` 是 `manifest.json` 檔案內容的 MD5 雜湊。
+ `symlink.txt` 是與 Apache Hive 相容的清單檔案。

清查清單會每日或每週發佈到目的地儲存貯體的以下位置。

```
{{destination-prefix}}/{{{{amzn-s3-demo-source-bucket}}}}/{{config-ID}}/data/{{example-file-name.csv.gz}}
...
{{destination-prefix}}/{{{{amzn-s3-demo-source-bucket}}}}/{{config-ID}}/data/{{example-file-name-1.csv.gz}}
```
+ `{{destination-prefix}}` 是物件金鑰名稱字首，可在庫存清單組態中選擇性地指定。您可以使用此字首將所有庫存清單檔案集合到目的地儲存貯體中的共同位置。
+ `{{{{amzn-s3-demo-source-bucket}}}}` 是庫存清單所適用的來源儲存貯體。當來自不同來源儲存貯體的多份庫存清單報告傳送至相同目的地儲存貯體時，會加入來源儲存貯體名稱以避免衝突。
+ `{{example-file-name}}``.csv.gz` 是其中一個 CSV 庫存檔案。ORC 清查名稱的結尾是副檔名 `.orc`，而 Parquet 清查名稱的結尾則是副檔名 `.parquet`。

## 清查資訊清單
<a name="storage-inventory-location-manifest"></a>

資訊清單檔案 `manifest.json` 與 `symlink.txt` 能描述清查檔案的所在位置。每次交付新的清查清單時，都會伴隨一組新的資訊清單檔案。這些檔案可能會相互覆寫。在啟用版本控制的儲存貯體中，Amazon S3 會建立新版本的資訊清單檔案。

`manifest.json` 檔案內所包含的每個資訊清單檔案，都會提供清查中繼資料與其他基本資訊。此資訊包含下列項目：
+ 來源儲存貯體名稱
+ 目的地儲存貯體名稱
+ 庫存清單的版本
+ 採用 epoch 日期格式的建立時間戳記，內容是由庫存清單報告產生程序開始掃描儲存貯體的開始時間與日期所組成。
+ 庫存清單檔案的格式與結構描述
+ 目的地儲存貯體中的庫存清單檔案清單

每次寫入 `manifest.json` 檔案都會伴隨 `manifest.checksum` 檔案，該檔案為 `manifest.json` 檔案內容的 MD5 雜湊。

**Example `manifest.json` 檔案中的清查資訊清單**  
以下範例顯示 `manifest.json` 檔案中 CSV、ORC 和 Parquet 格式庫存清單的庫存清單檔案。  
以下清單檔案範例是 CSV 格式清查的 `manifest.json` 檔案。  

```
{
    "sourceBucket": "{{amzn-s3-demo-source-bucket}}",
    "destinationBucket": "arn:aws:s3:::example-inventory-destination-bucket",
    "version": "2016-11-30",
    "creationTimestamp" : "1514944800000",
    "fileFormat": "CSV",
    "fileSchema": "Bucket, Key, VersionId, IsLatest, IsDeleteMarker, Size, LastModifiedDate, ETag, StorageClass, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier, BucketKeyStatus, ChecksumAlgorithm, ObjectAccessControlList, ObjectOwner",
    "files": [
        {
            "key": "Inventory/{{amzn-s3-demo-source-bucket}}/2016-11-06T21-32Z/files/939c6d46-85a9-4ba8-87bd-9db705a579ce.csv.gz",
            "size": 2147483647,
            "MD5checksum": "f11166069f1990abeb9c97ace9cdfabc"
        }
    ]
}
```
以下清單檔案範例是 ORC 格式清查的 `manifest.json` 檔案。  

```
{
    "sourceBucket": "{{amzn-s3-demo-source-bucket}}",
    "destinationBucket": "arn:aws:s3:::example-destination-bucket",
    "version": "2016-11-30",
    "creationTimestamp" : "1514944800000",
    "fileFormat": "ORC",
    "fileSchema": "struct<bucket:string,key:string,version_id:string,is_latest:boolean,is_delete_marker:boolean,size:bigint,last_modified_date:timestamp,e_tag:string,storage_class:string,is_multipart_uploaded:boolean,replication_status:string,encryption_status:string,object_lock_retain_until_date:timestamp,object_lock_mode:string,object_lock_legal_hold_status:string,intelligent_tiering_access_tier:string,bucket_key_status:string,checksum_algorithm:string,object_access_control_list:string,object_owner:string>",
    "files": [
        {
            "key": "inventory/{{amzn-s3-demo-source-bucket}}/data/d794c570-95bb-4271-9128-26023c8b4900.orc",
            "size": 56291,
            "MD5checksum": "5925f4e78e1695c2d020b9f6eexample"
        }
    ]
}
```
以下清單檔案範例是 Parquet 格式清查的 `manifest.json` 檔案。  

```
{
    "sourceBucket": "{{amzn-s3-demo-source-bucket}}",
    "destinationBucket": "arn:aws:s3:::example-destination-bucket",
    "version": "2016-11-30",
    "creationTimestamp" : "1514944800000",
    "fileFormat": "Parquet",
    "fileSchema": "message s3.inventory { required binary bucket (UTF8); required binary key (UTF8); optional binary version_id (UTF8); optional boolean is_latest; optional boolean is_delete_marker; optional int64 size; optional int64 last_modified_date (TIMESTAMP_MILLIS); optional binary e_tag (UTF8); optional binary storage_class (UTF8); optional boolean is_multipart_uploaded; optional binary replication_status (UTF8); optional binary encryption_status (UTF8); optional int64 object_lock_retain_until_date (TIMESTAMP_MILLIS); optional binary object_lock_mode (UTF8); optional binary object_lock_legal_hold_status (UTF8); optional binary intelligent_tiering_access_tier (UTF8); optional binary bucket_key_status (UTF8); optional binary checksum_algorithm (UTF8); optional binary object_access_control_list (UTF8); optional binary object_owner (UTF8);}",
    "files": [
        {
           "key": "inventory/{{amzn-s3-demo-source-bucket}}/data/d754c470-85bb-4255-9218-47023c8b4910.parquet",
            "size": 56291,
            "MD5checksum": "5825f2e18e1695c2d030b9f6eexample"
        }
    ]
}
```
`symlink.txt` 檔案是與 Apache Hive 相容的清單檔案，可讓 Hive 自動探索庫存清單檔案及其相關資料檔案。Hive 相容的清單檔案適用於 Hive 相容的服務：Athena 和 Amazon Redshift Spectrum。也可以搭配與 Hive 相容的應用程式使用，包括 [https://prestodb.io/](https://prestodb.io/)、[https://hive.apache.org/](https://hive.apache.org/)、[https://databricks.com/spark/about/](https://databricks.com/spark/about/) 及其他多款應用程式。  
`symlink.txt` Apache Hive 相容的清單檔案目前不適用於  AWS Glue。  
不支援針對 ORC 和 Parquet 格式的庫存資訊清單使用 [https://hive.apache.org/](https://hive.apache.org/) 和 [https://databricks.com/spark/about/](https://databricks.com/spark/about/) 讀取 `symlink.txt` 檔案。