跳到主要内容

创建 Storage Integration (V2)

This operation creates a bucket storage integration after validating that the supplied credential can access the target bucket or container.

POST/v2/storageIntegrations
连接端点

该 API 的 Base URL 格式如下:

https://${CLUSTER_ENDPOINT}

📘说明
  • 你需要填入您的 Zilliz Cloud 集群的 ${CLUSTER_ENDPOINT}
  • 您可以使用 查看集群详情 V2 来获取集群的 Endpoint.
export CLUSTER_ENDPOINT=""
参数
Authorizationstringheaderrequired

认证令牌,应为具备适当权限的 API 密钥。

示例值:Bearer {{TOKEN}}
请求体application/json
projectIdstring必填项

项目 ID。

namestring必填项

Storage Integration 名称。

descriptionstring

Storage Integration 描述。

regionIdstring必填项

地域 ID。服务器会根据该字段推断云厂商。

bucketNamestring必填项

Bucket、容器或存储名称。对于 Azure Blob Storage,该字段表示容器名称。

externalCredobject

云厂商相关的凭证字段。

roleArnstring

AWS IAM 角色 ARN。

externalIdstring

AWS 角色扮演使用的 external ID。

projectIdstring必填项

项目 ID。

namestring必填项

Storage Integration 名称。

descriptionstring

Storage Integration 描述。

regionIdstring必填项

地域 ID。服务器会根据该字段推断云厂商。

bucketNamestring必填项

Bucket、容器或存储名称。对于 Azure Blob Storage,该字段表示容器名称。

externalCredobject

云厂商相关的凭证字段。

gcpProjectIdstring

用户侧 GCP 项目 ID。

serviceAccountEmailstring

用户创建的 GCP 服务账号邮箱,用于授予 bucket 访问权限。

projectIdstring必填项

项目 ID。

namestring必填项

Storage Integration 名称。

descriptionstring

Storage Integration 描述。

regionIdstring必填项

地域 ID。服务器会根据该字段推断云厂商。

bucketNamestring必填项

Bucket、容器或存储名称。对于 Azure Blob Storage,该字段表示容器名称。

externalCredobject

云厂商相关的凭证字段。

accountNamestring

Azure 存储账号名称。

clientIdstring

Azure 联合身份客户端 ID。

tenantIdstring

Azure 联合身份租户 ID。

projectIdstring必填项

项目 ID。

namestring必填项

Storage Integration 名称。

descriptionstring

Storage Integration 描述。

regionIdstring必填项

地域 ID。服务器会根据该字段推断云厂商。

bucketNamestring必填项

Bucket、容器或存储名称。对于 Azure Blob Storage,该字段表示容器名称。

externalCredobject

云厂商相关的凭证字段。

roleArnstring

AWS IAM 角色 ARN。

externalIdstring

AWS 角色扮演使用的 external ID。

export TOKEN="db_admin:xxxxxxxxxxxxx"

curl --request POST \
--url "${CLUSTER_ENDPOINT}/v2/storageIntegrations" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"projectId": "proj-xxxxxxxxxxxxxxxxxxxxxx",
"name": "analytics-s3",
"description": "S3 bucket for external tables",
"regionId": "aws-cn-northwest-1",
"bucketName": "my-bucket",
"externalCred": {
"roleArn": "arn:aws:iam::123456789012:role/zilliz-bucket-role",
"externalId": "zilliz-external-AbCdEf12345678"
}
}'
响应200 - application/json

成功响应。

codeinteger

响应码。

示例值:0
dataobject
integrationIdstring

Storage Integration ID。

namestring

Storage Integration 名称。

失败响应。

codeinteger

响应码。

示例值:1800
messagestring

错误信息。

示例值:User hasn't authenticated
{
"code": 0,
"data": {
"integrationId": "integ-xxxxxxxxxxxxxxxxxxx",
"name": "analytics-oss"
}
}
{
"code": 1800,
"message": "User hasn't authenticated"
}