Skip to main content

triggers

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

Overview

Nametriggers
TypeResource
Idgoogle.eventarc.triggers

Fields

The following fields are returned by SELECT queries:

Successful response

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.
createTimestring (google-datetime)Output only. The creation time.
destinationobjectRequired. Destination specifies where the events should be sent to. (id: Destination)
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.
transportobjectOptional. To deliver messages, Eventarc might use other Google Cloud products as a transport intermediary. This field contains a reference to that transport intermediary. This information can be used for debugging purposes. (id: Transport)
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.
updateTimestring (google-datetime)Output only. The last-modified time.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, triggersIdGet a single trigger.
listselectprojectsId, locationsIdpageSize, pageToken, orderBy, filterList triggers.
createinsertprojectsId, locationsIdtriggerId, validateOnlyCreate a new trigger in a particular project and location.
patchupdateprojectsId, locationsId, triggersIdupdateMask, allowMissing, validateOnlyUpdate a single trigger.
deletedeleteprojectsId, locationsId, triggersIdetag, allowMissing, validateOnlyDelete a single trigger.

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
locationsIdstring
projectsIdstring
triggersIdstring
allowMissingboolean
etagstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
triggerIdstring
updateMaskstring (google-fieldmask)
validateOnlyboolean

SELECT examples

Get a single trigger.

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

INSERT examples

Create a new trigger in a particular project and location.

INSERT INTO google.eventarc.triggers (
data__name,
data__eventFilters,
data__serviceAccount,
data__destination,
data__transport,
data__labels,
data__channel,
data__eventDataContentType,
projectsId,
locationsId,
triggerId,
validateOnly
)
SELECT
'{{ name }}',
'{{ eventFilters }}',
'{{ serviceAccount }}',
'{{ destination }}',
'{{ transport }}',
'{{ labels }}',
'{{ channel }}',
'{{ eventDataContentType }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ triggerId }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Update a single trigger.

UPDATE google.eventarc.triggers
SET
data__name = '{{ name }}',
data__eventFilters = '{{ eventFilters }}',
data__serviceAccount = '{{ serviceAccount }}',
data__destination = '{{ destination }}',
data__transport = '{{ transport }}',
data__labels = '{{ labels }}',
data__channel = '{{ channel }}',
data__eventDataContentType = '{{ eventDataContentType }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND triggersId = '{{ triggersId }}' --required
AND updateMask = '{{ updateMask}}'
AND allowMissing = {{ allowMissing}}
AND validateOnly = {{ validateOnly}}
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Delete a single trigger.

DELETE FROM google.eventarc.triggers
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND triggersId = '{{ triggersId }}' --required
AND etag = '{{ etag }}'
AND allowMissing = '{{ allowMissing }}'
AND validateOnly = '{{ validateOnly }}';