Update
Updates the specified trigger.
- TypeScript
- Python
import {
cloudApi,
decodeMessage,
serviceClients,
Session,
waitForOperation,
} from "@yandex-cloud/nodejs-sdk";
const LogLevel_Level = cloudApi.logging.log_entry.LogLevel_Level;
const Trigger = cloudApi.serverless.triggers_trigger.Trigger;
const Trigger_ContainerRegistryEventType =
cloudApi.serverless.triggers_trigger.Trigger_ContainerRegistryEventType;
const Trigger_ObjectStorageEventType =
cloudApi.serverless.triggers_trigger.Trigger_ObjectStorageEventType;
const UpdateTriggerRequest =
cloudApi.serverless.triggers_trigger_service.UpdateTriggerRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.TriggerServiceClient);
const operation = await client.update(
UpdateTriggerRequest.fromPartial({
triggerId: "triggerId",
// updateMask: {
// paths: ["paths"]
// },
// name: "name",
// description: "description",
// labels: {"key": "labels"},
// rule: {
// timer: {
// cronExpression: "cronExpression",
// payload: "payload",
// invokeFunction: {
// functionId: "functionId",
// functionTag: "functionTag",
// serviceAccountId: "serviceAccountId"
// },
// invokeFunctionWithRetry: {
// functionId: "functionId",
// functionTag: "functionTag",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// invokeContainerWithRetry: {
// containerId: "containerId",
// path: "path",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// gatewayWebsocketBroadcast: {
// gatewayId: "gatewayId",
// path: "path",
// serviceAccountId: "serviceAccountId"
// }
// },
// messageQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId",
// batchSettings: {
// size: 0,
// cutoff: {
// seconds: 0,
// nanos: 0
// }
// },
// visibilityTimeout: {
// seconds: 0,
// nanos: 0
// },
// invokeFunction: {
// functionId: "functionId",
// functionTag: "functionTag",
// serviceAccountId: "serviceAccountId"
// },
// invokeContainer: {
// containerId: "containerId",
// path: "path",
// serviceAccountId: "serviceAccountId"
// },
// gatewayWebsocketBroadcast: {
// gatewayId: "gatewayId",
// path: "path",
// serviceAccountId: "serviceAccountId"
// }
// },
// iotMessage: {
// registryId: "registryId",
// deviceId: "deviceId",
// mqttTopic: "mqttTopic",
// batchSettings: {
// size: 0,
// cutoff: {
// seconds: 0,
// nanos: 0
// }
// },
// invokeFunction: {
// functionId: "functionId",
// functionTag: "functionTag",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// invokeContainer: {
// containerId: "containerId",
// path: "path",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// gatewayWebsocketBroadcast: {
// gatewayId: "gatewayId",
// path: "path",
// serviceAccountId: "serviceAccountId"
// }
// },
// iotBrokerMessage: {
// brokerId: "brokerId",
// mqttTopic: "mqttTopic",
// batchSettings: {
// size: 0,
// cutoff: {
// seconds: 0,
// nanos: 0
// }
// },
// invokeFunction: {
// functionId: "functionId",
// functionTag: "functionTag",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// invokeContainer: {
// containerId: "containerId",
// path: "path",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// gatewayWebsocketBroadcast: {
// gatewayId: "gatewayId",
// path: "path",
// serviceAccountId: "serviceAccountId"
// }
// },
// objectStorage: {
// eventType: [Trigger_ObjectStorageEventType.OBJECT_STORAGE_EVENT_TYPE_CREATE_OBJECT],
// bucketId: "bucketId",
// prefix: "prefix",
// suffix: "suffix",
// batchSettings: {
// size: 0,
// cutoff: {
// seconds: 0,
// nanos: 0
// }
// },
// invokeFunction: {
// functionId: "functionId",
// functionTag: "functionTag",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// invokeContainer: {
// containerId: "containerId",
// path: "path",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// gatewayWebsocketBroadcast: {
// gatewayId: "gatewayId",
// path: "path",
// serviceAccountId: "serviceAccountId"
// }
// },
// containerRegistry: {
// eventType: [Trigger_ContainerRegistryEventType.CONTAINER_REGISTRY_EVENT_TYPE_CREATE_IMAGE],
// registryId: "registryId",
// imageName: "imageName",
// tag: "tag",
// batchSettings: {
// size: 0,
// cutoff: {
// seconds: 0,
// nanos: 0
// }
// },
// invokeFunction: {
// functionId: "functionId",
// functionTag: "functionTag",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// invokeContainer: {
// containerId: "containerId",
// path: "path",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// gatewayWebsocketBroadcast: {
// gatewayId: "gatewayId",
// path: "path",
// serviceAccountId: "serviceAccountId"
// }
// },
// cloudLogs: {
// logGroupId: ["logGroupId"],
// batchSettings: {
// size: 0,
// cutoff: {
// seconds: 0,
// nanos: 0
// }
// },
// invokeFunction: {
// functionId: "functionId",
// functionTag: "functionTag",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// invokeContainer: {
// containerId: "containerId",
// path: "path",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// }
// },
// logging: {
// logGroupId: "logGroupId",
// resourceType: ["resourceType"],
// resourceId: ["resourceId"],
// streamName: ["streamName"],
// levels: [LogLevel_Level.TRACE],
// batchSettings: {
// size: 0,
// cutoff: {
// seconds: 0,
// nanos: 0
// }
// },
// invokeFunction: {
// functionId: "functionId",
// functionTag: "functionTag",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// invokeContainer: {
// containerId: "containerId",
// path: "path",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// gatewayWebsocketBroadcast: {
// gatewayId: "gatewayId",
// path: "path",
// serviceAccountId: "serviceAccountId"
// }
// },
// billingBudget: {
// billingAccountId: "billingAccountId",
// budgetId: "budgetId",
// invokeFunction: {
// functionId: "functionId",
// functionTag: "functionTag",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// invokeContainer: {
// containerId: "containerId",
// path: "path",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// gatewayWebsocketBroadcast: {
// gatewayId: "gatewayId",
// path: "path",
// serviceAccountId: "serviceAccountId"
// }
// },
// dataStream: {
// endpoint: "endpoint",
// database: "database",
// stream: "stream",
// serviceAccountId: "serviceAccountId",
// batchSettings: {
// size: 0,
// cutoff: {
// seconds: 0,
// nanos: 0
// }
// },
// invokeFunction: {
// functionId: "functionId",
// functionTag: "functionTag",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// invokeContainer: {
// containerId: "containerId",
// path: "path",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// gatewayWebsocketBroadcast: {
// gatewayId: "gatewayId",
// path: "path",
// serviceAccountId: "serviceAccountId"
// }
// },
// mail: {
// email: "email",
// batchSettings: {
// size: 0,
// cutoff: {
// seconds: 0,
// nanos: 0
// }
// },
// attachmentsBucket: {
// bucketId: "bucketId",
// serviceAccountId: "serviceAccountId"
// },
// invokeFunction: {
// functionId: "functionId",
// functionTag: "functionTag",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// invokeContainer: {
// containerId: "containerId",
// path: "path",
// serviceAccountId: "serviceAccountId",
// retrySettings: {
// retryAttempts: 0,
// interval: {
// seconds: 0,
// nanos: 0
// }
// },
// deadLetterQueue: {
// queueId: "queueId",
// serviceAccountId: "serviceAccountId"
// }
// },
// gatewayWebsocketBroadcast: {
// gatewayId: "gatewayId",
// path: "path",
// serviceAccountId: "serviceAccountId"
// }
// }
// }
})
);
const finishedOp = await waitForOperation(operation, session);
if (finishedOp.response) {
const result = decodeMessage<typeof Trigger>(finishedOp.response);
console.log(result);
}
})();
import os
import grpc
import yandexcloud
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import BatchSettings
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import BillingBudget
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import CloudLogsBatchSettings
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import DataStream
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import DataStreamBatchSettings
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import GatewayWebsocketBroadcast
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import InvokeContainerOnce
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import InvokeContainerWithRetry
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import InvokeFunctionOnce
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import InvokeFunctionWithRetry
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import LoggingBatchSettings
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import Mail
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import ObjectStorageBucketSettings
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import PutQueueMessage
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import RetrySettings
from yandex.cloud.serverless.triggers.v1.trigger_pb2 import Trigger
from yandex.cloud.serverless.triggers.v1.trigger_service_pb2_grpc import TriggerServiceStub
from yandex.cloud.serverless.triggers.v1.trigger_service_pb2 import UpdateTriggerMetadata
from yandex.cloud.serverless.triggers.v1.trigger_service_pb2 import UpdateTriggerRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(TriggerServiceStub)
operation = service.Update(
UpdateTriggerRequest(
trigger_id="triggerId",
# update_mask = FieldMask.FromJsonString("field1,field2"),
# name = "name",
# description = "description",
# labels = {"key": "labels"},
# rule = Trigger.Rule(
# timer = Trigger.Timer(
# cron_expression = "cronExpression",
# payload = "payload",
# invoke_function = InvokeFunctionOnce(
# function_id = "functionId",
# function_tag = "functionTag",
# service_account_id = "serviceAccountId"
# ),
# invoke_function_with_retry = InvokeFunctionWithRetry(
# function_id = "functionId",
# function_tag = "functionTag",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# invoke_container_with_retry = InvokeContainerWithRetry(
# container_id = "containerId",
# path = "path",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# gateway_websocket_broadcast = GatewayWebsocketBroadcast(
# gateway_id = "gatewayId",
# path = "path",
# service_account_id = "serviceAccountId"
# )
# ),
# message_queue = Trigger.MessageQueue(
# queue_id = "queueId",
# service_account_id = "serviceAccountId",
# batch_settings = BatchSettings(
# size = 0,
# cutoff = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# visibility_timeout = Duration(
# seconds = 0,
# nanos = 0
# ),
# invoke_function = InvokeFunctionOnce(
# function_id = "functionId",
# function_tag = "functionTag",
# service_account_id = "serviceAccountId"
# ),
# invoke_container = InvokeContainerOnce(
# container_id = "containerId",
# path = "path",
# service_account_id = "serviceAccountId"
# ),
# gateway_websocket_broadcast = GatewayWebsocketBroadcast(
# gateway_id = "gatewayId",
# path = "path",
# service_account_id = "serviceAccountId"
# )
# ),
# iot_message = Trigger.IoTMessage(
# registry_id = "registryId",
# device_id = "deviceId",
# mqtt_topic = "mqttTopic",
# batch_settings = BatchSettings(
# size = 0,
# cutoff = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# invoke_function = InvokeFunctionWithRetry(
# function_id = "functionId",
# function_tag = "functionTag",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# invoke_container = InvokeContainerWithRetry(
# container_id = "containerId",
# path = "path",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# gateway_websocket_broadcast = GatewayWebsocketBroadcast(
# gateway_id = "gatewayId",
# path = "path",
# service_account_id = "serviceAccountId"
# )
# ),
# iot_broker_message = Trigger.IoTBrokerMessage(
# broker_id = "brokerId",
# mqtt_topic = "mqttTopic",
# batch_settings = BatchSettings(
# size = 0,
# cutoff = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# invoke_function = InvokeFunctionWithRetry(
# function_id = "functionId",
# function_tag = "functionTag",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# invoke_container = InvokeContainerWithRetry(
# container_id = "containerId",
# path = "path",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# gateway_websocket_broadcast = GatewayWebsocketBroadcast(
# gateway_id = "gatewayId",
# path = "path",
# service_account_id = "serviceAccountId"
# )
# ),
# object_storage = Trigger.ObjectStorage(
# event_type = [Trigger.ObjectStorageEventType.OBJECT_STORAGE_EVENT_TYPE_CREATE_OBJECT],
# bucket_id = "bucketId",
# prefix = "prefix",
# suffix = "suffix",
# batch_settings = BatchSettings(
# size = 0,
# cutoff = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# invoke_function = InvokeFunctionWithRetry(
# function_id = "functionId",
# function_tag = "functionTag",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# invoke_container = InvokeContainerWithRetry(
# container_id = "containerId",
# path = "path",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# gateway_websocket_broadcast = GatewayWebsocketBroadcast(
# gateway_id = "gatewayId",
# path = "path",
# service_account_id = "serviceAccountId"
# )
# ),
# container_registry = Trigger.ContainerRegistry(
# event_type = [Trigger.ContainerRegistryEventType.CONTAINER_REGISTRY_EVENT_TYPE_CREATE_IMAGE],
# registry_id = "registryId",
# image_name = "imageName",
# tag = "tag",
# batch_settings = BatchSettings(
# size = 0,
# cutoff = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# invoke_function = InvokeFunctionWithRetry(
# function_id = "functionId",
# function_tag = "functionTag",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# invoke_container = InvokeContainerWithRetry(
# container_id = "containerId",
# path = "path",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# gateway_websocket_broadcast = GatewayWebsocketBroadcast(
# gateway_id = "gatewayId",
# path = "path",
# service_account_id = "serviceAccountId"
# )
# ),
# cloud_logs = Trigger.CloudLogs(
# log_group_id = ["logGroupId"],
# batch_settings = CloudLogsBatchSettings(
# size = 0,
# cutoff = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# invoke_function = InvokeFunctionWithRetry(
# function_id = "functionId",
# function_tag = "functionTag",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# invoke_container = InvokeContainerWithRetry(
# container_id = "containerId",
# path = "path",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# )
# ),
# logging = Trigger.Logging(
# log_group_id = "logGroupId",
# resource_type = ["resourceType"],
# resource_id = ["resourceId"],
# stream_name = ["streamName"],
# levels = [LogLevel.Level.TRACE],
# batch_settings = LoggingBatchSettings(
# size = 0,
# cutoff = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# invoke_function = InvokeFunctionWithRetry(
# function_id = "functionId",
# function_tag = "functionTag",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# invoke_container = InvokeContainerWithRetry(
# container_id = "containerId",
# path = "path",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# gateway_websocket_broadcast = GatewayWebsocketBroadcast(
# gateway_id = "gatewayId",
# path = "path",
# service_account_id = "serviceAccountId"
# )
# ),
# billing_budget = BillingBudget(
# billing_account_id = "billingAccountId",
# budget_id = "budgetId",
# invoke_function = InvokeFunctionWithRetry(
# function_id = "functionId",
# function_tag = "functionTag",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# invoke_container = InvokeContainerWithRetry(
# container_id = "containerId",
# path = "path",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# gateway_websocket_broadcast = GatewayWebsocketBroadcast(
# gateway_id = "gatewayId",
# path = "path",
# service_account_id = "serviceAccountId"
# )
# ),
# data_stream = DataStream(
# endpoint = "endpoint",
# database = "database",
# stream = "stream",
# service_account_id = "serviceAccountId",
# batch_settings = DataStreamBatchSettings(
# size = 0,
# cutoff = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# invoke_function = InvokeFunctionWithRetry(
# function_id = "functionId",
# function_tag = "functionTag",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# invoke_container = InvokeContainerWithRetry(
# container_id = "containerId",
# path = "path",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# gateway_websocket_broadcast = GatewayWebsocketBroadcast(
# gateway_id = "gatewayId",
# path = "path",
# service_account_id = "serviceAccountId"
# )
# ),
# mail = Mail(
# email = "email",
# batch_settings = BatchSettings(
# size = 0,
# cutoff = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# attachments_bucket = ObjectStorageBucketSettings(
# bucket_id = "bucketId",
# service_account_id = "serviceAccountId"
# ),
# invoke_function = InvokeFunctionWithRetry(
# function_id = "functionId",
# function_tag = "functionTag",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# invoke_container = InvokeContainerWithRetry(
# container_id = "containerId",
# path = "path",
# service_account_id = "serviceAccountId",
# retry_settings = RetrySettings(
# retry_attempts = 0,
# interval = Duration(
# seconds = 0,
# nanos = 0
# )
# ),
# dead_letter_queue = PutQueueMessage(
# queue_id = "queueId",
# service_account_id = "serviceAccountId"
# )
# ),
# gateway_websocket_broadcast = GatewayWebsocketBroadcast(
# gateway_id = "gatewayId",
# path = "path",
# service_account_id = "serviceAccountId"
# )
# )
# )
)
)
operation_result = sdk.wait_operation_and_get_result(
operation,
response_type=Trigger,
meta_type=UpdateTriggerMetadata,
)
print(operation_result)
UpdateTriggerRequest
triggerId
: string
ID of the trigger to update.
To get a trigger ID make a TriggerService.List request.
updateMask
: google.protobuf.FieldMask
Field mask that specifies which attributes of the trigger should be updated.
name
: string
New name for the trigger. The name must be unique within the folder.
description
: string
New description of the trigger.
labels
: string
Trigger labels as key:value
pairs.
Existing set of labels is completely replaced by the provided set, so if you just want to add or remove a label, request the current set of labels with a TriggerService.Get request.
rule
: Trigger.Rule
New parameters for trigger.
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.
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.
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.
Operation
An Operation resource. For more information, see Operation.
id
: string
ID of the operation.
description
: string
Description of the operation. 0-256 characters long.
createdAt
: google.protobuf.Timestamp
Creation timestamp.
createdBy
: string
ID of the user or service account who initiated the operation.
modifiedAt
: google.protobuf.Timestamp
The time when the Operation resource was last modified.
done
: bool
If the value is false
, it means the operation is still in progress.
If true
, the operation is completed, and either error
or response
is available.
metadata
: google.protobuf.Any
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
One of result
The operation result.
If done == false
and there was no failure detected, neither error
nor response
is set.
If done == false
and there was a failure detected, error
is set.
If done == true
, exactly one of error
or response
is set.
error
: google.rpc.StatusThe error result of the operation in case of failure or cancellation.
response
: google.protobuf.AnyThe normal response of the operation in case of success.
If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any.