

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

# 敏感資料偵測 API
<a name="aws-glue-api-sensitive-data-api"></a>

敏感資料偵測 API 說明用於跨結構化資料的資料行和資料列偵測敏感資料的 API。

## 資料類型
<a name="aws-glue-api-sensitive-data-api-objects"></a>
+ [CustomEntityType 結構](#aws-glue-api-sensitive-data-api-CustomEntityType)

## CustomEntityType 結構
<a name="aws-glue-api-sensitive-data-api-CustomEntityType"></a>

表示自訂模式的物件，可用於跨結構化資料的資料欄和資料列偵測敏感資料。

**欄位**
+ `Name` – *必要：*UTF-8 字串，長度不可小於 1 個位元組，也不可以超過 255 個位元組，且需符合[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)。

  允許稍後擷取或刪除的自訂模式的名稱。此名稱在每個 AWS 帳戶必須是唯一的。
+ `RegexString` – *必要：*UTF-8 字串，長度不可小於 1 個位元組，也不可以超過 255 個位元組，且需符合[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)。

  用於偵測自訂模式中敏感資料的規則運算式字串。
+ `ContextWords` – UTF-8 字串的陣列，不可小於 1 或超過 20 個字串。

  內容文字清單。如果在規則運算式範疇內沒有找到這些內容文字，則不會將資料偵測為敏感資料。

  如果沒有內容文字，則只會檢查規則運算式。

## 作業
<a name="aws-glue-api-sensitive-data-api-actions"></a>
+ [CreateCustomEntityType 動作 (Python: create\_custom\_entity\_type)](#aws-glue-api-sensitive-data-api-CreateCustomEntityType)
+ [DeleteCustomEntityType 動作 (Python: delete\_custom\_entity\_type)](#aws-glue-api-sensitive-data-api-DeleteCustomEntityType)
+ [GetCustomEntityType 動作 (Python: get\_custom\_entity\_type)](#aws-glue-api-sensitive-data-api-GetCustomEntityType)
+ [BatchGetCustomEntityTypes 動作 (Python: batch\_get\_custom\_entity\_types)](#aws-glue-api-sensitive-data-api-BatchGetCustomEntityTypes)
+ [ListCustomEntityTypes 動作 (Python: list\_custom\_entity\_types)](#aws-glue-api-sensitive-data-api-ListCustomEntityTypes)

## CreateCustomEntityType 動作 (Python: create\_custom\_entity\_type)
<a name="aws-glue-api-sensitive-data-api-CreateCustomEntityType"></a>

建立用於跨結構化資料的資料欄和資料列偵測敏感資料的自訂模式。

您建立的每個自訂模式都會指定一個規則運算式和一個可選的內容文字清單。如果沒有內容文字，則只會檢查規則運算式。

**請求**
+ `Name` – *必要：*UTF-8 字串，長度不可小於 1 個位元組，也不可以超過 255 個位元組，且需符合[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)。

  允許稍後擷取或刪除的自訂模式的名稱。此名稱在每個 AWS 帳戶必須是唯一的。
+ `RegexString` – *必要：*UTF-8 字串，長度不可小於 1 個位元組，也不可以超過 255 個位元組，且需符合[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)。

  用於偵測自訂模式中敏感資料的規則運算式字串。
+ `ContextWords` – UTF-8 字串的陣列，不可小於 1 或超過 20 個字串。

  內容文字清單。如果在規則運算式範疇內沒有找到這些內容文字，則不會將資料偵測為敏感資料。

  如果沒有內容文字，則只會檢查規則運算式。
+ `Tags` – 金鑰值對的映射陣列，不超過 50 對。

  每個金鑰均為 UTF-8 字串，長度不可小於 1 個位元組，也不可以超過 128 個位元組。

  每個值都是 UTF-8 字串，長度不可超過 256 個位元組。

  套用至自訂實體類型的標籤清單。

**回應**
+ `Name` – UTF-8 字串，長度不可小於 1 個位元組，也不可以超過 255 個位元組，需符合[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)。

  您建立的自訂模式的名稱。

**錯誤**
+ `AccessDeniedException`
+ `AlreadyExistsException`
+ `IdempotentParameterMismatchException`
+ `InternalServiceException`
+ `InvalidInputException`
+ `OperationTimeoutException`
+ `ResourceNumberLimitExceededException`

## DeleteCustomEntityType 動作 (Python: delete\_custom\_entity\_type)
<a name="aws-glue-api-sensitive-data-api-DeleteCustomEntityType"></a>

透過指定自訂模式的名稱來將其刪除。

**請求**
+ `Name` – *必要：*UTF-8 字串，長度不可小於 1 個位元組，也不可以超過 255 個位元組，且需符合[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)。

  您要刪除的自訂模式的名稱。

**回應**
+ `Name` – UTF-8 字串，長度不可小於 1 個位元組，也不可以超過 255 個位元組，需符合[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)。

  您刪除的自訂模式的名稱。

**錯誤**
+ `EntityNotFoundException`
+ `AccessDeniedException`
+ `InternalServiceException`
+ `InvalidInputException`
+ `OperationTimeoutException`

## GetCustomEntityType 動作 (Python: get\_custom\_entity\_type)
<a name="aws-glue-api-sensitive-data-api-GetCustomEntityType"></a>

透過指定自訂模式的名稱來擷取其詳細資訊。

**請求**
+ `Name` – *必要：*UTF-8 字串，長度不可小於 1 個位元組，也不可以超過 255 個位元組，且需符合[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)。

  您要擷取的自訂模式的名稱。

**回應**
+ `Name` – UTF-8 字串，長度不可小於 1 個位元組，也不可以超過 255 個位元組，需符合[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)。

  您擷取的自訂模式的名稱。
+ `RegexString` – UTF-8 字串，長度不可小於 1 個位元組，也不可以超過 255 個位元組，需符合[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)。

  用於偵測自訂模式中敏感資料的規則運算式字串。
+ `ContextWords` – UTF-8 字串的陣列，不可小於 1 或超過 20 個字串。

  建立自訂模式時指定的內容文字清單。如果在規則運算式範疇內沒有找到這些內容文字，則不會將資料偵測為敏感資料。

**錯誤**
+ `EntityNotFoundException`
+ `AccessDeniedException`
+ `InternalServiceException`
+ `InvalidInputException`
+ `OperationTimeoutException`

## BatchGetCustomEntityTypes 動作 (Python: batch\_get\_custom\_entity\_types)
<a name="aws-glue-api-sensitive-data-api-BatchGetCustomEntityTypes"></a>

擷取由名稱清單指定的自訂模式的詳細資訊。

**請求**
+ `Names` – *必要：*UTF-8 字串的陣列，不可小於 1 或超過 50 個字串。

  您要擷取的自訂模式的名稱清單。

**回應**
+ `CustomEntityTypes` – 一個 [CustomEntityType](#aws-glue-api-sensitive-data-api-CustomEntityType) 物件陣列。

  表示已建立的自訂模式的 `CustomEntityType` 物件清單。
+ `CustomEntityTypesNotFound` – UTF-8 字串的陣列，不可小於 1 或超過 50 個字串。

  未找到的自訂模式的名稱清單。

**錯誤**
+ `InvalidInputException`
+ `InternalServiceException`
+ `OperationTimeoutException`

## ListCustomEntityTypes 動作 (Python: list\_custom\_entity\_types)
<a name="aws-glue-api-sensitive-data-api-ListCustomEntityTypes"></a>

列出已建立的所有自訂模式。

**請求**
+ `NextToken` – UTF-8 字串。

  位移結果的分頁字符。
+ `MaxResults` – 數字 (整數)，不可小於 1，也不可以大於 1000。

  回傳結果的數量上限。
+ `Tags` – 金鑰值對的映射陣列，不超過 50 對。

  每個金鑰均為 UTF-8 字串，長度不可小於 1 個位元組，也不可以超過 128 個位元組。

  每個值都是 UTF-8 字串，長度不可超過 256 個位元組。

  鍵/值對標籤清單。

**回應**
+ `CustomEntityTypes` – 一個 [CustomEntityType](#aws-glue-api-sensitive-data-api-CustomEntityType) 物件陣列。

  表示自訂模式的 `CustomEntityType` 物件清單。
+ `NextToken` – UTF-8 字串。

  如有多個結果可用，即為分頁字符。

**錯誤**
+ `InvalidInputException`
+ `OperationTimeoutException`
+ `InternalServiceException`