The documentation you are viewing is for Dapr v1.8 which is an older version of Dapr. For up-to-date documentation, see the latest version.

Alibaba Cloud Object Storage Service binding spec

Detailed documentation on the Alibaba Cloud Object Storage binding component

Component format

To setup an Alibaba Cloud Object Storage binding create a component of type bindings.alicloud.oss. See this guide on how to create and apply a secretstore configuration. See this guide on referencing secrets to retrieve and use the secret with Dapr components.

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: alicloudobjectstorage
spec:
  type: bindings.alicloud.oss
  version: v1
  metadata:
  - name: endpoint
    value: "[endpoint]"
  - name: accessKeyID
    value: "[key-id]"
  - name: accessKey
    value: "[access-key]"
  - name: bucket
    value: "[bucket]"

Spec metadata fields

Field Required Binding support Details Example
endpoint Y Output Alicloud OSS endpoint. https://oss-cn-hangzhou.aliyuncs.com
accessKeyID Y Output Access key ID credential.
accessKey Y Output Access key credential.
bucket Y Output Name of the storage bucket.

Binding support

This component supports output binding with the following operations:

Create object

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

{
  "operation": "create",
  "data": "YOUR_CONTENT"
}

Example

Saving to a random generated UUID file


curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\" }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>

curl -d '{ "operation": "create", "data": "Hello World" }' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>

Saving to a specific file


curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\", \"metadata\": { \"key\": \"my-key\" } }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>

curl -d '{ "operation": "create", "data": "Hello World", "metadata": { "key": "my-key" } }' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>

Metadata information

Object key

By default, the Alicloud OSS output binding will auto-generate a UUID as the object key. You can set the key with the following metadata:

{
    "data": "file content",
    "metadata": {
        "key": "my-key"
    },
    "operation": "create"
}