policy_tags
Creates, updates, deletes, gets or lists a policy_tags
resource.
Overview
Name | policy_tags |
Type | Resource |
Id | google.datacatalog.policy_tags |
Fields
The following fields are returned by SELECT
queries:
- projects_locations_taxonomies_policy_tags_get
- projects_locations_taxonomies_policy_tags_list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. Resource name of this policy tag in the URL format. The policy tag manager generates unique taxonomy IDs and policy tag IDs. |
childPolicyTags | array | Output only. Resource names of child policy tags of this policy tag. |
description | string | Description of this policy tag. If not set, defaults to empty. The description must contain only Unicode characters, tabs, newlines, carriage returns and page breaks, and be at most 2000 bytes long when encoded in UTF-8. |
displayName | string | Required. User-defined name of this policy tag. The name can't start or end with spaces and must be unique within the parent taxonomy, contain only Unicode letters, numbers, underscores, dashes and spaces, and be at most 200 bytes long when encoded in UTF-8. |
parentPolicyTag | string | Resource name of this policy tag's parent policy tag. If empty, this is a top level tag. If not set, defaults to an empty string. For example, for the "LatLong" policy tag in the example above, this field contains the resource name of the "Geolocation" policy tag, and, for "Geolocation", this field is empty. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. Resource name of this policy tag in the URL format. The policy tag manager generates unique taxonomy IDs and policy tag IDs. |
childPolicyTags | array | Output only. Resource names of child policy tags of this policy tag. |
description | string | Description of this policy tag. If not set, defaults to empty. The description must contain only Unicode characters, tabs, newlines, carriage returns and page breaks, and be at most 2000 bytes long when encoded in UTF-8. |
displayName | string | Required. User-defined name of this policy tag. The name can't start or end with spaces and must be unique within the parent taxonomy, contain only Unicode letters, numbers, underscores, dashes and spaces, and be at most 200 bytes long when encoded in UTF-8. |
parentPolicyTag | string | Resource name of this policy tag's parent policy tag. If empty, this is a top level tag. If not set, defaults to an empty string. For example, for the "LatLong" policy tag in the example above, this field contains the resource name of the "Geolocation" policy tag, and, for "Geolocation", this field is empty. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
projects_locations_taxonomies_policy_tags_get | select | projectsId , locationsId , taxonomiesId , policyTagsId | Gets a policy tag. | |
projects_locations_taxonomies_policy_tags_list | select | projectsId , locationsId , taxonomiesId | pageSize , pageToken | Lists all policy tags in a taxonomy. |
projects_locations_taxonomies_policy_tags_create | insert | projectsId , locationsId , taxonomiesId | Creates a policy tag in a taxonomy. | |
projects_locations_taxonomies_policy_tags_patch | update | projectsId , locationsId , taxonomiesId , policyTagsId | updateMask | Updates a policy tag, including its display name, description, and parent policy tag. |
projects_locations_taxonomies_policy_tags_delete | delete | projectsId , locationsId , taxonomiesId , policyTagsId | Deletes a policy tag together with the following: * All of its descendant policy tags, if any * Policies associated with the policy tag and its descendants * References from BigQuery table schema of the policy tag and its descendants |
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 |
---|---|---|
locationsId | string | |
policyTagsId | string | |
projectsId | string | |
taxonomiesId | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- projects_locations_taxonomies_policy_tags_get
- projects_locations_taxonomies_policy_tags_list
Gets a policy tag.
SELECT
name,
childPolicyTags,
description,
displayName,
parentPolicyTag
FROM google.datacatalog.policy_tags
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND taxonomiesId = '{{ taxonomiesId }}' -- required
AND policyTagsId = '{{ policyTagsId }}' -- required;
Lists all policy tags in a taxonomy.
SELECT
name,
childPolicyTags,
description,
displayName,
parentPolicyTag
FROM google.datacatalog.policy_tags
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND taxonomiesId = '{{ taxonomiesId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- projects_locations_taxonomies_policy_tags_create
- Manifest
Creates a policy tag in a taxonomy.
INSERT INTO google.datacatalog.policy_tags (
data__name,
data__displayName,
data__description,
data__parentPolicyTag,
projectsId,
locationsId,
taxonomiesId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ parentPolicyTag }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ taxonomiesId }}'
RETURNING
name,
childPolicyTags,
description,
displayName,
parentPolicyTag
;
# Description fields are for documentation purposes
- name: policy_tags
props:
- name: projectsId
value: string
description: Required parameter for the policy_tags resource.
- name: locationsId
value: string
description: Required parameter for the policy_tags resource.
- name: taxonomiesId
value: string
description: Required parameter for the policy_tags resource.
- name: name
value: string
description: >
Identifier. Resource name of this policy tag in the URL format. The policy tag manager generates unique taxonomy IDs and policy tag IDs.
- name: displayName
value: string
description: >
Required. User-defined name of this policy tag. The name can't start or end with spaces and must be unique within the parent taxonomy, contain only Unicode letters, numbers, underscores, dashes and spaces, and be at most 200 bytes long when encoded in UTF-8.
- name: description
value: string
description: >
Description of this policy tag. If not set, defaults to empty. The description must contain only Unicode characters, tabs, newlines, carriage returns and page breaks, and be at most 2000 bytes long when encoded in UTF-8.
- name: parentPolicyTag
value: string
description: >
Resource name of this policy tag's parent policy tag. If empty, this is a top level tag. If not set, defaults to an empty string. For example, for the "LatLong" policy tag in the example above, this field contains the resource name of the "Geolocation" policy tag, and, for "Geolocation", this field is empty.
UPDATE
examples
- projects_locations_taxonomies_policy_tags_patch
Updates a policy tag, including its display name, description, and parent policy tag.
UPDATE google.datacatalog.policy_tags
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__parentPolicyTag = '{{ parentPolicyTag }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND taxonomiesId = '{{ taxonomiesId }}' --required
AND policyTagsId = '{{ policyTagsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
childPolicyTags,
description,
displayName,
parentPolicyTag;
DELETE
examples
- projects_locations_taxonomies_policy_tags_delete
Deletes a policy tag together with the following: * All of its descendant policy tags, if any * Policies associated with the policy tag and its descendants * References from BigQuery table schema of the policy tag and its descendants
DELETE FROM google.datacatalog.policy_tags
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND taxonomiesId = '{{ taxonomiesId }}' --required
AND policyTagsId = '{{ policyTagsId }}' --required;