撤销角色权限(V2) (V2)
This operation revokes a privilege from a role at the global, database, or collection level.
POST/v2/vectordb/roles/revoke_privilege_v2
该 API 的 Base URL 格式如下:
https://${CLUSTER_ENDPOINT}
📘说明
- 你需要填入您的 Zilliz Cloud 集群的
${CLUSTER_ENDPOINT}。 - 您可以使用 查看集群详情 V2 来获取集群的 Endpoint.
export CLUSTER_ENDPOINT=""
参数
Authorizationstringheaderrequired
认证令牌,应为具备适当权限的 API 密钥或用冒号分隔的用户名和密码,如 username:password。如果您使用的是项目端点,则仅具备足够权限的有效 API 密钥适用。
示例值:Bearer {{TOKEN}}
请求体application/json
roleNamestring必填项
角色名称。
privilegestring必填项
待授予或撤销的权限。
dbNamestring
权限适用的数据库名称。使用 * 表示所有数据库。
collectionNamestring
权限适用的 Collection 名称。使用 * 表示所有 Collection。
export TOKEN="db_admin:xxxxxxxxxxxxx"
curl --request POST \
--url "${CLUSTER_ENDPOINT}/v2/vectordb/roles/revoke_privilege_v2" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"roleName": "my_role",
"privilege": "Insert",
"dbName": "my_database",
"collectionName": "my_collection"
}'
响应200 - application/json
codeinteger
响应码。
dataobject
返回错误消息。
codeinteger
响应码。
messagestring
错误描述。
{
"code": 0,
"data": {}
}