Alibaba Cloud Log Storage Service binding spec
Detailed documentation on the Alibaba Cloud Log Storage binding component
Component format
To setup an Alibaba Cloud SLS binding create a component of type bindings.alicloud.sls
. See this guide on how to create and apply a binding configuration.
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: alicloud.sls
spec:
type: bindings.alicloud.sls
version: v1
metadata:
- name: AccessKeyID
value: "[accessKey-id]"
- name: AccessKeySecret
value: "[accessKey-secret]"
- name: Endpoint
value: "[endpoint]"
Spec metadata fields
Field | Required | Binding support | Details | Example |
---|---|---|---|---|
AccessKeyID |
Y | Output | Access key ID credential. | |
AccessKeySecret |
Y | Output | Access key credential secret | |
Endpoint |
Y | Output | Alicloud SLS endpoint. |
Binding support
This component supports output binding with the following operations:
create
: Create object
Request format
To perform a log store operation, invoke the binding with a POST
method and the following JSON body:
{
"metadata":{
"project":"your-sls-project-name",
"logstore":"your-sls-logstore-name",
"topic":"your-sls-topic-name",
"source":"your-sls-source"
},
"data":{
"custome-log-filed":"any other log info"
},
"operation":"create"
}
Note
Note, the value of “project”,“logstore”,“topic” and “source” property should provide in the metadata properties.Example
curl -X POST -H "Content-Type: application/json" -d "{\"metadata\":{\"project\":\"project-name\",\"logstore\":\"logstore-name\",\"topic\":\"topic-name\",\"source\":\"source-name\"},\"data\":{\"log-filed\":\"log info\"}" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
curl -X POST -H "Content-Type: application/json" -d '{"metadata":{"project":"project-name","logstore":"logstore-name","topic":"topic-name","source":"source-name"},"data":{"log-filed":"log info"}' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
Response format
As Alibaba Cloud SLS producer API is asynchronous, there is no response for this binding (there is no callback interface to accept the response of success or failure, only a record for failure any reason to the console log).
Related links
- Bindings building block
- How-To: Trigger application with input binding
- How-To: Use bindings to interface with external resources
- Bindings API reference
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified December 18, 2024: Merge pull request #4461 from dapr/dependabot/npm_and_yarn/daprdocs/nanoid-3.3.8 (5660a64)