Skip to main content

snoozes

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

Overview

Namesnoozes
TypeResource
Idgoogle.monitoring.snoozes

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. Identifier. The name of the Snooze. The format is: projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] The ID of the Snooze will be generated by the system.
criteriaobjectRequired. This defines the criteria for applying the Snooze. See Criteria for more information. (id: Criteria)
displayNamestringRequired. A display name for the Snooze. This can be, at most, 512 unicode characters.
intervalobjectRequired. The Snooze will be active from interval.start_time through interval.end_time. interval.start_time cannot be in the past. There is a 15 second clock skew to account for the time it takes for a request to reach the API from the UI. (id: TimeInterval)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_snoozes_getselectprojectsId, snoozesIdRetrieves a Snooze by name.
projects_snoozes_listselectprojectsIdfilter, pageSize, pageTokenLists the Snoozes associated with a project. Can optionally pass in filter, which specifies predicates to match Snoozes.
projects_snoozes_createinsertprojectsIdCreates a Snooze that will prevent alerts, which match the provided criteria, from being opened. The Snooze applies for a specific time interval.
projects_snoozes_patchupdateprojectsId, snoozesIdupdateMaskUpdates a Snooze, identified by its name, with the parameters in the given Snooze object.

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
projectsIdstring
snoozesIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Retrieves a Snooze by name.

SELECT
name,
criteria,
displayName,
interval
FROM google.monitoring.snoozes
WHERE projectsId = '{{ projectsId }}' -- required
AND snoozesId = '{{ snoozesId }}' -- required;

INSERT examples

Creates a Snooze that will prevent alerts, which match the provided criteria, from being opened. The Snooze applies for a specific time interval.

INSERT INTO google.monitoring.snoozes (
data__name,
data__criteria,
data__interval,
data__displayName,
projectsId
)
SELECT
'{{ name }}',
'{{ criteria }}',
'{{ interval }}',
'{{ displayName }}',
'{{ projectsId }}'
RETURNING
name,
criteria,
displayName,
interval
;

UPDATE examples

Updates a Snooze, identified by its name, with the parameters in the given Snooze object.

UPDATE google.monitoring.snoozes
SET
data__name = '{{ name }}',
data__criteria = '{{ criteria }}',
data__interval = '{{ interval }}',
data__displayName = '{{ displayName }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND snoozesId = '{{ snoozesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
criteria,
displayName,
interval;