跳到主要内容

修改 Database 属性 (V2)

This operation alters the properties of the specified database.

POST/v2/vectordb/databases/alter
连接端点

该 API 的 Base URL 格式如下:

https://{cluster-id}.{region}.vectordb.zilliz.com.cn:19530

📘说明
  • 如果您使用的是服务集群,请使用集群端点。
    • Free 与 Serverless 版

      https://{cluster-id}.serverless.{region}.vectordb.zillizcloud.com

    • Dedicated 版

      https://{cluster-id}.{region}.vectordb.zilliz.com.cn:19530

  • 你需要填入您的 Zilliz Cloud 集群的 ${CLUSTER_ENDPOINT}
  • 您可以使用 查看集群详情 V2 来获取集群的 Endpoint.
shell
export CLUSTER_ENDPOINT="https://{cluster-id}.{region}.vectordb.zilliz.com.cn:19530"
参数
Authorizationstringheader必填项

认证令牌,应为具备适当权限的 API 密钥或用冒号分隔的用户名和密码,如 username:password。如果您使用的是项目端点,则仅具备足够权限的有效 API 密钥适用。

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

要创建的新 Database 的名称。

propertiesobject必填项

以键值对的方式提供的要修改的属性。

database.replica.numberinteger

指定 Database 的副本数量。

database.resource_groupsstring

与指定 Database 关联的资源组名称,以逗号分隔的列表形式提供。

database.diskQuota.mbinteger

指定 Database 的磁盘空间最大容量,以兆字节 (MB) 为单位。

database.max.collectionsinteger

指定 Database 中允许的最大 Collection 数量。

database.force.deny.writingboolean

是否强制指定 Database 拒绝写入操作。

database.force.deny.readingboolean

是否强制指定 Database 拒绝读取操作。

database.force.deny.ddlboolean

是否强制指定 Database 拒绝所有 DDL 操作。

database.force.deny.collectionDDLboolean

是否强制指定 Database 拒绝 Collection DDL 操作。

database.force.deny.partitionDDLboolean

是否强制指定 Database 拒绝 Partition DDL 操作。

database.force.deny.indexboolean

是否强制指定 Database 拒绝 Index DDL 操作。

database.force.deny.flushboolean

是否强制指定 Database 拒绝 Flush DDL 操作。

database.force.deny.compactionboolean

是否强制指定 Database 拒绝 Compaction DDL 操作。

timezonestring

指定 Database 的 IANA 时区 ID。

cipher.enabledstring

是否为指定 Database 启用 CMEK 加密。可选值为 "true" 或 "false"。

cipher.keystring

指定 Database 的 CMEK 加密根密钥。

bash
export TOKEN="db_admin:xxxxxxxxxxxxx"

curl --request POST \
--url "${CLUSTER_ENDPOINT}/v2/vectordb/databases/alter" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"dbName": "my_database",
"properties": {
"database.replica.number": 2
}
}'
响应

返回空响应。

codeinteger

响应码。

dataobject

空响应。

返回错误消息。

codeinteger

响应码。

messagestring

错误描述。

Successjson
{
"code": 0,
"data": {}
}
Ctrl I