Skip to main content

fields

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

Overview

Namefields
TypeResource
Idgoogle.datacatalog.fields

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_tag_templates_fields_createinsertprojectsId, locationsId, tagTemplatesIdtagTemplateFieldIdCreates a field in 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.
projects_locations_tag_templates_fields_patchupdateprojectsId, locationsId, tagTemplatesId, fieldsIdupdateMaskUpdates a field in a tag template. You can't update the field type with this method. You must enable the Data Catalog API in the project identified by the name parameter. For more information, see Data Catalog resource project.
projects_locations_tag_templates_fields_deletedeleteprojectsId, locationsId, tagTemplatesId, fieldsIdforceDeletes a field in a tag template and all uses of this field from the tags based on this template. You must enable the Data Catalog API in the project identified by the name parameter. For more information, see Data Catalog resource project.
projects_locations_tag_templates_fields_renameexecprojectsId, locationsId, tagTemplatesId, fieldsIdRenames a field in a tag template. You must enable the Data Catalog API in the project identified by the name parameter. For more information, see [Data Catalog resource project] (https://cloud.google.com/data-catalog/docs/concepts/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.

NameDatatypeDescription
fieldsIdstring
locationsIdstring
projectsIdstring
tagTemplatesIdstring
forceboolean
tagTemplateFieldIdstring
updateMaskstring (google-fieldmask)

INSERT examples

Creates a field in 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.

INSERT INTO google.datacatalog.fields (
data__name,
data__displayName,
data__type,
data__isRequired,
data__description,
data__order,
projectsId,
locationsId,
tagTemplatesId,
tagTemplateFieldId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ type }}',
{{ isRequired }},
'{{ description }}',
{{ order }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ tagTemplatesId }}',
'{{ tagTemplateFieldId }}'
RETURNING
name,
description,
displayName,
isRequired,
order,
type
;

UPDATE examples

Updates a field in a tag template. You can't update the field type with this method. You must enable the Data Catalog API in the project identified by the name parameter. For more information, see Data Catalog resource project.

UPDATE google.datacatalog.fields
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__type = '{{ type }}',
data__isRequired = {{ isRequired }},
data__description = '{{ description }}',
data__order = {{ order }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND tagTemplatesId = '{{ tagTemplatesId }}' --required
AND fieldsId = '{{ fieldsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
description,
displayName,
isRequired,
order,
type;

DELETE examples

Deletes a field in a tag template and all uses of this field from the tags based on this template. 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.fields
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND tagTemplatesId = '{{ tagTemplatesId }}' --required
AND fieldsId = '{{ fieldsId }}' --required
AND force = '{{ force }}';

Lifecycle Methods

Renames a field in a tag template. You must enable the Data Catalog API in the project identified by the name parameter. For more information, see [Data Catalog resource project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project).

EXEC google.datacatalog.fields.projects_locations_tag_templates_fields_rename 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@tagTemplatesId='{{ tagTemplatesId }}' --required,
@fieldsId='{{ fieldsId }}' --required
@@json=
'{
"newTagTemplateFieldId": "{{ newTagTemplateFieldId }}"
}';