EventRouter Service, REST: Rule.Create
- HTTP request
- Body parameters
- Filter
- Target
- YdsTarget
- YmqTarget
- FunctionTarget
- BatchSettings
- ContainerTarget
- GatewayWebsocketBroadcastTarget
- LoggingTarget
- WorkflowTarget
- Transformer
- RetrySettings
- PutQueueMessage
- Response
- CreateRuleMetadata
- Status
- Rule
- Filter
- Target
- YdsTarget
- YmqTarget
- FunctionTarget
- BatchSettings
- ContainerTarget
- GatewayWebsocketBroadcastTarget
- LoggingTarget
- WorkflowTarget
- Transformer
- RetrySettings
- PutQueueMessage
Creates a rule in the specified folder.
HTTP request
POST https://serverless-eventrouter.api.cloud.yandex.net/eventrouter/v1/rules
Body parameters
{
"busId": "string",
"name": "string",
"description": "string",
"labels": "string",
"filter": {
// Includes only one of the fields `jqFilter`
"jqFilter": "string"
// end of the list of possible fields
},
"targets": [
{
// Includes only one of the fields `yds`, `ymq`, `function`, `container`, `gatewayWsBroadcast`, `logging`, `workflow`
"yds": {
"database": "string",
"streamName": "string",
"serviceAccountId": "string"
},
"ymq": {
"queueArn": "string",
"serviceAccountId": "string"
},
"function": {
"functionId": "string",
"functionTag": "string",
"serviceAccountId": "string",
"batchSettings": {
"maxCount": "string",
"maxBytes": "string",
"cutoff": "string"
}
},
"container": {
"containerId": "string",
"containerRevisionId": "string",
"path": "string",
"serviceAccountId": "string",
"batchSettings": {
"maxCount": "string",
"maxBytes": "string",
"cutoff": "string"
}
},
"gatewayWsBroadcast": {
"gatewayId": "string",
"path": "string",
"serviceAccountId": "string",
"batchSettings": {
"maxCount": "string",
"maxBytes": "string",
"cutoff": "string"
}
},
"logging": {
// Includes only one of the fields `logGroupId`, `folderId`
"logGroupId": "string",
"folderId": "string",
// end of the list of possible fields
"serviceAccountId": "string"
},
"workflow": {
"workflowId": "string",
"serviceAccountId": "string",
"batchSettings": {
"maxCount": "string",
"maxBytes": "string",
"cutoff": "string"
}
},
// end of the list of possible fields
"transformer": {
// Includes only one of the fields `jqTransformer`
"jqTransformer": "string"
// end of the list of possible fields
},
"retrySettings": {
"retryAttempts": "string",
"maximumAge": "string"
},
// Includes only one of the fields `deadLetterQueue`
"deadLetterQueue": {
"queueArn": "string",
"serviceAccountId": "string"
},
// end of the list of possible fields
"status": "string"
}
],
"deletionProtection": "boolean"
}
Field |
Description |
busId |
string Required field. ID of the bus to create a rule for. |
name |
string Name of the rule. |
description |
string Description of the rule. |
labels |
string Labels for the rule. |
filter |
Filter for the rule. |
targets[] |
Targets for the rule. |
deletionProtection |
boolean Flag that disallow deletion of the rule. |
Filter
Field |
Description |
jqFilter |
string JQ filter for matching events. Includes only one of the fields |
Target
Field |
Description |
yds |
Includes only one of the fields |
ymq |
Includes only one of the fields |
function |
Includes only one of the fields |
container |
Includes only one of the fields |
gatewayWsBroadcast |
GatewayWebsocketBroadcastTarget Includes only one of the fields |
logging |
Includes only one of the fields |
workflow |
Includes only one of the fields |
transformer |
Transformer of the target. |
retrySettings |
Retry settings of the target. |
deadLetterQueue |
Dead letter queue. Includes only one of the fields Dead letter settings of the target. |
status |
enum (Status) Status of the target.
|
YdsTarget
Field |
Description |
database |
string Required field. Stream database. |
streamName |
string Required field. Full stream name, like /ru-central1/aoegtvhtp8ob********/cc8004q4lbo6********/test. |
serviceAccountId |
string Required field. Service account, which has write permission on the stream. |
YmqTarget
Field |
Description |
queueArn |
string Required field. Queue ARN. |
serviceAccountId |
string Required field. Service account which has write access to the queue. |
FunctionTarget
Field |
Description |
functionId |
string Required field. Function ID. |
functionTag |
string Function tag, optional. |
serviceAccountId |
string Service account which has call permission on the function, optional. |
batchSettings |
Batch settings. |
BatchSettings
Field |
Description |
maxCount |
string (int64) Maximum batch size: trigger will send a batch if number of events exceeds this value. |
maxBytes |
string (int64) Maximum batch size: trigger will send a batch if total size of events exceeds this value. |
cutoff |
string (duration) Required field. Maximum batch size: trigger will send a batch if its lifetime exceeds this value. |
ContainerTarget
Field |
Description |
containerId |
string Required field. 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 |
Batch settings. |
GatewayWebsocketBroadcastTarget
Field |
Description |
gatewayId |
string Required field. Gateway ID. |
path |
string Required field. Path. |
serviceAccountId |
string Required field. Service account which has permission for writing to websockets. |
batchSettings |
Batch settings. |
LoggingTarget
Field |
Description |
logGroupId |
string Includes only one of the fields Log group ID or folder ID. |
folderId |
string Includes only one of the fields Log group ID or folder ID. |
serviceAccountId |
string Required field. Service account which has permission for writing logs. |
WorkflowTarget
Field |
Description |
workflowId |
string Required field. Workflow ID. |
serviceAccountId |
string Required field. SA which should be used to start workflow. |
batchSettings |
Batch settings. |
Transformer
Field |
Description |
jqTransformer |
string JQ string inrerpolation expression for changing event format. Includes only one of the fields |
RetrySettings
Field |
Description |
retryAttempts |
string (int64) Maximum number of retries (extra calls) before an action fails. |
maximumAge |
string (duration) Event goes to dlq when its age exceeds this value. Default is 24h. |
PutQueueMessage
Field |
Description |
queueArn |
string ID of the queue. |
serviceAccountId |
string Required field. Service account which has write permission on the queue. |
Response
HTTP Code: 200 - OK
{
"id": "string",
"description": "string",
"createdAt": "string",
"createdBy": "string",
"modifiedAt": "string",
"done": "boolean",
"metadata": {
"ruleId": "string",
"busId": "string"
},
// Includes only one of the fields `error`, `response`
"error": {
"code": "integer",
"message": "string",
"details": [
"object"
]
},
"response": {
"id": "string",
"busId": "string",
"folderId": "string",
"cloudId": "string",
"createdAt": "string",
"name": "string",
"description": "string",
"labels": "string",
"filter": {
// Includes only one of the fields `jqFilter`
"jqFilter": "string"
// end of the list of possible fields
},
"targets": [
{
// Includes only one of the fields `yds`, `ymq`, `function`, `container`, `gatewayWsBroadcast`, `logging`, `workflow`
"yds": {
"database": "string",
"streamName": "string",
"serviceAccountId": "string"
},
"ymq": {
"queueArn": "string",
"serviceAccountId": "string"
},
"function": {
"functionId": "string",
"functionTag": "string",
"serviceAccountId": "string",
"batchSettings": {
"maxCount": "string",
"maxBytes": "string",
"cutoff": "string"
}
},
"container": {
"containerId": "string",
"containerRevisionId": "string",
"path": "string",
"serviceAccountId": "string",
"batchSettings": {
"maxCount": "string",
"maxBytes": "string",
"cutoff": "string"
}
},
"gatewayWsBroadcast": {
"gatewayId": "string",
"path": "string",
"serviceAccountId": "string",
"batchSettings": {
"maxCount": "string",
"maxBytes": "string",
"cutoff": "string"
}
},
"logging": {
// Includes only one of the fields `logGroupId`, `folderId`
"logGroupId": "string",
"folderId": "string",
// end of the list of possible fields
"serviceAccountId": "string"
},
"workflow": {
"workflowId": "string",
"serviceAccountId": "string",
"batchSettings": {
"maxCount": "string",
"maxBytes": "string",
"cutoff": "string"
}
},
// end of the list of possible fields
"transformer": {
// Includes only one of the fields `jqTransformer`
"jqTransformer": "string"
// end of the list of possible fields
},
"retrySettings": {
"retryAttempts": "string",
"maximumAge": "string"
},
// Includes only one of the fields `deadLetterQueue`
"deadLetterQueue": {
"queueArn": "string",
"serviceAccountId": "string"
},
// end of the list of possible fields
"status": "string"
}
],
"deletionProtection": "boolean",
"status": "string"
}
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
Field |
Description |
id |
string ID of the operation. |
description |
string Description of the operation. 0-256 characters long. |
createdAt |
string (date-time) Creation timestamp. String in RFC3339 To work with values in this field, use the APIs described in the |
createdBy |
string ID of the user or service account who initiated the operation. |
modifiedAt |
string (date-time) The time when the Operation resource was last modified. String in RFC3339 To work with values in this field, use the APIs described in the |
done |
boolean If the value is |
metadata |
Service-specific metadata associated with the operation. |
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
response |
The normal response of the operation in case of success. Includes only one of the fields The operation result. |
CreateRuleMetadata
Field |
Description |
ruleId |
string ID of the rule that is being created. |
busId |
string ID of the bus that the rule belongs to. |
Status
The error result of the operation in case of failure or cancellation.
Field |
Description |
code |
integer (int32) Error code. An enum value of google.rpc.Code |
message |
string An error message. |
details[] |
object A list of messages that carry the error details. |
Rule
Field |
Description |
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 |
string (date-time) Creation timestamp. String in RFC3339 To work with values in this field, use the APIs described in the |
name |
string Name of the rule. |
description |
string Description of the rule. |
labels |
string Resource labels as |
filter |
Filter for the rule. |
targets[] |
Targets of the rule. |
deletionProtection |
boolean Flag that disallow deletion of the rule. |
status |
enum (Status) Rule status
|
Filter
Field |
Description |
jqFilter |
string JQ filter for matching events. Includes only one of the fields |
Target
Field |
Description |
yds |
Includes only one of the fields |
ymq |
Includes only one of the fields |
function |
Includes only one of the fields |
container |
Includes only one of the fields |
gatewayWsBroadcast |
GatewayWebsocketBroadcastTarget Includes only one of the fields |
logging |
Includes only one of the fields |
workflow |
Includes only one of the fields |
transformer |
Transformer of the target. |
retrySettings |
Retry settings of the target. |
deadLetterQueue |
Dead letter queue. Includes only one of the fields Dead letter settings of the target. |
status |
enum (Status) Status of the target.
|
YdsTarget
Field |
Description |
database |
string Required field. Stream database. |
streamName |
string Required field. Full stream name, like /ru-central1/aoegtvhtp8ob********/cc8004q4lbo6********/test. |
serviceAccountId |
string Required field. Service account, which has write permission on the stream. |
YmqTarget
Field |
Description |
queueArn |
string Required field. Queue ARN. |
serviceAccountId |
string Required field. Service account which has write access to the queue. |
FunctionTarget
Field |
Description |
functionId |
string Required field. Function ID. |
functionTag |
string Function tag, optional. |
serviceAccountId |
string Service account which has call permission on the function, optional. |
batchSettings |
Batch settings. |
BatchSettings
Field |
Description |
maxCount |
string (int64) Maximum batch size: trigger will send a batch if number of events exceeds this value. |
maxBytes |
string (int64) Maximum batch size: trigger will send a batch if total size of events exceeds this value. |
cutoff |
string (duration) Required field. Maximum batch size: trigger will send a batch if its lifetime exceeds this value. |
ContainerTarget
Field |
Description |
containerId |
string Required field. 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 |
Batch settings. |
GatewayWebsocketBroadcastTarget
Field |
Description |
gatewayId |
string Required field. Gateway ID. |
path |
string Required field. Path. |
serviceAccountId |
string Required field. Service account which has permission for writing to websockets. |
batchSettings |
Batch settings. |
LoggingTarget
Field |
Description |
logGroupId |
string Includes only one of the fields Log group ID or folder ID. |
folderId |
string Includes only one of the fields Log group ID or folder ID. |
serviceAccountId |
string Required field. Service account which has permission for writing logs. |
WorkflowTarget
Field |
Description |
workflowId |
string Required field. Workflow ID. |
serviceAccountId |
string Required field. SA which should be used to start workflow. |
batchSettings |
Batch settings. |
Transformer
Field |
Description |
jqTransformer |
string JQ string inrerpolation expression for changing event format. Includes only one of the fields |
RetrySettings
Field |
Description |
retryAttempts |
string (int64) Maximum number of retries (extra calls) before an action fails. |
maximumAge |
string (duration) Event goes to dlq when its age exceeds this value. Default is 24h. |
PutQueueMessage
Field |
Description |
queueArn |
string ID of the queue. |
serviceAccountId |
string Required field. Service account which has write permission on the queue. |