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.

  1. apiVersion: dapr.io/v1alpha1
  2. kind: Component
  3. metadata:
  4. name: alicloud.sls
  5. spec:
  6. type: bindings.alicloud.sls
  7. version: v1
  8. metadata:
  9. - name: AccessKeyID
  10. value: "[accessKey-id]"
  11. - name: AccessKeySecret
  12. value: "[accessKey-secret]"
  13. - name: Endpoint
  14. value: "[endpoint]"

Spec metadata fields

FieldRequiredBinding supportDetailsExample
AccessKeyIDYOutputAccess key ID credential.
AccessKeySecretYOutputAccess key credential secret
EndpointYOutputAlicloud SLS endpoint.

Binding support

This component supports output binding with the following operations:

Request format

To perform a log store operation, invoke the binding with a POST method and the following JSON body:

  1. {
  2. "metadata":{
  3. "project":"your-sls-project-name",
  4. "logstore":"your-sls-logstore-name",
  5. "topic":"your-sls-topic-name",
  6. "source":"your-sls-source"
  7. },
  8. "data":{
  9. "custome-log-filed":"any other log info"
  10. },
  11. "operation":"create"
  12. }

Note

Note, the value of “project”,“logstore”,“topic” and “source” property should provide in the metadata properties.

Example

  1. 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>
  1. 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).

Last modified October 5, 2022: Add Alicloud SLS output binding docs (#2711) (d1ad33ce)