跳到主要内容

生成 Storage Integration 授权材料 (V2)

This operation generates provider-specific authorization materials that are required before creating or validating a storage integration.

POST/v2/storageIntegrations/authorizationMaterials
连接端点

该 API 的 Base URL 格式如下:

https://${CLUSTER_ENDPOINT}

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

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

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

项目 ID。

regionIdstring必填项

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

bucketNamestring必填项

用于生成策略或凭证的 bucket、容器或存储名称。

export TOKEN="db_admin:xxxxxxxxxxxxx"

curl --request POST \
--url "${CLUSTER_ENDPOINT}/v2/storageIntegrations/authorizationMaterials" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"projectId": "proj-xxxxxxxxxxxxxxxxxxxxxx",
"regionId": "aws-cn-northwest-1",
"bucketName": "my-bucket"
}'
export TOKEN="db_admin:xxxxxxxxxxxxx"

curl --request POST \
--url "${CLUSTER_ENDPOINT}/v2/storageIntegrations/authorizationMaterials" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"projectId": "proj-xxxxxxxxxxxxxxxxxxxxxx",
"regionId": "ali-cn-hangzhou",
"bucketName": "my-oss-bucket"
}'
响应200 - application/json

AWS S3 成功响应。

codeinteger

响应码。

示例值:0
dataobject
readonlystring

只读 AWS S3 策略。可能的值为 s3:GetObjects3:ListBuckets3:GetBucketLocation

readwritestring

读写 AWS S3 策略。可能的值为 s3:GetObjects3:ListBuckets3:GetBucketLocations3:PutObject

iamPolicystring

创建流程使用的 AWS IAM 策略。可能的值为 s3:GetObjects3:ListBuckets3:GetBucketLocations3:PutObject

trustPolicystring

云厂商信任策略。

zillizAccountstring

需要授权的 Zilliz 云账号或 RAM 主体。

externalIdstring

生成的 external ID。

GCP GCS 成功响应。

codeinteger

响应码。

示例值:0
dataobject
permissionarray

需要授予的 GCP bucket 权限。

[]permissionstring
(待补充)
googleCloudServiceAccountstring

Zilliz 托管的 Google Cloud 服务账号邮箱。

Azure Blob 成功响应。

codeinteger

响应码。

示例值:0
dataobject
credentialobject

Azure 授权凭证信息。

clusterIssuerUrlstring

Azure 联合身份使用的集群 issuer URL。

namespacestring

Zilliz 服务账号所在的 Kubernetes 命名空间。

serviceAccountNamestring

Zilliz 服务账号名称。

Alibaba Cloud OSS 成功响应。

codeinteger

响应码。

示例值:0
dataobject
readonlystring

只读阿里云 OSS 策略。可能的值为 oss:GetObjectoss:ListObjectsoss:GetBucketLocationoss:HeadBucket

readwritestring

读写阿里云 OSS 策略。可能的值为 oss:GetObjectoss:ListObjectsoss:GetBucketLocationoss:HeadBucketoss:PutObject

ramPolicystring

创建流程使用的阿里云 RAM 策略。可能的值为 oss:GetObjectoss:ListObjectsoss:GetBucketLocationoss:HeadBucketoss:PutObject

trustPolicystring

云厂商信任策略。

zillizAccountstring

需要授权的 Zilliz 云账号或 RAM 主体。

externalIdstring

生成的 external ID。

失败响应。

codeinteger

响应码。

示例值:1800
messagestring

错误信息。

示例值:User hasn't authenticated
{
"code": 0,
"data": {
"readonly": "{...}",
"readwrite": "{...}",
"iamPolicy": "{...}",
"trustPolicy": "{...}",
"zillizAccount": "306787409409",
"externalId": "zilliz-external-AbCdEf12345678"
}
}