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 | pageSize, pageToken | 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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
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:
createTime: "{{ createTime }}"
defaultAction:
returnVerdict: "{{ returnVerdict }}"
displayName: "{{ displayName }}"
errors:
- details:
code: {{ code }}
details: "{{ details }}"
message: "{{ message }}"
extraInfo: "{{ extraInfo }}"
timestamps: "{{ timestamps }}"
failedToScanSupportedFileType:
returnVerdict: "{{ returnVerdict }}"
inputTooLarge:
returnVerdict: "{{ returnVerdict }}"
inspectConfig:
contentOptions:
- "{{ contentOptions }}"
customInfoTypes:
- detectionRules: "{{ detectionRules }}"
dictionary:
cloudStoragePath:
path: "{{ path }}"
wordList:
words: "{{ words }}"
exclusionType: "{{ exclusionType }}"
fileLabelInfoType:
googleDriveLabel:
labelFieldsToMatch: "{{ labelFieldsToMatch }}"
labelId: "{{ labelId }}"
sensitivityLabel:
guid: "{{ guid }}"
infoType:
name: "{{ name }}"
sensitivityScore:
score: "{{ score }}"
version: "{{ version }}"
likelihood: "{{ likelihood }}"
metadataKeyValueExpression:
keyRegex: "{{ keyRegex }}"
valueRegex: "{{ valueRegex }}"
regex:
groupIndexes:
- {{ groupIndexes }}
pattern: "{{ pattern }}"
sensitivityScore:
score: "{{ score }}"
storedType:
createTime: "{{ createTime }}"
name: "{{ name }}"
surrogateType: "{{ surrogateType }}"
excludeInfoTypes: {{ excludeInfoTypes }}
includeQuote: {{ includeQuote }}
infoTypes:
- name: "{{ name }}"
sensitivityScore:
score: "{{ score }}"
version: "{{ version }}"
limits:
maxFindingsPerInfoType:
- infoType:
name: "{{ name }}"
sensitivityScore: "{{ sensitivityScore }}"
version: "{{ version }}"
maxFindings: {{ maxFindings }}
maxFindingsPerItem: {{ maxFindingsPerItem }}
maxFindingsPerRequest: {{ maxFindingsPerRequest }}
minLikelihood: "{{ minLikelihood }}"
minLikelihoodPerInfoType:
- infoType:
name: "{{ name }}"
sensitivityScore:
score: "{{ score }}"
version: "{{ version }}"
minLikelihood: "{{ minLikelihood }}"
ruleSet:
- infoTypes: "{{ infoTypes }}"
rules: "{{ rules }}"
inspectTemplate:
allowLimitedAvailabilityInfoTypes: {{ allowLimitedAvailabilityInfoTypes }}
createTime: "{{ createTime }}"
description: "{{ description }}"
displayName: "{{ displayName }}"
inspectConfig:
contentOptions:
- "{{ contentOptions }}"
customInfoTypes:
- detectionRules: "{{ detectionRules }}"
dictionary:
cloudStoragePath: "{{ cloudStoragePath }}"
wordList: "{{ wordList }}"
exclusionType: "{{ exclusionType }}"
fileLabelInfoType:
googleDriveLabel: "{{ googleDriveLabel }}"
sensitivityLabel: "{{ sensitivityLabel }}"
infoType:
name: "{{ name }}"
sensitivityScore: "{{ sensitivityScore }}"
version: "{{ version }}"
likelihood: "{{ likelihood }}"
metadataKeyValueExpression:
keyRegex: "{{ keyRegex }}"
valueRegex: "{{ valueRegex }}"
regex:
groupIndexes: "{{ groupIndexes }}"
pattern: "{{ pattern }}"
sensitivityScore:
score: "{{ score }}"
storedType:
createTime: "{{ createTime }}"
name: "{{ name }}"
surrogateType: "{{ surrogateType }}"
excludeInfoTypes: {{ excludeInfoTypes }}
includeQuote: {{ includeQuote }}
infoTypes:
- name: "{{ name }}"
sensitivityScore:
score: "{{ score }}"
version: "{{ version }}"
limits:
maxFindingsPerInfoType:
- infoType:
name: "{{ name }}"
sensitivityScore: "{{ sensitivityScore }}"
version: "{{ version }}"
maxFindings: {{ maxFindings }}
maxFindingsPerItem: {{ maxFindingsPerItem }}
maxFindingsPerRequest: {{ maxFindingsPerRequest }}
minLikelihood: "{{ minLikelihood }}"
minLikelihoodPerInfoType:
- infoType:
name: "{{ name }}"
sensitivityScore: "{{ sensitivityScore }}"
version: "{{ version }}"
minLikelihood: "{{ minLikelihood }}"
ruleSet:
- infoTypes: "{{ infoTypes }}"
rules: "{{ rules }}"
name: "{{ name }}"
updateTime: "{{ updateTime }}"
loggingConfigs:
- logToBigQuery:
datasetId: "{{ datasetId }}"
projectId: "{{ projectId }}"
tableId: "{{ tableId }}"
name: "{{ name }}"
rules:
- action:
returnVerdict: "{{ returnVerdict }}"
conditions: "{{ conditions }}"
returnVerdict: "{{ returnVerdict }}"
unsupportedFileType:
returnVerdict: "{{ returnVerdict }}"
updateTime: "{{ updateTime }}"
- 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
;