Skip to main content

groups

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

Overview

Namegroups
TypeResource
Idgoogle.monitoring.groups

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The name of this group. The format is: projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique [GROUP_ID] that is generated automatically.
displayNamestringA user-assigned name for this group, used only for display purposes.
filterstringThe filter used to determine which monitored resources belong to this group.
isClusterbooleanIf true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
parentNamestringThe name of the group's parent, if it has one. The format is: projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] For groups with no parent, parent_name is the empty string, "".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_groups_getselectprojectsId, groupsIdGets a single group.
projects_groups_listselectprojectsIdchildrenOfGroup, ancestorsOfGroup, descendantsOfGroup, pageSize, pageTokenLists the existing groups.
projects_groups_createinsertprojectsIdvalidateOnlyCreates a new group.
projects_groups_updatereplaceprojectsId, groupsIdvalidateOnlyUpdates an existing group. You can change any group attributes except name.
projects_groups_deletedeleteprojectsId, groupsIdrecursiveDeletes an existing group.

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
groupsIdstring
projectsIdstring
ancestorsOfGroupstring
childrenOfGroupstring
descendantsOfGroupstring
pageSizeinteger (int32)
pageTokenstring
recursiveboolean
validateOnlyboolean

SELECT examples

Gets a single group.

SELECT
name,
displayName,
filter,
isCluster,
parentName
FROM google.monitoring.groups
WHERE projectsId = '{{ projectsId }}' -- required
AND groupsId = '{{ groupsId }}' -- required;

INSERT examples

Creates a new group.

INSERT INTO google.monitoring.groups (
data__name,
data__displayName,
data__parentName,
data__filter,
data__isCluster,
projectsId,
validateOnly
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ parentName }}',
'{{ filter }}',
{{ isCluster }},
'{{ projectsId }}',
'{{ validateOnly }}'
RETURNING
name,
displayName,
filter,
isCluster,
parentName
;

REPLACE examples

Updates an existing group. You can change any group attributes except name.

REPLACE google.monitoring.groups
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__parentName = '{{ parentName }}',
data__filter = '{{ filter }}',
data__isCluster = {{ isCluster }}
WHERE
projectsId = '{{ projectsId }}' --required
AND groupsId = '{{ groupsId }}' --required
AND validateOnly = {{ validateOnly}}
RETURNING
name,
displayName,
filter,
isCluster,
parentName;

DELETE examples

Deletes an existing group.

DELETE FROM google.monitoring.groups
WHERE projectsId = '{{ projectsId }}' --required
AND groupsId = '{{ groupsId }}' --required
AND recursive = '{{ recursive }}';