Skip to main content

tag_holds

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

Overview

Nametag_holds
TypeResource
Idgoogle.cloudresourcemanager.tag_holds

Fields

NameDatatypeDescription
namestringOutput only. The resource name of a TagHold. This is a String of the form: tagValues/{tag-value-id}/tagHolds/{tag-hold-id} (e.g. tagValues/123/tagHolds/456). This resource name is generated by the server.
createTimestringOutput only. The time this TagHold was created.
helpLinkstringOptional. A URL where an end user can learn more about removing this hold. E.g. https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
holderstringRequired. The name of the resource where the TagValue is being used. Must be less than 200 characters. E.g. //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group
originstringOptional. An optional string representing the origin of this request. This field should include human-understandable information to distinguish origins from each other. Must be less than 200 characters. E.g. migs-35678234

Methods

NameAccessible byRequired ParamsDescription
listSELECTtagValuesIdLists TagHolds under a TagValue.
createINSERTtagValuesIdCreates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue.
deleteDELETEtagHoldsId, tagValuesIdDeletes a TagHold.

SELECT examples

Lists TagHolds under a TagValue.

SELECT
name,
createTime,
helpLink,
holder,
origin
FROM google.cloudresourcemanager.tag_holds
WHERE tagValuesId = '{{ tagValuesId }}';

INSERT example

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

/*+ create */
INSERT INTO google.cloudresourcemanager.tag_holds (
tagValuesId,
holder,
origin,
helpLink
)
SELECT
'{{ tagValuesId }}',
'{{ holder }}',
'{{ origin }}',
'{{ helpLink }}'
;

DELETE example

Deletes the specified tag_holds resource.

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