Skip to main content

tag_values

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

Overview

Nametag_values
TypeResource
Idgoogle.cloudresourcemanager.tag_values

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringImmutable. Resource name for TagValue in the format tagValues/456.
createTimestring (google-datetime)Output only. Creation time.
descriptionstringOptional. User-assigned description of the TagValue. Must not exceed 256 characters. Read-write.
etagstringOptional. Entity tag which users can pass to prevent race conditions. This field is always set in server responses. See UpdateTagValueRequest for details.
namespacedNamestringOutput only. The namespaced name of the TagValue. Can be in the form {organization_id}/{tag_key_short_name}/{tag_value_short_name} or {project_id}/{tag_key_short_name}/{tag_value_short_name} or {project_number}/{tag_key_short_name}/{tag_value_short_name}.
parentstringImmutable. The resource name of the new TagValue's parent TagKey. Must be of the form tagKeys/{tag_key_id}.
shortNamestringRequired. Immutable. User-assigned short name for TagValue. The short name should be unique for TagValues within the same parent TagKey. The short name must be 256 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between.
updateTimestring (google-datetime)Output only. Update time.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselecttagValuesIdRetrieves a TagValue. This method will return PERMISSION_DENIED if the value does not exist or the user does not have permission to view it.
listselectparent, pageSize, pageTokenLists all TagValues for a specific TagKey.
createinsertvalidateOnlyCreates a TagValue as a child of the specified TagKey. If a another request with the same parameters is sent while the original request is in process the second request will receive an error. A maximum of 1000 TagValues can exist under a TagKey at any given time.
patchupdatetagValuesIdupdateMask, validateOnlyUpdates the attributes of the TagValue resource.
deletedeletetagValuesIdvalidateOnly, etagDeletes a TagValue. The TagValue cannot have any bindings when it is deleted.

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
tagValuesIdstring
etagstring
pageSizeinteger (int32)
pageTokenstring
parentstring
updateMaskstring (google-fieldmask)
validateOnlyboolean

SELECT examples

Retrieves a TagValue. This method will return PERMISSION_DENIED if the value does not exist or the user does not have permission to view it.

SELECT
name,
createTime,
description,
etag,
namespacedName,
parent,
shortName,
updateTime
FROM google.cloudresourcemanager.tag_values
WHERE tagValuesId = '{{ tagValuesId }}' -- required;

INSERT examples

Creates a TagValue as a child of the specified TagKey. If a another request with the same parameters is sent while the original request is in process the second request will receive an error. A maximum of 1000 TagValues can exist under a TagKey at any given time.

INSERT INTO google.cloudresourcemanager.tag_values (
data__name,
data__parent,
data__shortName,
data__description,
data__etag,
validateOnly
)
SELECT
'{{ name }}',
'{{ parent }}',
'{{ shortName }}',
'{{ description }}',
'{{ etag }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the attributes of the TagValue resource.

UPDATE google.cloudresourcemanager.tag_values
SET
data__name = '{{ name }}',
data__parent = '{{ parent }}',
data__shortName = '{{ shortName }}',
data__description = '{{ description }}',
data__etag = '{{ etag }}'
WHERE
tagValuesId = '{{ tagValuesId }}' --required
AND updateMask = '{{ updateMask}}'
AND validateOnly = {{ validateOnly}}
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a TagValue. The TagValue cannot have any bindings when it is deleted.

DELETE FROM google.cloudresourcemanager.tag_values
WHERE tagValuesId = '{{ tagValuesId }}' --required
AND validateOnly = '{{ validateOnly }}'
AND etag = '{{ etag }}';