Skip to main content

triggers

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

Overview

Nametriggers
TypeResource
Idgoogle.eventarc.triggers

Fields

NameDatatypeDescription
namestringRequired. The resource name of the trigger. Must be unique within the location of the project and must be in projects/{project}/locations/{location}/triggers/{trigger} format.
channelstringOptional. The name of the channel associated with the trigger in projects/{project}/locations/{location}/channels/{channel} format. You must provide a channel to receive events from Eventarc SaaS partners.
conditionsobjectOutput only. The reason(s) why a trigger is in FAILED state.
createTimestringOutput only. The creation time.
destinationobjectRepresents a target of an invocation over HTTP.
etagstringOutput only. This checksum is computed by the server based on the value of other fields, and might be sent only on create requests to ensure that the client has an up-to-date value before proceeding.
eventDataContentTypestringOptional. EventDataContentType specifies the type of payload in MIME format that is expected from the CloudEvent data field. This is set to application/json if the value is not defined.
eventFiltersarrayRequired. Unordered list. The list of filters that applies to event attributes. Only events that match all the provided filters are sent to the destination.
labelsobjectOptional. User labels attached to the triggers that can be used to group resources.
satisfiesPzsbooleanOutput only. Whether or not this Trigger satisfies the requirements of physical zone separation
serviceAccountstringOptional. The IAM service account email associated with the trigger. The service account represents the identity of the trigger. The iam.serviceAccounts.actAs permission must be granted on the service account to allow a principal to impersonate the service account. For more information, see the Roles and permissions page specific to the trigger destination.
transportobjectRepresents the transport intermediaries created for the trigger to deliver events.
uidstringOutput only. Server-assigned unique identifier for the trigger. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.
updateTimestringOutput only. The last-modified time.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, triggersIdGet a single trigger.
listSELECTlocationsId, projectsIdList triggers.
createINSERTlocationsId, projectsIdCreate a new trigger in a particular project and location.
deleteDELETElocationsId, projectsId, triggersIdDelete a single trigger.
patchUPDATElocationsId, projectsId, triggersIdUpdate a single trigger.

SELECT examples

List triggers.

SELECT
name,
channel,
conditions,
createTime,
destination,
etag,
eventDataContentType,
eventFilters,
labels,
satisfiesPzs,
serviceAccount,
transport,
uid,
updateTime
FROM google.eventarc.triggers
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new triggers resource.

/*+ create */
INSERT INTO google.eventarc.triggers (
locationsId,
projectsId,
name,
eventFilters,
serviceAccount,
destination,
transport,
labels,
channel,
eventDataContentType
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ eventFilters }}',
'{{ serviceAccount }}',
'{{ destination }}',
'{{ transport }}',
'{{ labels }}',
'{{ channel }}',
'{{ eventDataContentType }}'
;

UPDATE example

Updates a triggers resource.

/*+ update */
UPDATE google.eventarc.triggers
SET
name = '{{ name }}',
eventFilters = '{{ eventFilters }}',
serviceAccount = '{{ serviceAccount }}',
destination = '{{ destination }}',
transport = '{{ transport }}',
labels = '{{ labels }}',
channel = '{{ channel }}',
eventDataContentType = '{{ eventDataContentType }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND triggersId = '{{ triggersId }}';

DELETE example

Deletes the specified triggers resource.

/*+ delete */
DELETE FROM google.eventarc.triggers
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND triggersId = '{{ triggersId }}';