List
Retrieves the list of rules in the specified folder.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListRulesRequest =
cloudApi.serverless.eventrouter_rule_service.ListRulesRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.RuleServiceClient);
const result = await client.list(
ListRulesRequest.fromPartial({
// busId: "busId",
// folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.serverless.eventrouter.v1.rule_service_pb2 import ListRulesRequest
from yandex.cloud.serverless.eventrouter.v1.rule_service_pb2_grpc import RuleServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(RuleServiceStub)
response = service.List(
ListRulesRequest(
# bus_id = "busId",
# folder_id = "folderId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter"
)
)
print(response)
ListRulesRequest
One of containerId
ID of the folder on bus to list rules in.
busId: stringID of the bus to list rules in.
folderId: stringID of the folder to list rules in.
pageSize : int64
The maximum number of results per response.
pageToken : string
Page token. To get the next page of results, set page_token to the
next_page_token returned by a previous list request.
filter : string
Supported fields for filter: name created_at
ListRulesResponse
rules : Rule
List of rules.
nextPageToken : string
Token for getting the next page of the list of rules.
Rule
Status
STATUS_UNSPECIFIEDCREATINGRule creation in progress, rule is not enabled yet
ENABLEDRule is operating
UPDATINGRule update in progress, rule is disabled during update
DISABLEDRule is explicitly disabled by the user
id : string
ID of the rule.
busId : string
ID of the bus that the rule belongs to.
folderId : string
ID of the folder that the rule resides in.
cloudId : string
ID of the cloud that the rule resides in.
createdAt : google.protobuf.Timestamp
Creation timestamp.
name : string
Name of the rule.
description : string
Description of the rule.
labels : string
Resource labels as key:value pairs.
filter : Filter
Filter for the rule.
targets : Target
Targets of the rule.
deletionProtection : bool
Flag that disallow deletion of the rule.
status : Status
Rule status
Filter
One of condition
jqFilter: stringJQ filter for matching events.
Target
Status
Status of the target.
STATUS_UNSPECIFIEDStatus of the target.
ENABLEDTarget is enabled.
DISABLEDTarget is disabled.
RESOURCE_NOT_FOUNDTarget does not exist.
PERMISSION_DENIEDService account does not have read permission on source.
SUBJECT_NOT_FOUNDService account not found.
One of target
yds: YdsTarget
ymq: YmqTarget
function: FunctionTarget
container: ContainerTarget
gatewayWsBroadcast: GatewayWebsocketBroadcastTarget
logging: LoggingTarget
workflow: WorkflowTarget
transformer : Transformer
Transformer of the target.
retrySettings : RetrySettings
Retry settings of the target.
One of deadLetter
Dead letter settings of the target.
deadLetterQueue: PutQueueMessageDead letter queue.
status : Status
Status of the target.
YdsTarget
database : string
Stream database.
streamName : string
Full stream name, like /ru-central1/aoegtvhtp8ob****/cc8004q4lbo6****/test.
serviceAccountId : string
Service account, which has write permission on the stream.
YmqTarget
queueArn : string
Queue ARN. Example: yrn:yc:ymq:ru-central1:aoe***:test
serviceAccountId : string
Service account which has write access to the queue.
FunctionTarget
functionId : string
Function ID.
functionTag : string
Function tag, optional.
serviceAccountId : string
Service account which has call permission on the function, optional.
batchSettings : BatchSettings
Batch settings.
ContainerTarget
containerId : string
Container ID.
containerRevisionId : string
Container revision ID.
path : string
Endpoint HTTP path to invoke.
serviceAccountId : string
Service account which should be used to call a container, optional.
batchSettings : BatchSettings
Batch settings.
GatewayWebsocketBroadcastTarget
gatewayId : string
Gateway ID.
path : string
Path.
serviceAccountId : string
Service account which has permission for writing to websockets.
batchSettings : BatchSettings
Batch settings.
LoggingTarget
One of destination
Log group ID or folder ID.
logGroupId: string
folderId: string
serviceAccountId : string
Service account which has permission for writing logs.
WorkflowTarget
workflowId : string
Workflow ID.
serviceAccountId : string
SA which should be used to start workflow.
batchSettings : BatchSettings
Batch settings.
Transformer
One of transformer
jqTransformer: stringJQ string inrerpolation expression for changing event format.
RetrySettings
retryAttempts : int64
Maximum number of retries (extra calls) before an action fails.
maximumAge : google.protobuf.Duration
Event goes to dlq when its age exceeds this value. Default is 24h.
PutQueueMessage
queueArn : string
ID of the queue.
serviceAccountId : string
Service account which has write permission on the queue.
BatchSettings
maxCount : int64
Maximum batch size: trigger will send a batch if number of events exceeds this value.
maxBytes : int64
Maximum batch size: trigger will send a batch if total size of events exceeds this value.
cutoff : google.protobuf.Duration
Maximum batch size: trigger will send a batch if its lifetime exceeds this value.