content_policies
Creates, updates, deletes, gets or lists a content_policies resource.
Overview
| Name | content_policies |
| Type | Resource |
| Id | google.dlp.content_policies |
Fields
The following fields are returned by SELECT queries:
- projects_locations_content_policies_get
- projects_locations_content_policies_list
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. Resource name of the policy. |
createTime | string (google-datetime) | Output only. The creation timestamp of a contentPolicy; output-only field. |
defaultAction | object | Action to take if the content is scanned and no rules match. Defaults to returning an ALLOW verdict if not set. (id: GooglePrivacyDlpV2PolicyAction) |
displayName | string | Optional. Display name (max 63 chars) |
errors | array | Output only. A stream of errors encountered when the policy was applied. Output only field. Will return the last 100 errors. Whenever the policy is modified this list will be cleared. |
failedToScanSupportedFileType | object | Optional. Action to take if the content is a supported file type and size but fails to be scanned, for example because the file is encrypted or corrupted. (id: GooglePrivacyDlpV2PolicyAction) |
inputTooLarge | object | Optional. Action to take if the content is a supported file type but is too large to be scanned. (id: GooglePrivacyDlpV2PolicyAction) |
inspectConfig | object | Optional. InspectConfig to use to produce findings. (id: GooglePrivacyDlpV2InspectConfig) |
inspectTemplate | object | Optional. InspectTemplate to use to produce findings. Deprecated: use inspect_config instead. (id: GooglePrivacyDlpV2InspectTemplate) |
loggingConfigs | array | Optional. Log the actions taken by the content policy to external systems. |
rules | array | Required. Policies to apply, based on the findings returned by inspection. The first rule to match applies. |
unsupportedFileType | object | Optional. Action to take if the content is an unsupported file type. (id: GooglePrivacyDlpV2PolicyAction) |
updateTime | string (google-datetime) | Output only. The last update timestamp of a contentPolicy; output-only field. |
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. Resource name of the policy. |
createTime | string (google-datetime) | Output only. The creation timestamp of a contentPolicy; output-only field. |
defaultAction | object | Action to take if the content is scanned and no rules match. Defaults to returning an ALLOW verdict if not set. (id: GooglePrivacyDlpV2PolicyAction) |
displayName | string | Optional. Display name (max 63 chars) |
errors | array | Output only. A stream of errors encountered when the policy was applied. Output only field. Will return the last 100 errors. Whenever the policy is modified this list will be cleared. |
failedToScanSupportedFileType | object | Optional. Action to take if the content is a supported file type and size but fails to be scanned, for example because the file is encrypted or corrupted. (id: GooglePrivacyDlpV2PolicyAction) |
inputTooLarge | object | Optional. Action to take if the content is a supported file type but is too large to be scanned. (id: GooglePrivacyDlpV2PolicyAction) |
inspectConfig | object | Optional. InspectConfig to use to produce findings. (id: GooglePrivacyDlpV2InspectConfig) |
inspectTemplate | object | Optional. InspectTemplate to use to produce findings. Deprecated: use inspect_config instead. (id: GooglePrivacyDlpV2InspectTemplate) |
loggingConfigs | array | Optional. Log the actions taken by the content policy to external systems. |
rules | array | Required. Policies to apply, based on the findings returned by inspection. The first rule to match applies. |
unsupportedFileType | object | Optional. Action to take if the content is an unsupported file type. (id: GooglePrivacyDlpV2PolicyAction) |
updateTime | string (google-datetime) | Output only. The last update timestamp of a contentPolicy; output-only field. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
projects_locations_content_policies_get | select | projectsId, locationsId, contentPoliciesId | Get a ContentPolicy. | |
projects_locations_content_policies_list | select | projectsId, locationsId | pageToken, pageSize | Lists ContentPolicies in a parent. |
projects_locations_content_policies_create | insert | projectsId, locationsId | Create a ContentPolicy. | |
projects_locations_content_policies_patch | update | projectsId, locationsId, contentPoliciesId | Update a ContentPolicy. | |
projects_locations_content_policies_delete | delete | projectsId, locationsId, contentPoliciesId | Delete a ContentPolicy. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
contentPoliciesId | string | |
locationsId | string | |
projectsId | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT examples
- projects_locations_content_policies_get
- projects_locations_content_policies_list
Get a ContentPolicy.
SELECT
name,
createTime,
defaultAction,
displayName,
errors,
failedToScanSupportedFileType,
inputTooLarge,
inspectConfig,
inspectTemplate,
loggingConfigs,
rules,
unsupportedFileType,
updateTime
FROM google.dlp.content_policies
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND contentPoliciesId = '{{ contentPoliciesId }}' -- required
;
Lists ContentPolicies in a parent.
SELECT
name,
createTime,
defaultAction,
displayName,
errors,
failedToScanSupportedFileType,
inputTooLarge,
inspectConfig,
inspectTemplate,
loggingConfigs,
rules,
unsupportedFileType,
updateTime
FROM google.dlp.content_policies
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
;
INSERT examples
- projects_locations_content_policies_create
- Manifest
Create a ContentPolicy.
INSERT INTO google.dlp.content_policies (
data__contentPolicy,
data__contentPolicyId,
projectsId,
locationsId
)
SELECT
'{{ contentPolicy }}',
'{{ contentPolicyId }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
createTime,
defaultAction,
displayName,
errors,
failedToScanSupportedFileType,
inputTooLarge,
inspectConfig,
inspectTemplate,
loggingConfigs,
rules,
unsupportedFileType,
updateTime
;
# Description fields are for documentation purposes
- name: content_policies
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the content_policies resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the content_policies resource.
- name: contentPolicy
description: |
Required. The content_policy resource.
value:
updateTime: "{{ updateTime }}"
unsupportedFileType:
returnVerdict: "{{ returnVerdict }}"
failedToScanSupportedFileType:
returnVerdict: "{{ returnVerdict }}"
inspectTemplate:
updateTime: "{{ updateTime }}"
inspectConfig:
minLikelihoodPerInfoType:
- infoType:
name: "{{ name }}"
version: "{{ version }}"
sensitivityScore: "{{ sensitivityScore }}"
minLikelihood: "{{ minLikelihood }}"
infoTypes:
- name: "{{ name }}"
version: "{{ version }}"
sensitivityScore:
score: "{{ score }}"
contentOptions:
- "{{ contentOptions }}"
minLikelihood: "{{ minLikelihood }}"
excludeInfoTypes: {{ excludeInfoTypes }}
customInfoTypes:
- likelihood: "{{ likelihood }}"
exclusionType: "{{ exclusionType }}"
surrogateType: "{{ surrogateType }}"
sensitivityScore:
score: "{{ score }}"
storedType:
name: "{{ name }}"
createTime: "{{ createTime }}"
metadataKeyValueExpression:
valueRegex: "{{ valueRegex }}"
keyRegex: "{{ keyRegex }}"
fileLabelInfoType:
sensitivityLabel: "{{ sensitivityLabel }}"
googleDriveLabel: "{{ googleDriveLabel }}"
detectionRules: "{{ detectionRules }}"
infoType:
name: "{{ name }}"
version: "{{ version }}"
sensitivityScore: "{{ sensitivityScore }}"
regex:
pattern: "{{ pattern }}"
groupIndexes: "{{ groupIndexes }}"
dictionary:
wordList: "{{ wordList }}"
cloudStoragePath: "{{ cloudStoragePath }}"
limits:
maxFindingsPerInfoType:
- maxFindings: {{ maxFindings }}
infoType:
name: "{{ name }}"
version: "{{ version }}"
sensitivityScore: "{{ sensitivityScore }}"
maxFindingsPerRequest: {{ maxFindingsPerRequest }}
maxFindingsPerItem: {{ maxFindingsPerItem }}
ruleSet:
- rules: "{{ rules }}"
infoTypes: "{{ infoTypes }}"
includeQuote: {{ includeQuote }}
description: "{{ description }}"
createTime: "{{ createTime }}"
displayName: "{{ displayName }}"
allowLimitedAvailabilityInfoTypes: {{ allowLimitedAvailabilityInfoTypes }}
name: "{{ name }}"
defaultAction:
returnVerdict: "{{ returnVerdict }}"
inspectConfig:
minLikelihoodPerInfoType:
- infoType:
name: "{{ name }}"
version: "{{ version }}"
sensitivityScore:
score: "{{ score }}"
minLikelihood: "{{ minLikelihood }}"
infoTypes:
- name: "{{ name }}"
version: "{{ version }}"
sensitivityScore:
score: "{{ score }}"
contentOptions:
- "{{ contentOptions }}"
minLikelihood: "{{ minLikelihood }}"
excludeInfoTypes: {{ excludeInfoTypes }}
customInfoTypes:
- likelihood: "{{ likelihood }}"
exclusionType: "{{ exclusionType }}"
surrogateType: "{{ surrogateType }}"
sensitivityScore:
score: "{{ score }}"
storedType:
name: "{{ name }}"
createTime: "{{ createTime }}"
metadataKeyValueExpression:
valueRegex: "{{ valueRegex }}"
keyRegex: "{{ keyRegex }}"
fileLabelInfoType:
sensitivityLabel:
guid: "{{ guid }}"
googleDriveLabel:
labelFieldsToMatch: "{{ labelFieldsToMatch }}"
labelId: "{{ labelId }}"
detectionRules: "{{ detectionRules }}"
infoType:
name: "{{ name }}"
version: "{{ version }}"
sensitivityScore:
score: "{{ score }}"
regex:
pattern: "{{ pattern }}"
groupIndexes:
- {{ groupIndexes }}
dictionary:
wordList:
words: "{{ words }}"
cloudStoragePath:
path: "{{ path }}"
limits:
maxFindingsPerInfoType:
- maxFindings: {{ maxFindings }}
infoType:
name: "{{ name }}"
version: "{{ version }}"
sensitivityScore: "{{ sensitivityScore }}"
maxFindingsPerRequest: {{ maxFindingsPerRequest }}
maxFindingsPerItem: {{ maxFindingsPerItem }}
ruleSet:
- rules: "{{ rules }}"
infoTypes: "{{ infoTypes }}"
includeQuote: {{ includeQuote }}
createTime: "{{ createTime }}"
rules:
- returnVerdict: "{{ returnVerdict }}"
action:
returnVerdict: "{{ returnVerdict }}"
conditions: "{{ conditions }}"
errors:
- timestamps: "{{ timestamps }}"
extraInfo: "{{ extraInfo }}"
details:
message: "{{ message }}"
details: "{{ details }}"
code: {{ code }}
loggingConfigs:
- logToBigQuery:
tableId: "{{ tableId }}"
projectId: "{{ projectId }}"
datasetId: "{{ datasetId }}"
name: "{{ name }}"
inputTooLarge:
returnVerdict: "{{ returnVerdict }}"
displayName: "{{ displayName }}"
- name: contentPolicyId
value: "{{ contentPolicyId }}"
description: |
Optional. The content policy ID can contain uppercase and lowercase letters, numbers, and hyphens; that is, it must match the regular expression: `[a-zA-Zd-_]+`. The maximum length is 100 characters. If empty, the system will generate a random id.
UPDATE examples
- projects_locations_content_policies_patch
Update a ContentPolicy.
UPDATE google.dlp.content_policies
SET
data__contentPolicy = '{{ contentPolicy }}',
data__updateMask = '{{ updateMask }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND contentPoliciesId = '{{ contentPoliciesId }}' --required
RETURNING
name,
createTime,
defaultAction,
displayName,
errors,
failedToScanSupportedFileType,
inputTooLarge,
inspectConfig,
inspectTemplate,
loggingConfigs,
rules,
unsupportedFileType,
updateTime;
DELETE examples
- projects_locations_content_policies_delete
Delete a ContentPolicy.
DELETE FROM google.dlp.content_policies
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND contentPoliciesId = '{{ contentPoliciesId }}' --required
;