tag_values
Creates, updates, deletes, gets or lists a tag_values
resource.
Overview
Name | tag_values |
Type | Resource |
Id | google.cloudresourcemanager.tag_values |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Immutable. Resource name for TagValue in the format tagValues/456 . |
createTime | string (google-datetime) | Output only. Creation time. |
description | string | Optional. User-assigned description of the TagValue. Must not exceed 256 characters. Read-write. |
etag | string | Optional. Entity tag which users can pass to prevent race conditions. This field is always set in server responses. See UpdateTagValueRequest for details. |
namespacedName | string | Output 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} . |
parent | string | Immutable. The resource name of the new TagValue's parent TagKey. Must be of the form tagKeys/{tag_key_id} . |
shortName | string | Required. 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. |
updateTime | string (google-datetime) | Output only. Update time. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Immutable. Resource name for TagValue in the format tagValues/456 . |
createTime | string (google-datetime) | Output only. Creation time. |
description | string | Optional. User-assigned description of the TagValue. Must not exceed 256 characters. Read-write. |
etag | string | Optional. Entity tag which users can pass to prevent race conditions. This field is always set in server responses. See UpdateTagValueRequest for details. |
namespacedName | string | Output 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} . |
parent | string | Immutable. The resource name of the new TagValue's parent TagKey. Must be of the form tagKeys/{tag_key_id} . |
shortName | string | Required. 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. |
updateTime | string (google-datetime) | Output only. Update time. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | tagValuesId | 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. | |
list | select | parent , pageSize , pageToken | Lists all TagValues for a specific TagKey. | |
create | insert | validateOnly | 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. | |
patch | update | tagValuesId | updateMask , validateOnly | Updates the attributes of the TagValue resource. |
delete | delete | tagValuesId | validateOnly , etag | Deletes 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.
Name | Datatype | Description |
---|---|---|
tagValuesId | string | |
etag | string | |
pageSize | integer (int32) | |
pageToken | string | |
parent | string | |
updateMask | string (google-fieldmask) | |
validateOnly | boolean |
SELECT
examples
- get
- list
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;
Lists all TagValues for a specific TagKey.
SELECT
name,
createTime,
description,
etag,
namespacedName,
parent,
shortName,
updateTime
FROM google.cloudresourcemanager.tag_values
WHERE parent = '{{ parent }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: tag_values
props:
- name: name
value: string
description: >
Immutable. Resource name for TagValue in the format `tagValues/456`.
- name: parent
value: string
description: >
Immutable. The resource name of the new TagValue's parent TagKey. Must be of the form `tagKeys/{tag_key_id}`.
- name: shortName
value: string
description: >
Required. 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.
- name: description
value: string
description: >
Optional. User-assigned description of the TagValue. Must not exceed 256 characters. Read-write.
- name: etag
value: string
description: >
Optional. Entity tag which users can pass to prevent race conditions. This field is always set in server responses. See UpdateTagValueRequest for details.
- name: validateOnly
value: boolean
UPDATE
examples
- patch
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
- delete
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 }}';