List
Retrieves the list of triggers in the specified folder.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListTriggersRequest =
cloudApi.serverless.triggers_trigger_service.ListTriggersRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.TriggerServiceClient);
const result = await client.list(
ListTriggersRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.serverless.triggers.v1.trigger_service_pb2 import ListTriggersRequest
from yandex.cloud.serverless.triggers.v1.trigger_service_pb2_grpc import TriggerServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(TriggerServiceStub)
response = service.List(
ListTriggersRequest(
folder_id="folderId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter"
)
)
print(response)
ListTriggersRequest
folderId
: string
ID of the folder to list triggers in.
To get a folder ID use a yandex.cloud.resourcemanager.v1.FolderService.List request.
pageSize
: int64
The maximum number of results per page to return. If the number of available
results is larger than pageSize
, the service returns a ListTriggersResponse.next_page_token
that can be used to get the next page of results in subsequent list requests.
Default value: 100.
pageToken
: string
Page token. To get the next page of results, set pageToken
to the
ListTriggersResponse.next_page_token returned by a previous list request.
filter
: string
A filter expression that filters triggers listed in the response.
The expression must specify:
- The field name. Currently filtering can only be applied to the Trigger.name field.
- An
=
operator. - The value in double quotes (
"
). Must be 3-63 characters long and match the regular expression[a-z][-a-z0-9]{1,61}[a-z0-9]
. Example of a filter:name=my-trigger
.
ListTriggersResponse
triggers
: Trigger
List of triggers in the specified folder.
nextPageToken
: string
Token for getting the next page of the list. If the number of results is greater than
the specified ListTriggersRequest.page_size, use nextPageToken
as the value
for the ListTriggersRequest.page_token parameter in the next list request.
Each subsequent page will have its own nextPageToken
to continue paging through the results.
Trigger
A trigger to invoke a serverless function. For more information, see Triggers.
Rule
Description of a rule for trigger activation.
One of rule
timer
: TimerRule for a timed trigger.
messageQueue
: MessageQueueRule for a message queue trigger.
iotMessage
: IoTMessageRule for a IoT Core trigger.
iotBrokerMessage
: IoTBrokerMessage
objectStorage
: ObjectStorage
containerRegistry
: ContainerRegistry
cloudLogs
: CloudLogs
logging
: Logging
billingBudget
: BillingBudget
dataStream
: DataStream
mail
: Mail
Timer
Rule for activating a timed trigger.
cronExpression
: string
Description of a schedule as a cron expression.
payload
: string
Payload to be passed to function.
One of action
Action to be executed when the current time matches the cron_expression.
invokeFunction
: InvokeFunctionOnceInstructions for invoking a function once.
invokeFunctionWithRetry
: InvokeFunctionWithRetryInstructions for invoking a function with retry.
invokeContainerWithRetry
: InvokeContainerWithRetryInstructions for invoking a container with retry.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
MessageQueue
Rule for activating a message queue trigger.
queueId
: string
ID of the message queue in Message Queue.
serviceAccountId
: string
ID of the service account which has read access to the message queue.
batchSettings
: BatchSettings
Batch settings for processing messages in the queue.
visibilityTimeout
: google.protobuf.Duration
Queue visibility timeout override.
invokeFunction
: InvokeFunctionOnceInstructions for invoking a function once.
invokeContainer
: InvokeContainerOnceInstructions for invoking a container once.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
IoTMessage
Rule for activating a IoT Core trigger.
registryId
: string
ID of the IoT Core registry.
deviceId
: string
ID of the IoT Core device in the registry.
mqttTopic
: string
MQTT topic whose messages activate the trigger.
batchSettings
: BatchSettings
Batch settings for processing events.
invokeFunction
: InvokeFunctionWithRetryInstructions for invoking a function with retries as needed.
invokeContainer
: InvokeContainerWithRetryInstructions for invoking a container with retries as needed.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
IoTBrokerMessage
Rule for activating a IoT Core Broker trigger.
brokerId
: string
ID of the IoT Core broker.
mqttTopic
: string
MQTT topic whose messages activate the trigger.
batchSettings
: BatchSettings
Batch settings for processing events.
invokeFunction
: InvokeFunctionWithRetryInstructions for invoking a function with retries as needed.
invokeContainer
: InvokeContainerWithRetryInstructions for invoking a container with retries as needed.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
ObjectStorageEventType
OBJECT_STORAGE_EVENT_TYPE_UNSPECIFIED
OBJECT_STORAGE_EVENT_TYPE_CREATE_OBJECT
OBJECT_STORAGE_EVENT_TYPE_UPDATE_OBJECT
OBJECT_STORAGE_EVENT_TYPE_DELETE_OBJECT
ObjectStorage
eventType
: ObjectStorageEventType
Type (name) of events, at least one value is required.
bucketId
: string
ID of the bucket.
prefix
: string
Prefix of the object key. Filter, optional.
suffix
: string
Suffix of the object key. Filter, optional.
batchSettings
: BatchSettings
Batch settings for processing events.
invokeFunction
: InvokeFunctionWithRetryInstructions for invoking a function with retries as needed.
invokeContainer
: InvokeContainerWithRetryInstructions for invoking a container with retries as needed.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
ContainerRegistryEventType
CONTAINER_REGISTRY_EVENT_TYPE_UNSPECIFIED
CONTAINER_REGISTRY_EVENT_TYPE_CREATE_IMAGE
CONTAINER_REGISTRY_EVENT_TYPE_DELETE_IMAGE
CONTAINER_REGISTRY_EVENT_TYPE_CREATE_IMAGE_TAG
CONTAINER_REGISTRY_EVENT_TYPE_DELETE_IMAGE_TAG
ContainerRegistry
eventType
: ContainerRegistryEventType
Type (name) of events, at least one value is required.
registryId
: string
ID of the registry.
imageName
: string
Docker-image name. Filter, optional.
tag
: string
Docker-image tag. Filter, optional.
batchSettings
: BatchSettings
Batch settings for processing events.
invokeFunction
: InvokeFunctionWithRetryInstructions for invoking a function with retries as needed.
invokeContainer
: InvokeContainerWithRetryInstructions for invoking a container with retries as needed.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
CloudLogs
logGroupId
: string
Log group identifiers, at least one value is required.
batchSettings
: CloudLogsBatchSettings
Batch settings for processing log events.
invokeFunction
: InvokeFunctionWithRetryInstructions for invoking a function with retries as needed.
invokeContainer
: InvokeContainerWithRetryInstructions for invoking a container with retries as needed.
Logging
logGroupId
: string
Log events filter settings.
resourceType
: string
resourceId
: string
streamName
: string
levels
: yandex.cloud.logging.v1.LogLevel.Level
batchSettings
: LoggingBatchSettings
Batch settings for processing log events.
invokeFunction
: InvokeFunctionWithRetryInstructions for invoking a function with retries as needed.
invokeContainer
: InvokeContainerWithRetryInstructions for invoking a container with retries as needed.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
Status
STATUS_UNSPECIFIED
ACTIVE
PAUSED
id
: string
ID of the trigger. Generated at creation time.
folderId
: string
ID of the folder that the trigger belongs to.
createdAt
: google.protobuf.Timestamp
Creation timestamp for the trigger.
name
: string
Name of the trigger.
description
: string
Description of the trigger.
labels
: string
Trigger labels as key:value
pairs.
rule
: Rule
Rule for trigger activation (always consistent with the trigger type).
status
: Status
Trigger status.
Timer
Rule for activating a timed trigger.
cronExpression
: string
Description of a schedule as a cron expression.
payload
: string
Payload to be passed to function.
invokeFunction
: InvokeFunctionOnceInstructions for invoking a function once.
invokeFunctionWithRetry
: InvokeFunctionWithRetryInstructions for invoking a function with retry.
invokeContainerWithRetry
: InvokeContainerWithRetryInstructions for invoking a container with retry.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
MessageQueue
Rule for activating a message queue trigger.
queueId
: string
ID of the message queue in Message Queue.
serviceAccountId
: string
ID of the service account which has read access to the message queue.
batchSettings
: BatchSettings
Batch settings for processing messages in the queue.
visibilityTimeout
: google.protobuf.Duration
Queue visibility timeout override.
invokeFunction
: InvokeFunctionOnceInstructions for invoking a function once.
invokeContainer
: InvokeContainerOnceInstructions for invoking a container once.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
IoTMessage
Rule for activating a IoT Core trigger.
registryId
: string
ID of the IoT Core registry.
deviceId
: string
ID of the IoT Core device in the registry.
mqttTopic
: string
MQTT topic whose messages activate the trigger.
batchSettings
: BatchSettings
Batch settings for processing events.
invokeFunction
: InvokeFunctionWithRetryInstructions for invoking a function with retries as needed.
invokeContainer
: InvokeContainerWithRetryInstructions for invoking a container with retries as needed.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
IoTBrokerMessage
Rule for activating a IoT Core Broker trigger.
brokerId
: string
ID of the IoT Core broker.
mqttTopic
: string
MQTT topic whose messages activate the trigger.
batchSettings
: BatchSettings
Batch settings for processing events.
invokeFunction
: InvokeFunctionWithRetryInstructions for invoking a function with retries as needed.
invokeContainer
: InvokeContainerWithRetryInstructions for invoking a container with retries as needed.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
ObjectStorage
eventType
: ObjectStorageEventType
Type (name) of events, at least one value is required.
bucketId
: string
ID of the bucket.
prefix
: string
Prefix of the object key. Filter, optional.
suffix
: string
Suffix of the object key. Filter, optional.
batchSettings
: BatchSettings
Batch settings for processing events.
invokeFunction
: InvokeFunctionWithRetryInstructions for invoking a function with retries as needed.
invokeContainer
: InvokeContainerWithRetryInstructions for invoking a container with retries as needed.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
ContainerRegistry
eventType
: ContainerRegistryEventType
Type (name) of events, at least one value is required.
registryId
: string
ID of the registry.
imageName
: string
Docker-image name. Filter, optional.
tag
: string
Docker-image tag. Filter, optional.
batchSettings
: BatchSettings
Batch settings for processing events.
invokeFunction
: InvokeFunctionWithRetryInstructions for invoking a function with retries as needed.
invokeContainer
: InvokeContainerWithRetryInstructions for invoking a container with retries as needed.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
CloudLogs
logGroupId
: string
Log group identifiers, at least one value is required.
batchSettings
: CloudLogsBatchSettings
Batch settings for processing log events.
invokeFunction
: InvokeFunctionWithRetryInstructions for invoking a function with retries as needed.
invokeContainer
: InvokeContainerWithRetryInstructions for invoking a container with retries as needed.
Logging
logGroupId
: string
Log events filter settings.
resourceType
: string
resourceId
: string
streamName
: string
levels
: yandex.cloud.logging.v1.LogLevel.Level
batchSettings
: LoggingBatchSettings
Batch settings for processing log events.
invokeFunction
: InvokeFunctionWithRetryInstructions for invoking a function with retries as needed.
invokeContainer
: InvokeContainerWithRetryInstructions for invoking a container with retries as needed.
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcastInstructions for broadcasting to API gateway websocket once.
BillingBudget
billingAccountId
: string
budgetId
: string
invokeFunction
: InvokeFunctionWithRetry
invokeContainer
: InvokeContainerWithRetry
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcast
DataStream
endpoint
: string
Data stream endpoint.
database
: string
Data stream database.
stream
: string
Stream name.
serviceAccountId
: string
ID of the service account which has permission to read data stream.
batchSettings
: DataStreamBatchSettings
Batch settings for processing events.
invokeFunction
: InvokeFunctionWithRetry
invokeContainer
: InvokeContainerWithRetry
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcast
Mail
email
: string
Address to receive emails for trigger activation. Field is ignored for write requests and populated on trigger creation.
batchSettings
: BatchSettings
Batch settings for processing events.
attachmentsBucket
: ObjectStorageBucketSettings
Bucket settings for saving attachments.
invokeFunction
: InvokeFunctionWithRetry
invokeContainer
: InvokeContainerWithRetry
gatewayWebsocketBroadcast
: GatewayWebsocketBroadcast
InvokeFunctionOnce
A single function invocation.
functionId
: string
ID of the function to invoke.
functionTag
: string
Version tag of the function to execute.
serviceAccountId
: string
ID of the service account that should be used to invoke the function.
InvokeFunctionWithRetry
A function invocation with retries.
functionId
: string
ID of the function to invoke.
functionTag
: string
Version tag of the function to execute.
serviceAccountId
: string
ID of the service account which has permission to invoke the function.
retrySettings
: RetrySettings
Retry policy. If the field is not specified, or the value is empty, no retries will be attempted.
deadLetterQueue
: PutQueueMessage
DLQ policy (no value means discarding a message).
InvokeContainerWithRetry
A container invocation with retries.
containerId
: string
ID of the container to invoke.
path
: string
Endpoint HTTP path to invoke.
serviceAccountId
: string
ID of the service account which has permission to invoke the container.
retrySettings
: RetrySettings
Retry policy. If the field is not specified, or the value is empty, no retries will be attempted.
deadLetterQueue
: PutQueueMessage
DLQ policy (no value means discarding a message).
GatewayWebsocketBroadcast
gatewayId
: string
path
: string
serviceAccountId
: string
sa which has permission for writing to websockets
BatchSettings
Settings for batch processing of messages in a queue.
size
: int64
Batch size. Trigger will send the batch of messages to the function when the number of messages in the queue reaches size, or the cutoff time has passed.
cutoff
: google.protobuf.Duration
Maximum wait time. Trigger will send the batch of messages to the function when the number of messages in the queue reaches size, or the cutoff time has passed.
InvokeContainerOnce
A single container invocation.
containerId
: string
ID of the container to invoke.
path
: string
Endpoint HTTP path to invoke.
serviceAccountId
: string
ID of the service account which has permission to invoke the container.
CloudLogsBatchSettings
size
: int64
Batch size. Trigger will send the batch of messages to the function when the number of messages in the log group reaches size, or the cutoff time has passed.
cutoff
: google.protobuf.Duration
Maximum wait time. Trigger will send the batch of messages to the function when the number of messages in the log group reaches size, or the cutoff time has passed.
LoggingBatchSettings
size
: int64
Batch size. Trigger will send the batch of messages to the associated function when the number of log events reaches this value, or the cutoff time has passed.
cutoff
: google.protobuf.Duration
Maximum wait time. Trigger will send the batch of messages the time since the last batch
exceeds the cutoff
value, regardless of the amount of log events.
Rule
Description of a rule for trigger activation.
timer
: TimerRule for a timed trigger.
messageQueue
: MessageQueueRule for a message queue trigger.
iotMessage
: IoTMessageRule for a IoT Core trigger.
iotBrokerMessage
: IoTBrokerMessage
objectStorage
: ObjectStorage
containerRegistry
: ContainerRegistry
cloudLogs
: CloudLogs
logging
: Logging
billingBudget
: BillingBudget
dataStream
: DataStream
mail
: Mail
DataStreamBatchSettings
size
: int64
Batch size in bytes. Trigger will send the batch of messages to the associated function when size of log events reaches this value, or the cutoff time has passed.
cutoff
: google.protobuf.Duration
Maximum wait time. Trigger will send the batch of messages the time since the last batch
exceeds the cutoff
value, regardless of the amount of log events.
ObjectStorageBucketSettings
bucketId
: string
Bucket for saving.
serviceAccountId
: string
SA which has write permission on storage.
RetrySettings
Settings for retrying to invoke a function.
retryAttempts
: int64
Maximum number of retries (extra invokes) before the action is considered failed.
interval
: google.protobuf.Duration
Time in seconds to wait between individual retries.
PutQueueMessage
queueId
: string
ID of the queue.
serviceAccountId
: string
Service account which has write permission on the queue.