fields
Creates, updates, deletes, gets or lists a fields
resource.
Overview
Name | fields |
Type | Resource |
Id | google.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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
projects_locations_tag_templates_fields_create | insert | projectsId , locationsId , tagTemplatesId | tagTemplateFieldId | 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. |
projects_locations_tag_templates_fields_patch | update | projectsId , locationsId , tagTemplatesId , fieldsId | updateMask | 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. |
projects_locations_tag_templates_fields_delete | delete | projectsId , locationsId , tagTemplatesId , fieldsId | force | 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. |
projects_locations_tag_templates_fields_rename | exec | projectsId , locationsId , tagTemplatesId , fieldsId | 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). |
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 |
---|---|---|
fieldsId | string | |
locationsId | string | |
projectsId | string | |
tagTemplatesId | string | |
force | boolean | |
tagTemplateFieldId | string | |
updateMask | string (google-fieldmask) |
INSERT
examples
- projects_locations_tag_templates_fields_create
- Manifest
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
;
# Description fields are for documentation purposes
- name: fields
props:
- name: projectsId
value: string
description: Required parameter for the fields resource.
- name: locationsId
value: string
description: Required parameter for the fields resource.
- name: tagTemplatesId
value: string
description: Required parameter for the fields resource.
- name: name
value: string
description: >
Identifier. The resource name of the tag template field in URL format. Example: `projects/{PROJECT_ID}/locations/{LOCATION}/tagTemplates/{TAG_TEMPLATE}/fields/{FIELD}` Note: The tag template field itself might not be stored in the location specified in its name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 64 characters.
- name: displayName
value: string
description: >
The display name for this field. 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: type
value: object
description: >
Required. The type of value this tag field can contain.
- name: isRequired
value: boolean
description: >
If true, this field is required. Defaults to false.
- name: description
value: string
description: >
The description for this field. Defaults to an empty string.
- name: order
value: integer
description: >
The order of this field with respect to other fields in this tag template. For example, a higher value can indicate a more important field. The value can be negative. Multiple fields can have the same order and field orders within a tag don't have to be sequential.
- name: tagTemplateFieldId
value: string
UPDATE
examples
- projects_locations_tag_templates_fields_patch
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
- projects_locations_tag_templates_fields_delete
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
- projects_locations_tag_templates_fields_rename
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 }}"
}';