tag_templates
Creates, updates, deletes, gets or lists a tag_templates
resource.
Overview
Name | tag_templates |
Type | Resource |
Id | google.datacatalog.tag_templates |
Fields
The following fields are returned by SELECT
queries:
- projects_locations_tag_templates_get
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The resource name of the tag template in URL format. Note: The tag template itself and its child resources might not be stored in the location specified in its name. |
dataplexTransferStatus | string | Optional. Transfer status of the TagTemplate |
displayName | string | Display name for this template. Defaults to an empty string. The name must contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces ( ), and can't start or end with spaces. The maximum length is 200 characters. |
fields | object | Required. Map of tag template field IDs to the settings for the field. This map is an exhaustive list of the allowed fields. The map must contain at least one field and at most 500 fields. The keys to this map are tag template field IDs. The IDs have the following limitations: * Can contain uppercase and lowercase letters, numbers (0-9) and underscores (_). * Must be at least 1 character and at most 64 characters long. * Must start with a letter or underscore. |
isPubliclyReadable | boolean | Indicates whether tags created with this template are public. Public tags do not require tag template access to appear in ListTags API response. Additionally, you can search for a public tag by value with a simple search query in addition to using a tag: predicate. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
projects_locations_tag_templates_get | select | projectsId , locationsId , tagTemplatesId | Gets a tag template. | |
projects_locations_tag_templates_create | insert | projectsId , locationsId | tagTemplateId | Creates a tag template. You must enable the Data Catalog API in the project identified by the parent parameter. For more information, see [Data Catalog resource project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project). |
projects_locations_tag_templates_patch | update | projectsId , locationsId , tagTemplatesId | updateMask | Updates a tag template. You can't update template fields with this method. These fields are separate resources with their own create, update, and delete methods. You must enable the Data Catalog API in the project identified by the tag_template.name parameter. For more information, see Data Catalog resource project. |
projects_locations_tag_templates_delete | delete | projectsId , locationsId , tagTemplatesId | force | Deletes a tag template and all tags that use it. You must enable the Data Catalog API in the project identified by the name parameter. For more information, see Data Catalog resource project. |
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 | |
projectsId | string | |
tagTemplatesId | string | |
force | boolean | |
tagTemplateId | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- projects_locations_tag_templates_get
Gets a tag template.
SELECT
name,
dataplexTransferStatus,
displayName,
fields,
isPubliclyReadable
FROM google.datacatalog.tag_templates
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND tagTemplatesId = '{{ tagTemplatesId }}' -- required;
INSERT
examples
- projects_locations_tag_templates_create
- Manifest
Creates a tag template. You must enable the Data Catalog API in the project identified by the parent
parameter. For more information, see [Data Catalog resource project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project).
INSERT INTO google.datacatalog.tag_templates (
data__name,
data__displayName,
data__isPubliclyReadable,
data__fields,
data__dataplexTransferStatus,
projectsId,
locationsId,
tagTemplateId
)
SELECT
'{{ name }}',
'{{ displayName }}',
{{ isPubliclyReadable }},
'{{ fields }}',
'{{ dataplexTransferStatus }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ tagTemplateId }}'
RETURNING
name,
dataplexTransferStatus,
displayName,
fields,
isPubliclyReadable
;
# Description fields are for documentation purposes
- name: tag_templates
props:
- name: projectsId
value: string
description: Required parameter for the tag_templates resource.
- name: locationsId
value: string
description: Required parameter for the tag_templates resource.
- name: name
value: string
description: >
Identifier. The resource name of the tag template in URL format. Note: The tag template itself and its child resources might not be stored in the location specified in its name.
- name: displayName
value: string
description: >
Display name for this template. Defaults to an empty string. The name must contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces ( ), and can't start or end with spaces. The maximum length is 200 characters.
- name: isPubliclyReadable
value: boolean
description: >
Indicates whether tags created with this template are public. Public tags do not require tag template access to appear in ListTags API response. Additionally, you can search for a public tag by value with a simple search query in addition to using a ``tag:`` predicate.
- name: fields
value: object
description: >
Required. Map of tag template field IDs to the settings for the field. This map is an exhaustive list of the allowed fields. The map must contain at least one field and at most 500 fields. The keys to this map are tag template field IDs. The IDs have the following limitations: * Can contain uppercase and lowercase letters, numbers (0-9) and underscores (_). * Must be at least 1 character and at most 64 characters long. * Must start with a letter or underscore.
- name: dataplexTransferStatus
value: string
description: >
Optional. Transfer status of the TagTemplate
valid_values: ['DATAPLEX_TRANSFER_STATUS_UNSPECIFIED', 'MIGRATED', 'TRANSFERRED']
- name: tagTemplateId
value: string
UPDATE
examples
- projects_locations_tag_templates_patch
Updates a tag template. You can't update template fields with this method. These fields are separate resources with their own create, update, and delete methods. You must enable the Data Catalog API in the project identified by the tag_template.name
parameter. For more information, see Data Catalog resource project.
UPDATE google.datacatalog.tag_templates
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__isPubliclyReadable = {{ isPubliclyReadable }},
data__fields = '{{ fields }}',
data__dataplexTransferStatus = '{{ dataplexTransferStatus }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND tagTemplatesId = '{{ tagTemplatesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
dataplexTransferStatus,
displayName,
fields,
isPubliclyReadable;
DELETE
examples
- projects_locations_tag_templates_delete
Deletes a tag template and all tags that use it. You must enable the Data Catalog API in the project identified by the name
parameter. For more information, see Data Catalog resource project.
DELETE FROM google.datacatalog.tag_templates
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND tagTemplatesId = '{{ tagTemplatesId }}' --required
AND force = '{{ force }}';