All Products
Search
Document Center

Function Compute:RegisterEventSource

Last Updated:Jun 02, 2023

Registers an event source.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /2021-04-06/services/{serviceName}/functions/{functionName}/event-sources

Request parameters

ParameterTypeRequiredDescriptionExample
serviceNamestringYes

The name of the function.

demo-service
functionNamestringYes

The ARN of the event source.

demo-function
qualifierstringNo

asdf****

LATEST
bodyobjectNo

Example 1

sourceArnstringYes

{"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-IdstringNo

Jianyi

188077086902****

Response parameters

ParameterTypeDescriptionExample
object

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
2021-10-26The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: X-Fc-Account-Id
    Added Input Parameters: X-Fc-Code-Checksum
    Added Input Parameters: X-Fc-Log-Type
    Added Input Parameters: X-Fc-Invocation-Type
    Added Input Parameters: X-Fc-Date
    Added Input Parameters: X-Fc-Trace-Id
2021-10-26The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: X-Fc-Account-Id
2021-10-26The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    delete Input Parameters: X-Fc-Account-Id