校验 Storage Integration (V2)
This operation validates whether the supplied storage credential can access the target bucket or container without creating an integration record.
POST/v2/storageIntegrations/validate
该 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、容器或存储名称。
externalCredundefined
云厂商相关的凭证字段。
export TOKEN="db_admin:xxxxxxxxxxxxx"
curl --request POST \
--url "${CLUSTER_ENDPOINT}/v2/storageIntegrations/validate" \
--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",
"externalCred": {
"roleArn": "acs:ram::1234567890123456:role/zilliz-bucket-role",
"externalId": "zilliz-external-AbCdEf12345678"
}
}'
响应200 - application/json
成功响应。
codeinteger
响应码。
示例值:0
dataobject
successboolean
凭证是否可以访问目标存储。
messagestring
校验失败时的原因。校验成功时为空字符串。
失败响应。
codeinteger
响应码。
示例值:1800
messagestring
错误信息。
示例值:User hasn't authenticated
{
"code": 0,
"data": {
"success": true,
"message": ""
}
}
{
"code": 0,
"data": {
"success": false,
"message": "try assume role failed"
}
}
{
"code": 1800,
"message": "User hasn't authenticated"
}