Skip to main content

tags

Creates, updates, deletes, gets or lists a tags resource.

Overview

Nametags
TypeResource
Idgoogle.datacatalog.tags

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The resource name of the tag in URL format where tag ID is a system-generated identifier. Note: The tag itself might not be stored in the location specified in its name.
columnstringResources like entry can have schemas associated with them. This scope allows you to attach tags to an individual column based on that schema. To attach a tag to a nested column, separate column names with a dot (.). Example: column.nested_column.
dataplexTransferStatusstringOutput only. Denotes the transfer status of the Tag Template.
fieldsobjectRequired. Maps the ID of a tag field to its value and additional information about that field. Tag template defines valid field IDs. A tag must have at least 1 field and at most 500 fields.
templatestringRequired. The resource name of the tag template this tag uses. Example: projects/{PROJECT_ID}/locations/{LOCATION}/tagTemplates/{TAG_TEMPLATE_ID} This field cannot be modified after creation.
templateDisplayNamestringOutput only. The display name of the tag template.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_entry_groups_entries_tags_listselectprojectsId, locationsId, entryGroupsId, entriesIdpageSize, pageTokenLists tags assigned to an Entry. The columns in the response are lowercased.
projects_locations_entry_groups_tags_listselectprojectsId, locationsId, entryGroupsIdpageSize, pageTokenLists tags assigned to an Entry. The columns in the response are lowercased.
projects_locations_entry_groups_entries_tags_createinsertprojectsId, locationsId, entryGroupsId, entriesIdCreates a tag and assigns it to: * An Entry if the method name is projects.locations.entryGroups.entries.tags.create. * Or EntryGroupif the method name is projects.locations.entryGroups.tags.create. Note: The project identified by the parent parameter for the [tag] (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) and the [tag template] (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) used to create the tag must be in the same organization.
projects_locations_entry_groups_tags_createinsertprojectsId, locationsId, entryGroupsIdCreates a tag and assigns it to: * An Entry if the method name is projects.locations.entryGroups.entries.tags.create. * Or EntryGroupif the method name is projects.locations.entryGroups.tags.create. Note: The project identified by the parent parameter for the [tag] (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) and the [tag template] (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) used to create the tag must be in the same organization.
projects_locations_entry_groups_entries_tags_patchupdateprojectsId, locationsId, entryGroupsId, entriesId, tagsIdupdateMaskUpdates an existing tag.
projects_locations_entry_groups_tags_patchupdateprojectsId, locationsId, entryGroupsId, tagsIdupdateMaskUpdates an existing tag.
projects_locations_entry_groups_entries_tags_deletedeleteprojectsId, locationsId, entryGroupsId, entriesId, tagsIdDeletes a tag.
projects_locations_entry_groups_tags_deletedeleteprojectsId, locationsId, entryGroupsId, tagsIdDeletes a tag.
projects_locations_entry_groups_entries_tags_reconcileexecprojectsId, locationsId, entryGroupsId, entriesIdReconcileTags creates or updates a list of tags on the entry. If the ReconcileTagsRequest.force_delete_missing parameter is set, the operation deletes tags not included in the input tag list. ReconcileTags returns a long-running operation resource that can be queried with Operations.GetOperation to return ReconcileTagsMetadata and a ReconcileTagsResponse message. Note: SearchCatalog might return stale search results for up to 24 hours after the ReconcileTags operation completes.

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.

NameDatatypeDescription
entriesIdstring
entryGroupsIdstring
locationsIdstring
projectsIdstring
tagsIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Lists tags assigned to an Entry. The columns in the response are lowercased.

SELECT
name,
column,
dataplexTransferStatus,
fields,
template,
templateDisplayName
FROM google.datacatalog.tags
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND entryGroupsId = '{{ entryGroupsId }}' -- required
AND entriesId = '{{ entriesId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';

INSERT examples

Creates a tag and assigns it to: * An Entry if the method name is projects.locations.entryGroups.entries.tags.create. * Or EntryGroupif the method name is projects.locations.entryGroups.tags.create. Note: The project identified by the parent parameter for the [tag] (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) and the [tag template] (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) used to create the tag must be in the same organization.

INSERT INTO google.datacatalog.tags (
data__name,
data__template,
data__column,
data__fields,
projectsId,
locationsId,
entryGroupsId,
entriesId
)
SELECT
'{{ name }}',
'{{ template }}',
'{{ column }}',
'{{ fields }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ entryGroupsId }}',
'{{ entriesId }}'
RETURNING
name,
column,
dataplexTransferStatus,
fields,
template,
templateDisplayName
;

UPDATE examples

Updates an existing tag.

UPDATE google.datacatalog.tags
SET
data__name = '{{ name }}',
data__template = '{{ template }}',
data__column = '{{ column }}',
data__fields = '{{ fields }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND entryGroupsId = '{{ entryGroupsId }}' --required
AND entriesId = '{{ entriesId }}' --required
AND tagsId = '{{ tagsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
column,
dataplexTransferStatus,
fields,
template,
templateDisplayName;

DELETE examples

Deletes a tag.

DELETE FROM google.datacatalog.tags
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND entryGroupsId = '{{ entryGroupsId }}' --required
AND entriesId = '{{ entriesId }}' --required
AND tagsId = '{{ tagsId }}' --required;

Lifecycle Methods

ReconcileTags creates or updates a list of tags on the entry. If the ReconcileTagsRequest.force_delete_missing parameter is set, the operation deletes tags not included in the input tag list. ReconcileTags returns a long-running operation resource that can be queried with Operations.GetOperation to return ReconcileTagsMetadata and a ReconcileTagsResponse message. Note: SearchCatalog might return stale search results for up to 24 hours after the ReconcileTags operation completes.

EXEC google.datacatalog.tags.projects_locations_entry_groups_entries_tags_reconcile 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@entryGroupsId='{{ entryGroupsId }}' --required,
@entriesId='{{ entriesId }}' --required
@@json=
'{
"tagTemplate": "{{ tagTemplate }}",
"forceDeleteMissing": {{ forceDeleteMissing }},
"tags": "{{ tags }}"
}';