TestEventPattern

更新时间:
复制 MD 格式

Tests if an event pattern matches a given event.

Operation description

Use this action to test an event pattern before you apply it to a rule.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

Event

string

Yes

The event to test, which must be a JSON string.

{ "datacontenttype": "application/json;charset=utf-8", "aliyunaccountid": "*****", "aliyunpublishtime": "2023-04-****:54:57.939Z", "data": { "resourceEventType": "****", "resourceCreateTime": "****", "resourceId": "sls-code-***-debug", "captureTime": "***" }, "aliyunoriginalaccountid": "****", "specversion": "1.0", "aliyuneventbusname": "****", "id": "295e6bd2-bb72-4f70-****-204a0680ee41", "source": "acs.sls", "time": "2023-04-***:37:56Z", "aliyunregionid": "cn-***", "type": "sls:Config:****" }

EventPattern

string

Yes

The event pattern to test, which must be a JSON string.

{"key1": "value1"}

Response elements

Element

Type

Description

Example

object

The response object.

RequestId

string

The request ID.

96D7C0AB-DCE5-5E82-96B8-4725E1706BB1

Message

string

The error message.

Code

string

The return code. Success indicates that the call was successful. For more information about other return codes, see Error codes.

Success

Success

boolean

Indicates if the request was successful.

true

Data

object

The result of the test.

Result

boolean

Indicates if the event matches the event pattern.

true

Examples

Success response

JSON format

{
  "RequestId": "96D7C0AB-DCE5-5E82-96B8-4725E1706BB1",
  "Message": "",
  "Code": "Success",
  "Success": true,
  "Data": {
    "Result": true
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.