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

阿里云 Tablestore 绑定规范

有关阿里云 Tablestore 绑定组件的详细文档

配置

要设置阿里云 Tablestore 绑定,需要创建一个类型为 bindings.alicloud.tablestore 的组件。 看本指南如何创建和应用秘钥配置。 通过引用 Secrets 这个指南可以看到如何在 Dapr 组件中检索和使用 Secret。

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: mytablestore
  namespace: default
spec:
  type: bindings.alicloud.tablestore
  version: v1
  metadata:
  - name: endpoint
    value: "[endpoint]"
  - name: accessKeyID
    value: "[key-id]"
  - name: accessKey
    value: "[access-key]"
  - name: instanceName
    value: "[instance]"
  - name: tableName
    value: "[table]"
  - name: endpoint
    value: "[endpoint]"

元数据字段规范

字段 必填 绑定支持 详情 示例
终结点 Y 输出 阿里云 Tablestore endpoint。 https://tablestore-cn-hangzhou.aliyuncs.com
accessKeyID Y 输出 访问密钥 ID 凭据。
accessKey Y 输出 访问密钥凭据。
instanceName Y 输出 实例的名称。
tableName Y 输出 表的名称。

绑定支持

字段名为 ttlInSeconds

创建对象

要执行创建对象操作,请使用 POST 方法和以下 JSON 调用绑定:

{
  "operation": "create",
  "data": "YOUR_CONTENT",
  "metadata": {
    "primaryKeys": "pk1"
  }
} 

删除对象

要执行删除对象操作,请使用 POST 方法和以下 JSON 调用绑定:

{
  "operation": "delete",
  "metadata": {
   "primaryKeys": "pk1",
   "columnToGet": "name,age,date"
  },
  "data": {
    "pk1": "data1"
  }
} 

列出对象

要执行列出对象操作,请使用 POST 和以下 JSON 调用绑定:

{
  "operation": "delete",
  "metadata": {
    "primaryKeys": "pk1",
    "columnToGet": "name,age,date"
  },
  "data": {
    "pk1": "data1",
    "pk2": "data2"
  }
} 

获取对象

要执行获取对象操作,请使用 POST 方法和以下 JSON 调用绑定:

{
  "operation": "delete",
  "metadata": {
    "primaryKeys": "pk1"
  },
  "data": {
    "pk1": "data1"
  }
} 

相关链接