Skip to main content

silences

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

Overview

Namesilences
TypeResource
Idcloudflare.alerting.silences

Fields

The following fields are returned by SELECT queries:

Get Silence response

NameDatatypeDescription
idstringSilence ID (example: f878e90c23f44126ae3cfc399f646977)
policy_idstringThe unique identifier of a notification policy (example: 0da2b59ef118439d8097bdfb215203c9)
created_atstringWhen the silence was created. (example: 2022-01-01T00:00:00Z)
end_timestringWhen the silence ends. (example: 2022-01-01T00:00:00Z)
start_timestringWhen the silence starts. (example: 2022-01-01T00:00:00Z)
updated_atstringWhen the silence was modified. (example: 2022-01-01T00:00:00Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, silence_idGets a specific silence for an account.
listselectaccount_idGets a list of silences for an account.
createinsertaccount_idCreates a new silence for an account.
notification_silences_update_silencesreplaceaccount_idUpdates existing silences for an account.
deletedeleteaccount_id, silence_idDeletes an existing silence for an account.

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
account_idstringThe Cloudflare account ID.
silence_idstring

SELECT examples

Gets a specific silence for an account.

SELECT
id,
policy_id,
created_at,
end_time,
start_time,
updated_at
FROM cloudflare.alerting.silences
WHERE account_id = '{{ account_id }}' -- required
AND silence_id = '{{ silence_id }}' -- required
;

INSERT examples

Creates a new silence for an account.

INSERT INTO cloudflare.alerting.silences (
account_id
)
SELECT
'{{ account_id }}'
RETURNING
errors,
messages,
success
;

REPLACE examples

Updates existing silences for an account.

REPLACE cloudflare.alerting.silences
SET
-- No updatable properties
WHERE
account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Deletes an existing silence for an account.

DELETE FROM cloudflare.alerting.silences
WHERE account_id = '{{ account_id }}' --required
AND silence_id = '{{ silence_id }}' --required
;