Manage triggers
The CRUD methods read, update, and delete triggers. For creation, see Create a trigger and the examples in each trigger kind.
Read
Use the read methods to retrieve triggers from the backend or load them from a YAML descriptor.
get_trigger
Get a trigger entity from the backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Entity name or entity key ( |
required |
project
|
str
|
Project name. Required when |
None
|
entity_id
|
str
|
Entity identifier. If omitted, the latest version is returned. |
None
|
Returns:
| Type | Description |
|---|---|
Trigger
|
Retrieved trigger entity. |
list_triggers
List trigger entities in a project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
str
|
Project name. |
required |
q
|
str
|
Query string used to filter entities. |
None
|
name
|
str
|
Entity name used to filter results. |
None
|
kind
|
str
|
Entity kind used to filter results. |
None
|
user
|
str
|
User who created the entity. |
None
|
state
|
str
|
Entity state used to filter results. |
None
|
created
|
str
|
Creation date filter. |
None
|
updated
|
str
|
Update date filter. |
None
|
versions
|
str
|
Version filter. Defaults to the latest version. |
None
|
task
|
str
|
Task reference used to filter results. |
None
|
Returns:
| Type | Description |
|---|---|
list[Trigger]
|
Trigger entities matching the filters. |
import_trigger
Import a trigger entity from a YAML file or entity key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
str
|
Path to a YAML file containing the entity descriptor. Provide either
|
None
|
key
|
str
|
Entity key ( |
None
|
reset_id
|
bool
|
Whether to generate a new entity identifier instead of preserving the identifier from the imported entity. |
False
|
context
|
str
|
Project name used for context resolution. If omitted, the project from the entity descriptor is used. |
None
|
Returns:
| Type | Description |
|---|---|
Trigger
|
Imported trigger entity. |
Update
Update a trigger after changing its mutable metadata.
update_trigger
Update a trigger entity in the backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity
|
Trigger
|
Entity to update. The entity specification is immutable. |
required |
Returns:
| Type | Description |
|---|---|
Trigger
|
Updated trigger entity. |
Delete
Delete one trigger version or all versions of a trigger.
delete_trigger
Delete a trigger entity from the backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Entity name or entity key ( |
required |
project
|
str
|
Project name. Required when |
None
|
entity_id
|
str
|
Identifier of the version to delete. Required when |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
Response data from the backend. |