tag_holds
Creates, updates, deletes, gets or lists a tag_holds
resource.
Overview
Name | tag_holds |
Type | Resource |
Id | google.cloudresourcemanager.tag_holds |
Fields
The following fields are returned by SELECT
queries:
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output 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. |
createTime | string (google-datetime) | Output only. The time this TagHold was created. |
helpLink | string | Optional. 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 |
holder | string | Required. 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 |
origin | string | Optional. 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
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list | select | tagValuesId | pageSize , pageToken , filter | Lists TagHolds under a TagValue. |
create | insert | tagValuesId | validateOnly | Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue. |
delete | delete | tagValuesId , tagHoldsId | validateOnly | Deletes a TagHold. |
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 |
---|---|---|
tagHoldsId | string | |
tagValuesId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string | |
validateOnly | boolean |
SELECT
examples
- list
Lists TagHolds under a TagValue.
SELECT
name,
createTime,
helpLink,
holder,
origin
FROM google.cloudresourcemanager.tag_holds
WHERE tagValuesId = '{{ tagValuesId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}';
INSERT
examples
- create
- Manifest
Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue.
INSERT INTO google.cloudresourcemanager.tag_holds (
data__holder,
data__origin,
data__helpLink,
tagValuesId,
validateOnly
)
SELECT
'{{ holder }}',
'{{ origin }}',
'{{ helpLink }}',
'{{ tagValuesId }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: tag_holds
props:
- name: tagValuesId
value: string
description: Required parameter for the tag_holds resource.
- name: holder
value: string
description: >
Required. 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`
- name: origin
value: string
description: >
Optional. 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`
- name: helpLink
value: string
description: >
Optional. 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`
- name: validateOnly
value: boolean
DELETE
examples
- delete
Deletes a TagHold.
DELETE FROM google.cloudresourcemanager.tag_holds
WHERE tagValuesId = '{{ tagValuesId }}' --required
AND tagHoldsId = '{{ tagHoldsId }}' --required
AND validateOnly = '{{ validateOnly }}';