Skip to main content

tag_bindings

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

Overview​

Nametag_bindings
TypeResource
Idgoogle.cloudresourcemanager.tag_bindings

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. The name of the TagBinding. This is a String of the form: tagBindings/{full-resource-name}/{tag-value-name} (e.g. tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456) or tagBindings/{full-resource-name}/{tag-key-name} (e.g. tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagKeys/123).
parentstringThe full resource name of the resource the TagValue is bound to. E.g. //cloudresourcemanager.googleapis.com/projects/123
tagValuestringThe TagValue of the TagBinding. Must be of the form tagValues/456.
tagValueNamespacedNamestringThe namespaced name for the TagValue of the TagBinding. Must be in the format {parent_id}/{tag_key_short_name}/{short_name}. For methods that support TagValue namespaced name, only one of tag_value_namespaced_name or tag_value may be filled. Requests with both fields will be rejected.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectpageSize, pageToken, parentLists the TagBindings for the given Google Cloud resource, as specified with parent. NOTE: The parent field is expected to be a full resource name: https://cloud.google.com/apis/design/resource_names#full_resource_name
createinsertvalidateOnlyCreates a TagBinding between a TagValue and a Google Cloud resource.
deletedeletetagBindingsIdDeletes a TagBinding.

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
tagBindingsIdstring
pageSizeinteger (int32)
pageTokenstring
parentstring
validateOnlyboolean

SELECT examples​

Lists the TagBindings for the given Google Cloud resource, as specified with parent. NOTE: The parent field is expected to be a full resource name: https://cloud.google.com/apis/design/resource_names#full_resource_name

SELECT
name,
parent,
tagValue,
tagValueNamespacedName
FROM google.cloudresourcemanager.tag_bindings
WHERE pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND parent = '{{ parent }}'
;

INSERT examples​

Creates a TagBinding between a TagValue and a Google Cloud resource.

INSERT INTO google.cloudresourcemanager.tag_bindings (
data__parent,
data__tagValue,
data__tagValueNamespacedName,
validateOnly
)
SELECT
'{{ parent }}',
'{{ tagValue }}',
'{{ tagValueNamespacedName }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples​

Deletes a TagBinding.

DELETE FROM google.cloudresourcemanager.tag_bindings
WHERE tagBindingsId = '{{ tagBindingsId }}' --required
;