Registers an event source.
Authorization information
Request syntax
POST /2021-04-06/services/{serviceName}/functions/{functionName}/event-sources
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
serviceName | string | Yes | The name of the function. | demo-service |
functionName | string | Yes | The ARN of the event source. | demo-function |
qualifier | string | No | asdf**** | LATEST |
body | object | No | Example 1 | |
sourceArn | string | Yes | {"name":"RegisterEventSource","product":"FC-Open","version":"2021-04-06","path":"/2021-04-06/services/{serviceName}/functions/{functionName}/event-sources","deprecated":0,"method":"POST","protocol":"HTTP|HTTPS","hidden":0,"timeout":10000,"parameter_type":"Single","params":"[{"name":"serviceName","position":"Path","required":true,"checkBlank":false,"visibility":"Public","deprecated":false,"type":"String","title":"The name of the service.","description":"The name of the service. ","example":"demo-service"},{"name":"functionName","position":"Path","required":true,"checkBlank":false,"visibility":"Public","deprecated":false,"type":"String","title":"The name of the function.","description":"The name of the function. ","example":"demo-function"},{"name":"qualifier","position":"Query","required":false,"checkBlank":false,"visibility":"Public","deprecated":false,"type":"String","title":"The version or alias of the service.","description":"The version or alias of the service. ","example":"LATEST"},{"name":"body","position":"Body","style":"json","required":false,"checkBlank":false,"visibility":"Public","deprecated":false,"type":"Object","params":[{"name":"sourceArn","required":false,"checkBlank":false,"visibility":"Public","deprecated":false,"type":"String","title":"The Alibaba Cloud Resource Name (ARN) of the event source.","description":"The Alibaba Cloud Resource Name (ARN) of the event source.","example":"acs:eventbridge:cn-shanghai:123456:eventbus/mns-test/rule/fc-test1/target/abc"}],"description":"The body of the request. "},{"name":"X-Fc-Account-Id","position":"Header","required":false,"checkBlank":false,"visibility":"Public","deprecated":false,"type":"String","description":"The ID of your Alibaba Cloud account. ","example":"188077086902****"},{"name":"X-Fc-Date","position":"Header","required":false,"checkBlank":false,"visibility":"Public","deprecated":false,"type":"String","description":"The time when Function Compute API is called. ","example":"Sat, 14 Jul 2017 07:02:38 GMT"},{"name":"X-Fc-Trace-Id","position":"Header","required":false,"checkBlank":false,"visibility":"Public","deprecated":false,"type":"String","description":"The trace ID of the invocation request of Function Compute. ","example":"asdf****"}]","response_headers":"[]","response":"{"type":"Object","children":[{"name":"sourceArn","required":false,"checkBlank":false,"visibility":"Public","deprecated":false,"type":"String","title":"The Alibaba Cloud Resource Name (ARN) of the event source.","description":"The ARN of the event source. ","example":"acs:eventbridge:cn-shanghai:123456:eventbus/mns-test/rule/fc-test1/target/abc"},{"name":"createdTime","required":false,"checkBlank":false,"visibility":"Public","deprecated":false,"type":"String","title":"The creation time.","description":"The time when the event source was created. ","example":"2016-08-15T16:06:05.000+0000"}],"title":"Schema of Response","description":"The returned data. "}","body_style":"json","errors":"{}"} | acs:eventbridge:cn-shanghai:123456:eventbus/mns-test/rule/fc-test1/target/abc |
X-Fc-Account-Id | string | No | Jianyi | 188077086902**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"sourceArn": "acs:eventbridge:cn-shanghai:123456:eventbus/mns-test/rule/fc-test1/target/abc",
"createdTime": "2016-08-15T16:06:05.000+0000"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2021-10-26 | The input parameters of the API operation change. | |||||||||||||||
| ||||||||||||||||
2021-10-26 | The input parameters of the API operation change. | |||||||||||||||
| ||||||||||||||||
2021-10-26 | The input parameters of the API operation change. | |||||||||||||||
|