跳到主要内容

创建 API Key (V2)

Creates a customized ACL API key and assigns its complete initial role set. The secret is returned only once.

POST/v2/api-keys
连接端点

该 API 的 Base URL 格式如下:

https://api.cloud.zilliz.com

📘说明

控制面接口速率限制为单用户单接口每秒最多 20 个请求。

shell
export BASE_URL="https://api.cloud.zilliz.com"
参数
Authorizationstringheader必填项

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

示例值:Bearer {{TOKEN}}
请求体
namestring必填项

API Key 显示名称,不得为空。

descriptionstring

API Key 描述。

orgRolestring必填项

授予 API Key 的组织角色:Owner、Member 或 Billing-Admin。

projectsarray

项目级访问列表。当 orgRole 为 Member 时必填。

[]projectsobject
projectIdstring必填项

项目 ID。

rolestring必填项

项目内角色:Admin、Read-Write 或 Read-Only。

allClusterboolean

访问权限是否覆盖项目内的所有集群。

clusterIdsarray

当 allCluster 为 false 时,API Key 可访问的集群列表。

[]clusterIdsstring
(待补充)
allVolumeboolean

访问权限是否覆盖项目内的所有存储卷。

volumeIdsarray

当 allVolume 为 false 时,API Key 可访问的存储卷列表。

[]volumeIdsstring
(待补充)
Create An API Keybash
export TOKEN="YOUR_API_KEY"

curl --request POST \
--url "${BASE_URL}/v2/api-keys" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"name": "Data Pipeline",
"description": "API key used by the ingestion pipeline",
"orgRole": "Member",
"projects": [
{
"projectId": "proj-xxxxxxxx",
"role": "Data Reader",
"allCluster": true,
"allVolume": true
}
]
}'
响应

Returns a successful result or an error message.

成功响应。

codeinteger必填项

响应码。

示例值:0
dataobject必填项

新创建的 API Key ID 及其仅返回一次的密钥。

apiKeyIdstring必填项

公开 API Key ID。

apiKeystring必填项

密钥凭据,仅返回一次。

失败响应。

codeinteger必填项

响应码。

messagestring必填项

错误消息。

Successjson
{
"code": 0,
"data": {
"apiKeyId": "key-xxxxxxxxxxxxxx",
"apiKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
Ctrl I