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

NameDatatypeDescription
namestringImmutable. Resource name for TagValue in the format tagValues/456.
descriptionstringOptional. User-assigned description of the TagValue. Must not exceed 256 characters. Read-write.
createTimestringOutput only. Creation time.
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 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between.
updateTimestringOutput only. Update time.

Methods

NameAccessible byRequired 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.
listSELECTLists all TagValues for a specific TagKey.
createINSERTCreates 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.
deleteDELETEtagValuesIdDeletes a TagValue. The TagValue cannot have any bindings when it is deleted.
patchUPDATEtagValuesIdUpdates the attributes of the TagValue resource.

SELECT examples

Lists all TagValues for a specific TagKey.

SELECT
name,
description,
createTime,
etag,
namespacedName,
parent,
shortName,
updateTime
FROM google.cloudresourcemanager.tag_values
;

INSERT example

Use the following StackQL query and manifest file to create a new tag_values resource.

/*+ create */
INSERT INTO google.cloudresourcemanager.tag_values (
name,
parent,
shortName,
description,
etag
)
SELECT
'{{ name }}',
'{{ parent }}',
'{{ shortName }}',
'{{ description }}',
'{{ etag }}'
;

UPDATE example

Updates a tag_values resource.

/*+ update */
UPDATE google.cloudresourcemanager.tag_values
SET
name = '{{ name }}',
parent = '{{ parent }}',
shortName = '{{ shortName }}',
description = '{{ description }}',
etag = '{{ etag }}'
WHERE
tagValuesId = '{{ tagValuesId }}';

DELETE example

Deletes the specified tag_values resource.

/*+ delete */
DELETE FROM google.cloudresourcemanager.tag_values
WHERE tagValuesId = '{{ tagValuesId }}';