Admin API
Standard Nacos 3.x Admin APIs use the
/v3/admin/*path. The current version has removed v1/v2 Admin APIs. Use Nacos 3.x Admin APIs instead.If you still need v1/v2 Admin APIs temporarily during migration, read Compatibility and Deprecation first, and evaluate the legacy adapter approach described in the upgrading manual.
Nacos provides Admin APIs for administrators, operations platforms, release platforms, audit tools, and automation scripts. These APIs expose broader management capabilities than runtime client APIs, including range queries, resource management, server state inspection, and operational diagnostics.
0. Admin API Notes
0.1. Scope
Admin APIs are intended for management-plane callers. They are suitable for operations platforms, release platforms, audit tools, automation scripts, and administrators.
| Good Fit | Not a Good Fit |
|---|---|
| Publishing, deleting, importing, exporting, and querying configurations. | High-frequency runtime configuration reads from business applications. |
| Managing namespaces, services, instances, clusters, health state, and metadata. | Business applications registering their own instances or subscribing to downstream services. |
| Managing plugins, server state, AI resources, and operational diagnostics. | Page-level interactions for custom console UI. |
Business applications should prefer Java SDK, other language SDKs, or Client API. Custom console UI should prefer Console API.
0.2. Unified Path Format
Nacos Admin APIs use a unified path format: [/$nacos.server.contextPath]/v3/admin/[module]/[subPath]....
$nacos.server.contextPath: Root path of Admin APIs. The default value is/nacos, and it can be changed with thenacos.server.contextPathconfiguration item.module: Admin API module name, such asserver,cs,ns, orcore.subPath: Admin API subpath, such asstate,namespace, orconfig. It may contain multiple path levels.
The Admin APIs listed below use the default $nacos.server.contextPath. If the deployment changes $nacos.server.contextPath, update the request URL accordingly when calling the API.
The examples below also use the default Nacos Web Server port. If the deployment changes $nacos.server.main.port, update the request URL accordingly when calling the API.
0.3. Authentication
Nacos 3.X Admin APIs require authentication by default. When using the default auth plugin, use an administrator identity such as nacos.
To disable Admin API authentication, set nacos.core.auth.admin.enabled=false and restart Nacos Server.
0.4. Swagger Documentation
Nacos 3.X Admin APIs also provide Swagger-style documentation. You can view it at Nacos Swagger Admin API.
1. Nacos Core 运维 API
1.1. 获取当前节点连接
Description
通过该接口,可以获取连接到当前Nacos Server节点中的gRPC连接详情。
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/loader/current
Request Parameters
无
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
| ${connectionId} | object | 每条 gRPC connection ID. |
| ${connectionId}.abilityTable | object | Capability list supported by the gRPC connection, namely the client. |
| ${connectionId}.metaInfo.clientIp | string | Source IP of the gRPC connection. |
| ${connectionId}.metaInfo.localPort | integer | gRPC port of this Nacos Server. |
| ${connectionId}.metaInfo.version | string | Version of the gRPC connection, namely the client. |
| ${connectionId}.metaInfo.createTime | string | Creation time of the gRPC connection. |
| ${connectionId}.metaInfo.lastActiveTime | integer | Last heartbeat time of the gRPC connection. |
| ${connectionId}.metaInfo.labels.source | string | Module of the gRPC connection. Optional values are naming, config, and cluster, representing registry, configuration, and inter-cluster connections respectively. |
| ${connectionId}.metaInfo.clusterSource | boolean | Whether the gRPC connection is an inter-cluster connection. When true, ${connectionId}.metaInfo.labels.source is cluster. |
| ${connectionId}.metaInfo.sdkSource | boolean | Whether the gRPC connection comes from a client. When true, ${connectionId}.metaInfo.labels.source is naming or config. |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/loader/current'- Response example
{ "code": 0, "message": "success", "data": { "1741687438640_127.0.0.1_58856": { "abilityTable": { "fuzzyWatch": true, "lock": true }, "appLabels": { "AppName": "unknown", "ClientVersion": "Nacos-Java-Client:v3.0.0-BETA" }, "connected": true, "labels": { "AppName": "unknown", "module": "naming", "source": "sdk", "tls.enable": "false" }, "metaInfo": { "appLabels": { "AppName": "unknown", "ClientVersion": "Nacos-Java-Client:v3.0.0-BETA" }, "appName": "unknown", "clientIp": "30.221.148.39", "clusterSource": false, "connectType": "GRPC", "connectionId": "1741687438640_127.0.0.1_58856", "createTime": "2025-03-11T10:03:58.731+00:00", "labels": { "AppName": "unknown", "module": "naming", "source": "sdk", "tls.enable": "false" }, "lastActiveTime": 1741745293704, "localPort": 9848, "namespaceId": null, "remoteIp": "127.0.0.1", "remotePort": 58856, "sdkSource": true, "tag": null, "tlsProtected": false, "version": "Nacos-Java-Client:v3.0.0-BETA" }, "traced": false } }}1.2. 均衡指定数量的连接
Description
通过该接口,可以指定一定数量的连接到当前Nacos Server节点中的gRPC连接,将这部分连接断开后迁移到其他Nacos Server节点中。
Since
3.0.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/loader/reloadCurrent
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
count | integer | Yes | 需要均衡的连接个数 |
redirectAddress | string | No | 预期均衡的Nacos Server目标,仅提供给客户端参考。 |
Response Data
成功则返回success,失败则返回Nacos open API 统一返回体格式
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/core/loader/reloadCurrent' -d "count=100"- Response example
success1.3. 均衡指定的单个连接
Description
通过该接口,可以将指定的客户端连接(gRPC连接)迁移到其他Nacos Server节点中。
Since
3.0.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/loader/reloadClient
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
connectionId | string | Yes | 需要均衡的连接Id |
redirectAddress | string | No | 预期均衡的Nacos Server目标。 |
Response Data
成功则返回success,失败则返回Nacos open API 统一返回体格式
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/core/loader/reloadClient' -d "connectionId=1709273546779_127.0.0.1_35042"- Response example
成功则返回:
{ "code": 0, "message": "success", "data": null}失败则返回:
{ "code": 30000, "message": "server error", "data": null}1.4. 获取集群连接概览信息
Description
通过该接口,查看Nacos Server集群中各节点的连接数概览。
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/loader/cluster
Request Parameters
无
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
total | integer | 该集群中所有节点的连接数总和 |
min | integer | 该集群中所有节点的最小连接数 |
avg | integer | 该集群中所有节点的平均连接数 |
max | integer | 该集群中所有节点的最大连接数 |
memberCount | integer | 该集群中所有节点的个数 |
metricsCount | integer | 该集群中已统计到概览信息的节点个数 |
detail | array | Overview information of all nodes in the cluster. See the following fields. |
detail[].address | string | 节点地址 |
detail[].metric.load | number | 节点的负载率,主要对应节点的Load指标,参考值 |
detail[].metric.sdkConCount | integer | 连接到该节点的SDK连接数,主要对应客户端连接数 |
detail[].metric.conCount | integer | 连接到该节点的总连接数,包含了SDK和集群间的连接 |
detail[].metric.cpu | number | 节点的CPU使用率,参考值 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/loader/cluster'- Response example
{ "code": 0, "message": "success", "data": { "avg": 1, "completed": true, "detail": [ { "address": "127.0.0.1:8848", "conCount": 1, "cpu": "0.0", "load": "2.3842773", "sdkConCount": 1 } ], "max": 1, "memberCount": 1, "metricsCount": 1, "min": 1, "threshold": "1.1", "total": 1 }}1.5. 获取本节点信息
Description
通过该接口,可以获取Nacos Server集群当前节点的详细信息。
Since
3.0.0
Request Method
GET
Request URL
/nacos/v3/admin/core/cluster/node/self
Request Parameters
无
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
ip | string | 节点IP |
port | integer | 节点端口 |
state | string | Node state: UP/DOWN/SUSPICIOUS |
extendInfo | object | Extended node information. See the following fields. |
extendInfo.lastRefreshTime | integer | 节点上一次更新时间戳,单位毫秒 |
extendInfo.raftMetaData | object | Raft metadata of the node, including fields such as leader and term for each Raft Group. |
extendInfo.raftPort | integer | 节点的Raft端口 |
extendInfo.supportGrayModel | boolean | 是否支持灰度模型 |
extendInfo.version | string | 节点的版本 |
address | string | 节点地址,格式为ip:port |
failAccessCnt | integer | 探测失败的次数,及report失败的次数,超过一定次数state会被改为DOWN |
abilities | object | Capabilities supported by the node. |
grpcReportEnabled | boolean | 标记节点是否支持grpc上报心跳能力,用于适配老版本升级,后续将移除 |
boolean | 是否ready升级到Nacos2.0,于2.2版本后废弃,即将移除 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/cluster/node/self'- Response example
{ "code": 0, "data": { "abilities": { "configAbility": { "supportRemoteMetrics": false }, "namingAbility": { "supportJraft": true }, "remoteAbility": { "grpcReportEnabled": true, "supportRemoteConnection": true } }, "address": "127.0.0.1:8848", "extendInfo": { "lastRefreshTime": 1741678398775, "raftMetaData": { "metaDataMap": { "lock_acquire_service_v2": { "leader": "127.0.0.1:7848", "raftGroupMember": [ "127.0.0.1:7848" ], "term": 109 }, "naming_instance_metadata": { "leader": "127.0.0.1:7848", "raftGroupMember": [ "127.0.0.1:7848" ], "term": 391 }, "naming_persistent_service": { "leader": "127.0.0.1:7848", "raftGroupMember": [ "127.0.0.1:7848" ], "term": 387 }, "naming_persistent_service_v2": { "leader": "127.0.0.1:7848", "raftGroupMember": [ "127.0.0.1:7848" ], "term": 391 }, "naming_service_metadata": { "leader": "127.0.0.1:7848", "raftGroupMember": [ "127.0.0.1:7848" ], "term": 391 } } }, "raftPort": "7848", "readyToUpgrade": true, "supportGrayModel": true, "version": "3.0.0-BETA" }, "failAccessCnt": 0, "grpcReportEnabled": true, "ip": "127.0.0.1", "port": 8848, "state": "UP" }, "message": "success"}1.6. 获取集群所有节点信息
Description
通过该接口,可以获取Nacos Server集群中所有节点的详细信息。
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/cluster/node/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
address | string | No | 节点地址,支持按地址过滤。 |
state | string | No | Node state: UP/DOWN/SUSPICIOUS |
Response Data
返回体遵循Nacos open API 统一返回体格式,data字段为获取本节点信息的返回数据的列表。
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/cluster/node/list'- Response example
{ "code": 0, "message": "success", "data": [ { "ip": "nacos-node-0", "port": 8848, "state": "UP", "extendInfo": { "lastRefreshTime": 1709273550501, "raftMetaData": { "metaDataMap": { "naming_instance_metadata": { "leader": "nacos-node-2:7848", "raftGroupMember": [ "nacos-node-2:7848", "nacos-node-1:7848", "nacos-node-0:7848" ], "term": 3 }, "naming_persistent_service": { "leader": "nacos-node-1:7848", "raftGroupMember": [ "nacos-node-2:7848", "nacos-node-1:7848", "nacos-node-0:7848" ], "term": 3 }, "naming_persistent_service_v2": { "leader": "nacos-node-2:7848", "raftGroupMember": [ "nacos-node-2:7848", "nacos-node-1:7848", "nacos-node-0:7848" ], "term": 2 }, "naming_service_metadata": { "leader": "nacos-node-2:7848", "raftGroupMember": [ "nacos-node-2:7848", "nacos-node-1:7848", "nacos-node-0:7848" ], "term": 3 } } }, "raftPort": "7848", "readyToUpgrade": true, "supportGrayModel": true, "version": "3.0.0-ALPHA" }, "address": "nacos-node-0:8848", "failAccessCnt": 0, "abilities": { "remoteAbility": { "supportRemoteConnection": true, "grpcReportEnabled": true }, "configAbility": { "supportRemoteMetrics": false }, "namingAbility": { "supportJraft": true } }, "grpcReportEnabled": true }, { "ip": "nacos-node-2", "port": 8848, "state": "UP", "extendInfo": { "lastRefreshTime": 1710813796567, "raftMetaData": { .... }, .... }, .... }, { "ip": "nacos-node-1", "port": 8848, "state": "UP", "extendInfo": { "lastRefreshTime": 1710813796567, "raftMetaData": { .... }, .... }, .... } ]}1.7. 动态修改Server集群地址发现方式
Description
通过该接口,可以在不重启Nacos Server的情况下,动态切换Nacos Server集群地址发现的方式,目前支持两种方式:file
和address-server。
Since
3.0.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/cluster/lookup
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
type | string | Yes | address-server/file/standalone |
Response Data
返回体遵循Nacos open API 统一返回体格式。
| Name | Type | Description |
|---|---|---|
data | boolean | true表示更新成功,false表示更新失败。 |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/core/cluster/lookup' -d "type=file"- Response example
{ "code": 0, "message": "success", "data": true}1.8. Raft 相关操作
Description
通过该接口,可以对Nacos Server集群中的Raft协议进行部分运维操作,如执行快照,主动选主等。
Since
3.0.0
Request Method
POST
请求体类型:application/json,参数放在请求体中。
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/ops/raft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
command | string | Yes | Raft运维操作指令,具体的命令请参考下表。 |
value | string | Yes | 命令的参数,具体的命令内容请参考下表。 |
groupId | string | No | Raft集群的groupId,如果不输入则对所有Raft Group生效 |
命令说明(Swagger 暂不支持该子参数结构,文档保留):
doSnapshot:${nacos-server-address}:${raft-port}transferLeader:${nacos-server-address}:${raft-port}restRaftCluster:${nacos-server-address}:${raft-port}[,${nacos-server-address}:${raft-port}]removePeer:${nacos-server-address}:${raft-port}removePeers:${nacos-server-address}:${raft-port}[,${nacos-server-address}:${raft-port}]changePeers:${nacos-server-address}:${raft-port}[,${nacos-server-address}:${raft-port}]
Response Data
返回体遵循Nacos open API 统一返回体格式。
| Name | Type | Description |
|---|---|---|
data | string | 固定为null。 |
Examples
- Request example
curl -X POST -H 'Content-Type:application/json' 'http://127.0.0.1:8848/nacos/v3/admin/core/ops/raft' -d '{"command":"doSnapshot","value":"nacos-node-0:7848"}'- Response example
{ "code": 0, "message": null, "data": null}1.9. 动态修改Nacos Core相关日志级别
Description
通过该接口,可以在不重启Nacos Server的情况下,动态修改Nacos Core相关日志级别的配置。
Since
3.0.0
Request Method
PUT
请求体类型:application/json,参数放在请求体中。
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/ops/log
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
logName | string | Yes | 具体的日志文件的Name,具体支持的日志Name见下表。 |
logLevel | string | Yes | 日志的级别,可选值为ALL、TRACE、DEBUG、INFO、WARN、ERROR、OFF。 |
| logName | 对应的具体日志文件 |
|---|---|
core-auth | core-auth.log |
core-raft | protocol-raft.log |
core-distro | protocol-distro.log |
core-cluster | nacos-cluster.log |
Response Data
返回体遵循Nacos open API 统一返回体格式。
| Name | Type | Description |
|---|---|---|
data | string | 固定为null。 |
Examples
- Request example
curl -X PUT -H 'Content-Type:application/json' 'http://127.0.0.1:8848/nacos/v3/admin/core/ops/log' -d '{"logName":"core-distro","logLevel":"DEBUG"}'- Response example
{ "code": 0, "message": "success", "data": null}1.10. 自动均衡指定数量的连接
Description
通过该接口,可以根据负载因子(loaderFactor)自动均衡整个集群的客户端连接。
自动均衡逻辑:
- 根据整个集群的客户端连接数和Nacos Server节点数量计算平均连接数
avg、节点连接数下限阈值lowLimitCount(=avg * ( 1-loaderFactor))、节点连接数上限阈值overLimitCount(=avg * (1+loaderFactor)) - 将高负载节点的部分客户端连接重定向到低负载节点。
Since
3.0.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/loader/smartReloadCluster
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
loaderFactor | number | No | - |
Response Data
成功则返回:
{ "code": 0, "message": "success", "data": null}失败则返回:
{ "code": 30000, "message": "server error", "data": null}Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/core/loader/smartReloadCluster' -d "loaderFactor=0.1"- Response example
success1.11. 获取ID生成器信息
Description
通过该接口,获取ID生成器的当前ID,workerId. 只有使用内置数据库时该接口才会返回有效数据.
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/ops/ids
Request Parameters
无
Response Data
返回体遵循Nacos open API 统一返回体格式。
| Name | Type | Description |
|---|---|---|
resource | string | 生产器Name |
info | object | 生产器详情 |
info.currentId | integer | 当前ID |
info.workerId | integer | workerID |
成功则返回:
{ "code": 0, "message": "success", "data": [ { "resource": "resourceName", "info": { "currentId": 1, "workerId": 2 } } ]}失败则返回:
{ "code": 30000, "message": "server error", "data": null}Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/ops/ids'- Response example
success1.12. 更新集群节点信息
Description
通过该接口,可以更新当前节点中的Nacos节点列表的详细信息。注意: 该接口会覆盖当前节点中列表中的详细信息,仅更新传入的节点中存在于集群中的节点,并不能通过此接口添加和减少集群中的节点。同时,Nacos自身的健康探测report任务也会对当前节点中列表中的节点进行健康探测及更新详细信息,若调用此接口后,探测任务发现节点信息有变更,则任务也会覆盖当前节点中列表中的节点信息。
Since
3.0.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/cluster/node/list
Request Parameters
请求体为 JSON 数组,数组元素为节点信息(Member),包含 ip、port、state、extendInfo 等字段。
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
| data | boolean | 是否更新成功 |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/core/cluster/node/list' \ -H 'Content-Type: application/json' \ -d '[{"ip":"127.0.0.1","port":8848,"state":"UP","address":"127.0.0.1:8848"}]'- Response example
{ "code": 0, "message": "success", "data": true}1.13. 获取命名空间详情
Description
通过该接口,可以获取指定命名空间的详情。
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/namespace
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | Yes | 命名空间 ID |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
| namespace | string | 命名空间 ID |
| namespaceShowName | string | 命名空间展示名 |
| namespaceDesc | string | 命名空间描述 |
| quota | integer | 配置数量配额 |
| configCount | integer | 当前配置数量 |
| type | integer | Type |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/namespace?namespaceId=public'- Response example
{ "code": 0, "message": "success", "data": { "namespace": "public", "namespaceShowName": "public", "namespaceDesc": "Default Namespace", "quota": 200, "configCount": 0, "type": 0 }}1.14. 更新命名空间
Description
通过该接口,可以更新命名空间的信息,无法更新命名空间ID,仅能更新命名空间的Name和Description。
Since
3.0.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/namespace
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | Yes | 命名空间 ID |
namespaceName | string | Yes | 命名空间展示名 |
namespaceDesc | string | No | 命名空间描述 |
Response Data
成功则返回统一返回体,data 为 true 表示成功;失败则返回Nacos open API 统一返回体格式。
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/core/namespace' \ -d 'namespaceId=test' -d 'namespaceName=test' -d 'namespaceDesc=test'- Response example
{ "code": 0, "message": "success", "data": true}1.15. 创建新命名空间
Description
通过该接口,可以创建新的命名空间。
Since
3.0.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/namespace
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间 ID,不传则由服务端生成 |
namespaceName | string | Yes | 命名空间展示名 |
namespaceDesc | string | No | 命名空间描述 |
Response Data
成功则返回统一返回体,data 为 true 表示成功;失败则返回Nacos open API 统一返回体格式。
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/core/namespace' \ -d 'namespaceName=test' -d 'namespaceDesc=test'- Response example
{ "code": 0, "message": "success", "data": true}1.16. 删除命名空间
Description
通过该接口,可以删除命名空间。默认命名空间public无法被删除。
Since
3.0.0
Request Method
DELETE
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/namespace
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | Yes | 命名空间 ID |
Response Data
成功则返回统一返回体,data 为 true 表示成功;失败则返回Nacos open API 统一返回体格式。
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/core/namespace?namespaceId=test'- Response example
{ "code": 0, "message": "success", "data": true}1.17. 检查命名空间是否存在
Description
通过该接口,可以检查命名空间ID是否存在。应该在创建命名空间前调用,确认自定义的命名空间ID是否已经存在,以防冲突。
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/namespace/check
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | Yes | - |
Response Data
返回体遵循Nacos open API 统一返回体格式,data 为 true 表示已存在,false 表示不存在。
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/namespace/check?namespaceId=public'- Response example
{ "code": 0, "message": "success", "data": false}1.18. 获取Nacos命名空间列表
Description
通过该接口,可以获取当前Nacos集群的命名空间列表。
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/namespace/list
Request Parameters
无
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。data 为命名空间对象数组,每项包含 namespace、namespaceShowName、namespaceDesc、quota、configCount、type 等字段。
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/namespace/list'- Response example
{ "code": 0, "message": "success", "data": [ { "namespace": "public", "namespaceShowName": "public", "namespaceDesc": "Default Namespace", "quota": 200, "configCount": 0, "type": 0 } ]}1.19. 获取Nacos集群状态信息
Description
通过该接口,可以获取到Nacos 集群的基础状态和开关信息,例如:版本号,运行模式,鉴权是否开启等;该接口不会返回Nacos 集群的节点信息。
Since
3.0.0
Request Method
GET
Authorization
公开接口,无需身份信息。
Request URL
/nacos/v3/admin/core/state
Request Parameters
无
Response Data
返回体遵循Nacos open API 统一返回体格式,data 为键值对,包含版本号(version)、运行模式(startup_mode)、鉴权开关(auth_enabled)等集群状态与配置项。
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/state'- Response example
{ "defaultMaxSize": "102400", "auth_system_type": "nacos", "auth_enabled": "false", "version": "3.0.0-SNAPSHOT", "startup_mode": "standalone", "server_port": "8848"}1.20. 获取Nacos集群的存活状态
Description
通过该接口,可以获取Nacos集群的存活状态,Nacos集群是否可正常接受和响应请求。
Since
3.0.0
Request Method
GET
Authorization
公开接口,无需身份信息。
Request URL
/nacos/v3/admin/core/state/liveness
Request Parameters
无
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
| data | string | 存活状态,如 “ok” |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/state/liveness'- Response example
{ "code": 0, "message": "success", "data": "ok"}1.21. 获取Nacos集群的可读状态
Description
通过该接口,可以获取Nacos集群的是否处于可读取状态,即Nacos集群是否可以读取到数据。
Since
3.0.0
Request Method
GET
Authorization
公开接口,无需身份信息。
Request URL
/nacos/v3/admin/core/state/readiness
Request Parameters
无
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
| data | string | 可读状态,如 “ok” |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/state/readiness'- Response example
{ "code": 0, "message": "success", "data": "ok"}1.22. 更新插件配置
Description
通过该接口,可以更新插件的配置。需要提供插件类型、名称及配置内容。支持 localOnly 仅作用于当前节点。
Since
3.2.0
Request Method
PUT
请求体类型:application/json。
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/plugin/config
Request Parameters
请求体为 JSON,包含以下字段:
| Name | Type | Required | Description |
|---|---|---|---|
pluginType | string | Yes | 插件类型,如 auth。 |
pluginName | string | Yes | 插件名称。 |
config | string | Yes | 插件配置项。 |
localOnly | boolean | No | 是否仅写本地,不持久化。 |
Response Data
返回体遵循Nacos open API 统一返回体格式,data 为字符串表示操作结果。
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/core/plugin/config' \ -H 'Content-Type: application/json' -d '{}'- Response example
{ "code": 0, "message": "success", "data": "Plugin configuration updated successfully"}1.23. 获取插件详情
Description
通过该接口,可以按类型和名称获取指定插件的详情信息。
Since
3.2.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/plugin/detail
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pluginType | string | Yes | 插件类型,如 auth |
pluginName | string | Yes | 插件名称 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
| pluginId | string | 插件 ID |
| pluginType | string | 插件类型 |
| pluginName | string | 插件名称 |
| enabled | boolean | 是否启用 |
| critical | boolean | 是否关键插件 |
| configurable | boolean | 是否可配置 |
| config | object | 配置内容 |
| configDefinitions | array | 配置定义列表 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/plugin/detail?pluginType=auth&pluginName=nacos-default-auth-plugin'- Response example
{ "code": 0, "message": "success", "data": { "pluginId": "auth:nacos-default-auth-plugin", "pluginType": "auth", "pluginName": "nacos-default-auth-plugin", "enabled": true, "critical": true, "configurable": true, "config": {}, "configDefinitions": [] }}1.24. 获取插件列表
Description
通过该接口,可以获取所有插件列表,可按插件类型筛选。
Since
3.2.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/plugin/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pluginType | string | No | 插件类型,不传则返回全部 |
Response Data
返回体遵循Nacos open API 统一返回体格式,data 为插件对象数组。
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/plugin/list?pluginType=auth'- Response example
{ "code": 0, "message": "success", "data": [ { "pluginId": "auth:nacos-default-auth-plugin", "pluginType": "auth", "pluginName": "nacos-default-auth-plugin", "enabled": true, "critical": true, "configurable": true, "exclusive": true } ]}1.25. 启用或禁用插件
Description
通过该接口,可以更新插件的启用状态(启用或禁用)。支持 localOnly 仅作用于当前节点。
Since
3.2.0
Request Method
PUT
请求体类型:application/json。
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/core/plugin/status
Request Parameters
请求体为 JSON,包含以下字段:
| Name | Type | Required | Description |
|---|---|---|---|
pluginType | string | Yes | 插件类型。 |
pluginName | string | Yes | 插件名称。 |
enabled | boolean | Yes | 是否启用。 |
localOnly | boolean | No | 是否仅写本地。 |
Response Data
返回体遵循Nacos open API 统一返回体格式,data 为字符串表示操作结果。
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/core/plugin/status' \ -H 'Content-Type: application/json' -d '{}'- Response example
{ "code": 0, "message": "success", "data": "Plugin status updated successfully"}2. Nacos Naming 运维 API
2.1. 查看Naming模块的相关开关
Description
通过该接口,可以查看Nacos Naming模块的相关开关。
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ns/ops/switches
Request Parameters
无
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
clientBeatInterval | integer | Nacos1.X客户端的默认心跳间隔 |
defaultCacheMillis | integer | 客户端订阅的服务列表的默认缓存时间 |
pushCacheMillis | integer | 推送的服务列表的默认缓存时间,优先级高于defaultCacheMillis |
distroEnabled | boolean | 是否开启Distro协议同步,仅当集群压力过大,影响到集群稳定性时,临时修改为false缓解,改为false后可能导致部分数据不一致,需要尽快恢复 |
healthCheckEnabled | boolean | 是否开启健康检查,仅当集群压力过大,影响到集群稳定性时,临时修改为false缓解,改为false后不会因为心跳过期,tcp/http探测超时而修改实例的健康状态,以及不会因过期删除实例,需要尽快恢复 |
lightBeatEnabled | boolean | 是否开启轻量心跳,针对Nacos1.2.X~1.4.X版本客户端生效,修改为false后,Nacos1.2.X~1.4.X版本客户端将使用全量心跳进行续约 |
pushEnabled | boolean | 是否开启推送功能,仅当集群压力过大,影响到集群稳定性时,临时修改为false,改为false后,Nacos客户端将不再收到服务端的主动推送 |
push${Language}Version | string | 可支持推送的最小客户端版本,当不希望针对小于某些版本进行数据推送时,可以修改该值,比如修改pushJavaVersion为2.0.0,则小于2.0.0的Java客户端将不会收到推送数据 |
${type}HealthParams | object | Health check parameters, including the maximum and minimum check intervals and random interval factor. These values are used to spread the next round of health check traffic. |
注意: 其余未列出的参数,均为Nacos旧版本的开关或配置内容,已废弃或即将废弃,请谨慎使用。
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/ops/switches'- Response example
{ "code": 0, "message": "success", "data": { "adWeightMap": {}, "autoChangeHealthCheckEnabled": true, "checkTimes": 3, "checksum": null, "clientBeatInterval": 5000, "defaultCacheMillis": 3000, "defaultInstanceEphemeral": true, "defaultPushCacheMillis": 10000, "disableAddIP": false, "distroEnabled": true, "distroServerExpiredMillis": 10000, "distroThreshold": 0.7, "enableAuthentication": false, "enableStandalone": true, "healthCheckEnabled": true, "healthCheckWhiteList": [], "httpHealthParams": { "factor": 0.85, "max": 5000, "min": 500 }, "incrementalList": [], "lightBeatEnabled": true, "limitedUrlMap": {}, "masters": null, "mysqlHealthParams": { "factor": 0.65, "max": 3000, "min": 2000 }, "name": "00-00---000-NACOS_SWITCH_DOMAIN-000---00-00", "overriddenServerStatus": null, "pushCSharpVersion": "0.9.0", "pushCVersion": "1.0.12", "pushEnabled": true, "pushGoVersion": "0.1.0", "pushJavaVersion": "0.1.0", "pushPythonVersion": "0.4.3", "sendBeatOnly": false, "serverStatusSynchronizationPeriodMillis": 2000, "serviceStatusSynchronizationPeriodMillis": 5000, "tcpHealthParams": { "factor": 0.75, "max": 5000, "min": 1000 } }}2.2. 修改Naming模块的相关开关
Description
通过该接口,可以修改Nacos Naming模块的相关开关。
Since
3.0.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ns/ops/switches
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
entry | string | Yes | 修改的开关或配置Name |
value | string | Yes | 开关或配置的新值,不同的开关或配置的Type不同,具体请参考开关和配置参数 |
debug | boolean | No | 是否开启调试模式,开启后,修改的配置不会同步到集群其他节点中,仅在本节点生效,默认为false |
Response Data
| Name | Type | Description |
|---|---|---|
data | string | 成功为ok |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ns/ops/switches' -d "entry=pushEnabled&value=false"- Response example
{ "code": 0, "message": "success", "data": "ok"}2.3. 查询系统当前数据指标
Description
通过该接口,可以查询系统当前数据指标。
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ns/ops/metrics
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
onlyStatus | boolean | No | true | 只显示状态 |
当
onlyStatus设置为true时,只返回表示系统状态的字符串
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
status | string | 系统状态 |
serviceCount | integer | 服务数量 |
instanceCount | integer | 实例数量 |
subscribeCount | integer | 订阅数量 |
clientCount | integer | 客户端数量 |
connectionBasedClientCount | integer | 连接数量 |
ephemeralIpPortClientCount | integer | 临时客户端数量 |
persistentIpPortClientCount | integer | 持久客户端数量 |
responsibleClientCount | integer | 响应客户端数 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/ops/metrics?onlyStatus=false'- Response example
{ "code": 0, "message": "success", "data": { "clientCount": 3, "connectionBasedClientCount": 1, "ephemeralIpPortClientCount": 0, "instanceCount": 2, "persistentIpPortClientCount": 2, "responsibleClientCount": 3, "serviceCount": 2, "status": "UP", "subscribeCount": 1 }}2.4. 修改日志级别
Description
通过该接口,可以动态修改指定日志的级别。
Since
3.0.0
Request Method
PUT
请求体类型:application/json。
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ns/ops/log
Request Parameters
| Name | Type | Required | Description |
|---|
请求体字段:
| Name | Type | Required | Description |
|---|---|---|---|
logName | string | Yes | 需要修改的日志Name。 |
logLevel | string | Yes | 日志级别的新值。 |
Response Data
| Name | Type | Description |
|---|---|---|
data | string | 成功为ok |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ns/ops/log' -H 'Content-Type: application/json' -d '{"logName":"com.example.Logger","logLevel":"DEBUG"}'- Response example
{ "code": 0, "message": "success", "data": "ok"}2.5 查询所有客户端列表
Description
查询所有客户端的列表。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ns/client/list
Request Parameters
无
Response Data
| Name | Type | Description |
|---|---|---|
data | array | Client ID list. |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/client/list'{ "code": 0, "message": "success", "data": [ "127.0.0.1:8080#false", "1741748952410_127.0.0.1_53863", "1.1.1.1:3306#false" ]}2.6 查询客户端详细信息
Description
根据客户端ID查询客户端的详细信息。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ns/client
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
clientId | string | Yes | 客户端ID |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
clientId | string | 客户端的唯一 ID。 |
ephemeral | boolean | 客户端是否为临时客户端 |
lastUpdatedTime | integer | 客户端的最后更新时间(时间戳) |
clientType | string | 客户端Type |
connectType | string | 连接Type(仅适用于 2.x 客户端) |
appName | string | 客户端所属的应用名称 |
version | string | 客户端的版本号 |
clientIp | string | 客户端的 IP 地址 |
clientPort | string | 客户端的端口号 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/client?clientId=1741748952410_127.0.0.1_53863'- Response example
{ "code": 0, "message": "success", "data": { "appName": "unknown", "clientId": "1741748952410_127.0.0.1_53863", "clientIp": "127.0.0.1", "clientPort": 53863, "clientType": "connection", "connectType": "GRPC", "ephemeral": true, "lastUpdatedTime": 1741748954789, "version": "Nacos-Java-Client:v3.0.0-BETA" }}若为持久化实例,则返回
{ "code": 0, "message": "success", "data": { "appName": null, "clientId": "1.1.1.1:3306#false", "clientIp": null, "clientPort": 0, "clientType": "ipPort", "connectType": null, "ephemeral": false, "lastUpdatedTime": 1741748950046, "version": null }}2.7 查询客户端注册的服务列表
Description
查询指定客户端注册的服务列表。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ns/client/publish/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
clientId | string | Yes | 客户端ID |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
namespaceId | string | 命名空间 |
groupName | string | 分组名 |
serviceName | string | 服务名 |
publisherInfo | object | 该服务下注册的实例 |
publisherInfo.ip | string | IP地址 |
publisherInfo.port | integer | 端口号 |
publisherInfo.clusterName | string | 集群名 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/client/publish/list?clientId=1664527081276_127.0.0.1_4400'- Response example
{ "code": 0, "message": "success", "data": [ { "groupName": "DEFAULT_GROUP", "namespaceId": "public", "publisherInfo": { "clientId": null, "clusterName": "DEFAULT", "ip": "1.1.1.1", "port": 3306 }, "serviceName": "test", "subscriberInfo": null } ]}2.8 查询客户端订阅的服务列表
Description
查询指定客户端订阅的服务列表。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ns/client/subscribe/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
clientId | string | Yes | 客户端ID |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
namespaceId | string | 命名空间 |
groupName | string | 分组名 |
serviceName | string | 服务名 |
subscriberInfo | object | 订阅信息 |
subscriberInfo.appName | string | 应用 |
subscriberInfo.agent | string | 客户端信息 |
subscriberInfo.address | string | 地址 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/client/subscribe/list?clientId=1664527081276_127.0.0.1_4400'- Response example
{ "code": 0, "message": "success", "data": [ { "groupName": "DEFAULT_GROUP", "namespaceId": "public", "publisherInfo": null, "serviceName": "com.test.SyncCallbackService", "subscriberInfo": { "address": "127.0.0.1", "agent": "Nacos-Java-Client:v3.0.0-BETA", "appName": "unknown", "clientId": null } } ]}2.9 查询注册指定服务的客户端列表
Description
查询注册指定服务的客户端列表。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ns/client/service/publisher/list
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespaceId | string | No | "public" | |
groupName | string | No | "DEFAULT_GROUP" | |
serviceName | string | Yes | None | |
ip | string | No | None | |
port | integer | No | None |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
clientId | string | 客户端id |
ip | string | 实例的IP |
port | integer | 实例的端口 |
clusterName | string | 实例的集群名 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/client/service/publisher/list?serviceName=test'- Response example
{ "code": 0, "message": "success", "data": [ { "clientId": "1.1.1.1:3306#false", "clusterName": "DEFAULT", "ip": "1.1.1.1", "port": 3306 } ]}2.10 查询订阅指定服务的客户端列表
Description
查询订阅指定服务的客户端列表。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ns/client/service/subscriber/list
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespaceId | string | No | "public" | |
groupName | string | No | "DEFAULT_GROUP" | |
serviceName | string | Yes | None | |
ip | string | No | None | |
port | integer | No | None |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
clientId | string | 客户端id |
address | string | 订阅者客户端的IP |
agent | string | 订阅者客户端的版本 |
appName | string | 订阅者客户端的应用名,unknown表示未配置或客户端不支持 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/client/service/subscriber/list?serviceName=service1'- Response example
{ "code": 0, "message": "success", "data": [ { "address": "127.0.0.1", "agent": "Nacos-Java-Client:v3.0.0-BETA", "appName": "unknown", "clientId": "1741748952410_127.0.0.1_53863" } ]}2.11 查询客户端的负责服务器
Description
根据客户端的IP和端口查询其负责的服务器,仅针对持久化服务实例或通过运维API注册的临时实例。使用2.X以上客户端注册的临时实例无法通过此接口定位负责服务器节点。
对于使用1.X客户端注册的实例也适用此接口, 但1.X客户端将在未来版本不再支持。
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ns/client/distro
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ip | string | Yes | 客户端IP |
port | integer | Yes | Client port. |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
responsibleServer | string | 负责的服务器信息 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/client/distro?ip=127.0.0.1&port=8080'- Response example
{ "code": 0, "message": "success", "data": { "responsibleServer": "127.0.0.1:8848" }}2.12 更新集群信息
Description
更新指定集群的元数据信息。
Since
3.0.0
Request Method
PUT
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ns/cluster
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间ID |
serviceName | string | Yes | 服务名称 |
clusterName | string | Yes | 集群Name |
checkPort | integer | No | 健康检查端口 |
useInstancePort4Check | boolean | No | 是否使用实例端口进行健康检查 |
healthChecker | string | No | 健康检查器配置(JSON 字符串) |
metadata | string | No | 集群的扩展元数据,默认为"" |
groupName | string | No | - |
Response Data
| Name | Type | Description |
|---|---|---|
data | string | 操作结果信息 |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ns/cluster' -d 'serviceName=test&clusterName=DEFAULT&checkPort=80&useInstancePort4Check=true&healthChecker={"type":"none"}'- Response example
{ "code": 0, "message": "success", "data": "ok"}2.13 更新实例健康状态
Description
更新指定实例的健康状态。
仅对持久化服务的实例有效, 且该服务的健康检查方式为
NONE。 临时实例的健康状态由连接(客户端)维护,其他健康检查Type的持久化服务,健康检查任务会自动维护健康状态,即使更新成功了,也很快会被健康检查任务重制。
Since
3.0.0
Request Method
PUT
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ns/health/instance
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间ID,默认为public |
serviceName | string | Yes | 服务名称 |
groupName | string | No | 分组Name,默认为DEFAULT_GROUP |
clusterName | string | No | 集群Name,默认DEFAULT |
ip | string | Yes | 实例IP |
port | integer | Yes | 实例端口 |
healthy | boolean | Yes | 健康状态(true 为健康) |
Response Data
| Name | Type | Description |
|---|---|---|
data | string | 操作结果信息 |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ns/health/instance' -d 'namespaceId=public&serviceName=service1&groupName=DEFAULT_GROUP&clusterName=cluster1&ip=127.0.0.1&port=8080&healthy=true'- Response example
{ "code": 0, "message": "success", "data": "ok"}2.14 获取所有健康检查器
Description
获取系统中支持的所有健康检查器Type及其配置。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ns/health/checkers
Request Parameters
无
Response Data
| Name | Type | Description |
|---|---|---|
data | Map<String, AbstractHealthChecker> | 健康检查器Type及其配置 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/health/checkers'- Response example
{ "code": 0, "message": "success", "data": { "HTTP": { "expectedResponseCode": 200, "headers": "", "path": "" }, "MYSQL": { "cmd": null, "pwd": null, "user": null }, "NONE": {}, "TCP": {} }}2.15 注册实例
Description
注册一个新的实例到指定服务。
Since
3.0.0
Request Method
POST
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ns/instance
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间ID,默认为public |
serviceName | string | Yes | 服务名称 |
groupName | string | No | 分组Name,默认为DEFAULT_GROUP |
clusterName | string | No | 集群Name,默认为DEFAULT |
ip | string | Yes | 实例IP |
port | integer | Yes | 实例端口 |
weight | number | No | 实例权重,默认为1.0 |
healthy | boolean | No | 健康状态,默认为true |
enabled | boolean | No | 是否启用,默认为true |
metadata | string | No | 实例元数据 |
ephemeral | boolean | No | 是否临时实例 |
Response Data
| Name | Type | Description |
|---|---|---|
data | string | 操作结果信息 |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ns/instance' \-d 'namespaceId=public&serviceName=service1&groupName=DEFAULT_GROUP&clusterName=cluster1&ip=127.0.0.1&port=8080&weight=1.0&healthy=true&enabled=true&metadata={"key1=value1"}&ephemeral=true'- Response example
{ "code": 0, "message": "success", "data": "ok"}2.16 注销实例
Description
从指定服务中注销一个实例。
Since
3.0.0
Request Method
DELETE
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ns/instance
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间ID,默认为public |
serviceName | string | Yes | 服务名称 |
groupName | string | No | 分组Name,默认为DEFAULT_GROUP |
clusterName | string | No | 集群Name,默认为DEFAULT |
ip | string | Yes | 实例IP |
port | integer | Yes | 实例端口 |
Response Data
| Name | Type | Description |
|---|---|---|
data | string | 操作结果信息 |
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/ns/instance?namespaceId=public&serviceName=service1&groupName=DEFAULT_GROUP&clusterName=cluster1&ip=127.0.0.1&port=8080&ephemeral=true'- Response example
{ "code": 0, "message": "success", "data": "ok"}2.17 更新实例
Description
更新指定实例的信息。
通过该接口更新的元数据拥有更高的优先级(相比注册实例时的元数据),且具有记忆能力;会在对应实例删除后,依旧存在一段时间,如果在此期间实例重新注册,该元数据依旧生效;您可以通过nacos.naming.clean.expired-metadata.expired-time及nacos.naming.clean.expired-metadata.interval对记忆时间进行修改。
例如, 注册实例时的元数据为
k1=v1, 此时使用更新实例接口更新元数据为k1=v2,此时读取到的元数据为v1=v2;此时注销后快速重新注册实例,元数据为k1=v2,而不是k1=v1。若注销后,等待expired-metadata.expired-time时间后再次注册该实例,元数据为k1=v1。
同时该接口将会完全覆盖之前更新过的元数据信息,例如,先使用
k1=v1更新元数据,再使用k2=v2更新元数据,此时读取到的元数据为k2=v2,而不是k1=v1,k2=v2。
Since
3.0.0
Request Method
PUT
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ns/instance
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间ID,默认为public |
serviceName | string | Yes | 服务名称 |
groupName | string | No | 分组Name,默认为DEFAULT_GROUP |
clusterName | string | No | 集群Name,默认为DEFAULT |
ip | string | Yes | 实例IP |
port | integer | Yes | 实例端口 |
weight | number | No | 实例权重,默认为1.0 |
healthy | boolean | No | 健康状态,默认为true |
enabled | boolean | No | 是否启用,默认为true |
metadata | string | No | 实例元数据 |
ephemeral | boolean | No | 是否临时实例 |
Response Data
| Name | Type | Description |
|---|---|---|
data | string | 操作结果信息 |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ns/instance' \-d 'serviceName=test&clusterName=DEFAULT&groupName=DEFAULT_GROUP&ip=1.1.1.1&port=3306&ephemeral=true&weight=100&enabled=false&metadata=%7B%22%E5%95%A6%E5%95%A6%E5%95%A6%26%E5%95%B5%E5%95%B5%E5%95%B5%22%3A%22xxx%22%7D'- Response example
{ "code": 0, "message": "success", "data": "ok"}2.18 批量更新实例元数据
Description
批量更新指定实例的元数据。
Since
3.0.0
Request Method
PUT
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ns/instance/metadata/batch
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间ID,默认为public |
serviceName | string | Yes | 服务名称 |
groupName | string | No | 分组Name,默认为DEFAULT_GROUP |
instances | string | No | 实例列表(JSON数组 字符串)默认为""表示所有实例更新;若指定时,每个元素代表一个需要更新的实例,必须需要包含ip和port字段,clusterName字段为可选, |
metadata | string | Yes | 元数据 |
consistencyType | string | No | 一致性Typeephemeral和persist,对应服务的ephemeral,默认为ephemeral |
Response Data
| Name | Type | Description |
|---|---|---|
updated | array | Updated instance list. |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ns/instance/metadata/batch' \-d 'namespaceId=public&serviceName=service1&groupName=DEFAULT_GROUP&instances=[{"ip":"127.0.0.1","port":8080}]&metadata={"key1":"value1"}&consistencyType=ephemeral'- Response example
{ "code": 0, "message": "success", "data": { "updated": [ "127.0.0.1:8080:unknown:DEFAULT:ephemeral" ] }}2.19 批量删除实例元数据
Description
批量删除指定实例的元数据。
Since
3.0.0
Request Method
DELETE
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ns/instance/metadata/batch
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间ID,默认为public |
serviceName | string | Yes | 服务名称 |
groupName | string | No | 分组Name,默认为DEFAULT_GROUP |
instances | string | No | 实例列表(JSON 字符串),默认为"" |
metadata | string | Yes | 元数据 |
consistencyType | string | No | 一致性Type,默认为"" |
Response Data
| Name | Type | Description |
|---|---|---|
data | InstanceMetadataBatchOperationVo | 操作结果信息 |
data.updated | array | Updated instance list. |
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/ns/instance/metadata/batch?namespaceId=public&serviceName=service1&groupName=DEFAULT_GROUP&instances=%5B%7B%22ip%22%3A%22127.0.0.1%22%2C%22port%22%3A8080%7D%5D&metadata=%7B%22key1%22%3A%22value1%22%7D&consistencyType=ephemeral'- Response example
{ "code": 0, "message": "success", "data": { "updated": [ "127.0.0.1:8080:unknown:DEFAULT:ephemeral" ] }}2.20 部分更新实例
Description
部分更新指定实例的信息。
不同于更新实例,该接口支持部分更新实例信息,例如:先使用
k1=v1更新元数据,再使用k2=v2更新元数据,此时读取到的元数据为k1=v1,k2=v2。
Since
3.0.0
Request Method
PUT
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ns/instance/partial
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间ID,默认为public |
serviceName | string | Yes | 服务名称 |
ip | string | Yes | 实例IP |
port | integer | Yes | 实例端口 |
clusterName | string | No | 集群Name,默认为DEFAULT |
weight | number | No | 实例权重,默认为1.0 |
enabled | boolean | No | 是否启用,默认启用 |
metadata | string | No | 实例元数据(JSON 字符串) |
ephemeral | boolean | No | - |
groupName | string | No | - |
healthy | boolean | No | - |
Response Data
| Name | Type | Description |
|---|---|---|
data | string | 操作结果信息 |
Examples
- Request example
curl -X PUT "http://127.0.0.1:8848/nacos/v3/admin/ns/instance/partial" -d 'namespaceId=public&serviceName=example-service&ip=127.0.0.1&clusterName=DEFAULT&port=8080&weight=1.0&enabled=true&metadata={"key":"value"}'- Response example
{ "code": 0, "message": "success", "data": "ok"}2.21 查询服务实例列表
Description
查询指定服务的所有实例列表。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ns/instance/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间ID,默认public |
groupName | string | No | 分组Name,默认为DEFAULT_GROUP |
serviceName | string | Yes | 服务名称 |
clusterName | string | No | Cluster name. If not provided, instances of all clusters will be returned. |
healthyOnly | boolean | No | 是否只返回健康实例,默认为false |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
serviceName | string | 服务名,格式为groupName@@serviceName |
clusterName | string | 实例所在的集群Name |
ip | string | 实例IP |
port | integer | 实例端口号 |
weight | number | 实例权重 |
healthy | boolean | 实例是否健康 |
enabled | boolean | 实例是否可用 |
ephemeral | boolean | 是否为临时实例 |
metadata | map<string, string> | Instance metadata. |
instanceId | string | 实例Id |
关于心跳的参数
instanceHeartBeatInterval,instanceHeartBeatTimeOut和ipDeleteTimeout用于兼容1.X客户端的心跳模式数据,后续版本可能会移除对1.X客户端的支持,届时这3个参数将被废弃。
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/instance/list?namespaceId=public&serviceName=service1&healthyOnly=true'- Response example
{ "code": 0, "data": [ { "clusterName": "DEFAULT", "enabled": true, "ephemeral": false, "healthy": false, "instanceHeartBeatInterval": 5000, "instanceHeartBeatTimeOut": 15000, "instanceId": "1.1.1.1#3306#DEFAULT#DEFAULT_GROUP@@service1", "ip": "1.1.1.1", "ipDeleteTimeout": 30000, "metadata": { "key": "value" }, "port": 3306, "serviceName": "DEFAULT_GROUP@@service1", "weight": 1.0 } ], "message": "success"}2.22 查询实例详情
Description
查询指定实例的详细信息。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ns/instance
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间Id,默认为public |
groupName | string | No | Group name. Defaults to DEFAULT_GROUP. |
serviceName | string | Yes | 服务名 |
clusterName | string | No | 集群Name,默认为DEFAULT |
ip | string | Yes | IP地址 |
port | integer | Yes | 端口号 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
serviceName | string | 服务名,格式为groupName@@serviceName |
clusterName | string | 实例所在的集群Name |
ip | string | 实例IP |
port | integer | 实例端口号 |
weight | number | 实例权重 |
healthy | boolean | 实例是否健康 |
enabled | boolean | 实例是否可用 |
ephemeral | boolean | 是否为临时实例 |
metadata | map<string, string> | Instance metadata. |
instanceId | string | 实例Id |
关于心跳的参数
instanceHeartBeatInterval,instanceHeartBeatTimeOut和ipDeleteTimeout用于兼容1.X客户端的心跳模式数据,后续版本可能会移除对1.X客户端的支持,届时这3个参数将被废弃。
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/instance?namespaceId=public&serviceName=service1&ip=1.1.1.1&port=3306'- Response example
{ "code": 0, "data": [ { "clusterName": "DEFAULT", "enabled": true, "ephemeral": false, "healthy": false, "instanceHeartBeatInterval": 5000, "instanceHeartBeatTimeOut": 15000, "instanceId": "1.1.1.1#3306#DEFAULT#DEFAULT_GROUP@@service1", "ip": "1.1.1.1", "ipDeleteTimeout": 30000, "metadata": { "key": "value" }, "port": 3306, "serviceName": "DEFAULT_GROUP@@service1", "weight": 1.0 } ], "message": "success"}2.23 创建服务
Description
创建一个新的持久化服务。
Since
3.0.0
Request Method
POST
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ns/service
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间Id,默认为public |
groupName | string | No | 分组名,默认为DEFAULT_GROUP |
serviceName | string | Yes | 服务名 |
metadata | string | No | 服务元数据,默认为空 |
ephemeral | boolean | No | 是否为临时实例,默认为false |
protectThreshold | number | No | 保护阈值,默认为0 |
selector | string | No | 访问策略,默认为空 |
Response Data
| Name | Type | Description |
|---|---|---|
data | boolean | 是否执行成功 |
Examples
- Request example
curl -d 'serviceName=nacos.test.1' \ -d 'ephemeral=true' \ -d 'metadata={"k1":"v1"}' \ -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ns/service'- Response example
{ "code": 0, "message": "success", "data": true}2.24 删除服务
Description
删除指定服务
Since
3.0.0
Request Method
DELETE
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ns/service
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间Id,默认为public |
groupName | string | No | 分组名,默认为DEFAULT_GROUP |
serviceName | string | Yes | 服务名 |
Response Data
| Name | Type | Description |
|---|---|---|
data | boolean | 是否执行成功 |
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/ns/service?serviceName=nacos.test.1'- Response example
{ "code": 0, "message": "success", "data": true}2.25 查询服务详情
Description
查询指定服务的详细信息
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ns/service
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间Id,默认为public |
groupName | string | No | 分组名,默认为DEFAULT_GROUP |
serviceName | string | Yes | 服务名 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
namespaceId | string | 服务所属的namespaceId。 |
groupName | string | 服务所属的groupName。 |
serviceName | string | 服务名。 |
ephemeral | boolean | 服务的持久化属性,true为临时服务,false为持久化服务。 |
protectThreshold | number | 服务防护阈值。 |
selector | object | Service selector. |
metadata | object | Service metadata. |
clusterMap | object | Service cluster map. The key is the cluster name and the value is the cluster details. |
clusterMap.$ClusterName.clusterName | string | 集群名。 |
clusterMap.$ClusterName.healthChecker | object | Health checker. |
clusterMap.$ClusterName.healthyCheckPort | integer | 健康检查端口。 |
clusterMap.$ClusterName.useInstancePortForCheck | boolean | 是否使用所注册的实例的IP:Port进行健康检查。 |
clusterMap.$ClusterName.metadata | map<string, string> | Cluster metadata. |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/service?serviceName=nacos.test.1'- Response example
{ "code": 0, "message": "success", "data": { "clusterMap": { "DEFAULT": { "clusterName": "DEFAULT", "healthChecker": { "type": "NONE" }, "healthyCheckPort": 80, "hosts": null, "metadata": {}, "useInstancePortForCheck": true } }, "ephemeral": false, "groupName": "DEFAULT_GROUP", "metadata": {}, "namespaceId": "public", "protectThreshold": 0.0, "selector": { "contextType": "NONE", "type": "none" }, "serviceName": "test" }}2.26 查询服务列表
Description
查询所有服务的列表,支持分页和条件过滤。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ns/service/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间Id,默认为public |
pageNo | integer | Yes | 当前页,默认为1 |
pageSize | integer | Yes | 页条目数,默认为20,最大为500 |
groupNameParam | string | No | - |
ignoreEmptyService | boolean | No | - |
serviceNameParam | string | No | - |
withInstances | boolean | No | - |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
totalCount | integer | 符合条件的服务的总数。 |
pageNumber | integer | 当前页码,起始为1。 |
pagesAvailable | integer | 可用页码。 |
pageItems | array | Service list. |
pageItems[i].name | string | 服务名。 |
pageItems[i].groupName | string | 服务的分组名。 |
pageItems[i].clusterCount | string | 服务下的集群数量。 |
pageItems[i].ipCount | string | 服务下的实例数量。 |
pageItems[i].healthyInstanceCount | string | 服务下的健康实例数量。 |
pageItems[i].triggerFlag | string | 是否触发了服务的保护。 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/service/list'- Response example
{ "code": 0, "message": "success", "data": { "pageItems": [ { "clusterCount": 1, "groupName": "DEFAULT_GROUP", "healthyInstanceCount": 1, "ipCount": 1, "name": "com.test.SyncCallbackService", "triggerFlag": "false" }, { "clusterCount": 1, "groupName": "DEFAULT_GROUP", "healthyInstanceCount": 0, "ipCount": 1, "name": "test", "triggerFlag": "true" } ], "pageNumber": 1, "pagesAvailable": 1, "totalCount": 2 }}2.27 更新服务
Description
更新指定服务的配置信息。
该接口将会完全覆盖之前更新过的元数据信息,例如,先使用
k1=v1更新元数据,再使用k2=v2更新元数据,此时读取到的元数据为k2=v2,而不是k1=v1,k2=v2。
Since
3.0.0
Request Method
PUT
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ns/service
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间Id,默认为public |
groupName | string | No | 分组名,默认为DEFAULT_GROUP |
serviceName | string | Yes | 服务名 |
metadata | string | No | 服务元数据,默认为空 |
protectThreshold | number | No | 保护阈值,默认为0 |
selector | string | No | 访问策略,默认为空 |
ephemeral | boolean | No | - |
Response Data
| Name | Type | Description |
|---|---|---|
data | boolean | 是否执行成功 |
Examples
- Request example
curl -d 'serviceName=nacos.test.1' \ -d 'metadata={"k1":"v2"}' \ -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ns/service'- Response example
{ "code": 0, "message": "success", "data": true}2.28 查询订阅者列表
Description
查询指定服务的订阅者列表。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ns/service/subscribers
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | 命名空间ID,默认为public |
serviceName | string | Yes | 服务名称 |
groupName | string | No | 分组Name,默认是DEFAULT_GROUP |
pageNo | integer | Yes | 页码 |
pageSize | integer | Yes | 每页大小 |
aggregation | boolean | No | 是否聚合,默认为true |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
totalCount | integer | 符合条件的服务的总数。 |
pageNumber | integer | 当前页码,起始为1。 |
pagesAvailable | integer | 可用页码。 |
pageItems | array | Service list. |
pageItems[i].ip | string | 订阅者IP。 |
pageItems[i].port | integer | 订阅者端口。 |
pageItems[i].address | string | 订阅者地址, 一般为ip:port。 |
pageItems[i].agent | string | 订阅者客户端版本。 |
pageItems[i].appName | string | 订阅者所属应用。 |
pageItems[i].namespaceId | string | 订阅者所属命名空间。 |
pageItems[i].groupName | string | 订阅的分组名。 |
pageItems[i].serviceName | string | 订阅的服务名。 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/service/subscribers?namespaceId=public&serviceName=service1&groupName=DEFAULT_GROUP&pageNo=1&pageSize=10'- Response example
{ "code": 0, "message": "success", "data": { "pageItems": [ { "address": "127.0.0.1:0", "agent": "Nacos-Java-Client:v3.0.0-BETA", "appName": "unknown", "groupName": "DEFAULT_GROUP", "ip": "127.0.0.1", "namespaceId": "public", "port": 0, "serviceName": "service1" } ], "pageNumber": 1, "pagesAvailable": 1, "totalCount": 1 }}2.29 查询选择器Type
Description
查询系统中支持的所有选择器Type。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ns/service/selector/types
Request Parameters
无
Response Data
| Name | Type | Description |
|---|---|---|
data | array | Selector type list. |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ns/service/selector/types'- Response example
{ "code": 0, "message": "success", "data": [ "none", "label" ]}3. Nacos Config 运维 API
3.1. 获取配置
Description
获取指定配置
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/cs/config
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespaceId | string | No | public | 命名空间 |
groupName | string | Yes | None | 配置分组名 |
dataId | string | Yes | None | 配置名 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
id | string | 配置在存储系统中的ID,一般为Long 类型的字符串。 |
dataId | string | 配置ID。 |
groupName | string | 配置分组。 |
namespaceId | string | 命名空间ID。 |
content | string | 配置内容。 |
desc | string | 配置描述。 |
md5 | string | 配置内容的MD5值。 |
configTags | string | 配置的标签。 |
encryptedDataKey | string | 加密配置内容的密钥,使用配置加密插件时存在。 |
appName | string | 配置所属的应用名称。 |
type | string | 配置类型。 |
createTime | integer | 配置创建时间。 |
modifyTime | integer | 配置修改时间。 |
createUser | string | 配置创建人。 |
createIp | string | 配置创建IP。 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/config?dataId=nacos.example&groupName=DEFAULT_GROUP&namespaceId=public'- Response example
{ "code": 0, "message": "success", "data": { "appName": "", "configTags": null, "content": "contentTest", "createIp": "127.0.0.1", "createTime": 1741761841327, "createUser": "nacos", "dataId": "nacos.example", "desc": null, "encryptedDataKey": "", "groupName": "DEFAULT_GROUP", "id": "873810262413545472", "md5": "9f67e6977b100e00cab385a75597db58", "modifyTime": 1741761841327, "namespaceId": "public", "type": "text" }}3.2. 发布配置
Description
发布指定配置
当配置已存在时,则对配置进行更新
Since
3.0.0
Request Method
POST
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/cs/config
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespaceId | string | No | public | |
groupName | string | Yes | None | |
dataId | string | Yes | None | |
content | string | Yes | None | |
appName | string | No | None | |
configTags | string | No | None | |
desc | string | No | None | |
type | string | No | None | |
encryptedDataKey | string | No | - | |
srcUser | string | No | - | |
tag | string | No | - |
Response Data
| Name | Type | Description |
|---|---|---|
data | boolean | 是否执行成功 |
Examples
- Request example
curl -d 'dataId=nacos.example' \ -d 'groupName=DEFAULT_GROUP' \ -d 'namespaceId=public' \ -d 'content=contentTest' \ -X POST 'http://127.0.0.1:8848/nacos/v3/admin/cs/config'- Response example
{ "code": 0, "message": "success", "data": true}3.3. 删除配置
Description
删除指定配置
Since
3.0.0
Request Method
DELETE
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/cs/config
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespaceId | string | No | public | 命名空间 |
groupName | string | Yes | None | 配置分组名 |
dataId | string | Yes | None | 配置名 |
Response Data
| Name | Type | Description |
|---|---|---|
data | boolean | 是否执行成功 |
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/cs/config?dataId=nacos.example&groupName=DEFAULT_GROUP&namespaceId=public'- Response example
{ "code": 0, "message": "success", "data": true}3.4 批量删除配置
Description
根据配置ID批量删除配置
Since
3.0.0
Request Method
DELETE
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/cs/config/batch
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ids | array | Yes | Config ID list. Separate multiple IDs with commas. |
Response Data
| Name | Type | Description |
|---|---|---|
data | boolean | 操作结果 |
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/cs/config/batch?ids=1,2,3'- Response example
{ "code": 0, "message": "success", "data": true}3.5 查询配置的监听者
Description
查询指定配置的监听者信息
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/cs/config/listener
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespaceId | string | No | public | 命名空间 |
dataId | string | Yes | None | 配置ID |
groupName | string | Yes | None | 分组Name |
aggregation | boolean | No | true | Whether to aggregate data from other nodes. |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
queryType | string | 订阅者查询Type,该接口为config。 |
listenersStatus | map<string, string> | 订阅者列表,key为订阅者IP,value为订阅者订阅当前配置的MD5值。 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/config/listener?namespaceId=public&dataId=example&groupName=DEFAULT_GROUP'- Response example
{ "code": 0, "message": "success", "data": { "listenersStatus": { "127.0.0.1": "32cacc65accfdab47954de3fc781e938" }, "queryType": "config" }}3.6 通过配置内容查询配置列表
Description
根据配置详情(如内容、标签等)搜索配置。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/cs/config/list
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
pageNo | integer | Yes | 1 | |
pageSize | integer | Yes | 100 | |
namespaceId | string | No | public | |
dataId | string | Yes | "" | |
groupName | string | Yes | "" | |
appName | string | No | ||
configTags | string | No | ||
type | string | No | ||
configDetail | string | Yes | ||
search | string | No | Search mode: blur or accurate. Defaults to blur. |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
totalCount | integer | 符合规则的配置总数。 |
pagesAvailable | integer | 可用页码总数。 |
pageNumber | integer | 当前页码。 |
pageItems | array | Configurations matching the query criteria. |
pageItems[i].id | string | 配置在存储系统中的ID,一般为Long 类型的字符串。 |
pageItems[i].dataId | string | 配置ID。 |
pageItems[i].groupName | string | 配置分组。 |
pageItems[i].namespaceId | string | 命名空间ID。 |
pageItems[i].md5 | string | 配置内容的MD5值。 |
pageItems[i].appName | string | 配置所属的应用名称。 |
pageItems[i].type | string | 配置类型。 |
pageItems[i].createTime | integer | 配置创建时间。 |
pageItems[i].modifyTime | integer | 配置修改时间。 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/config/list?pageNo=1&pageSize=10'- Response example
{ "code": 0, "message": "success", "data": { "pageItems": [ { "appName": "", "createTime": 0, "dataId": "111", "groupName": "DEFAULT_GROUP", "id": "873475812546842624", "md5": null, "modifyTime": 0, "namespaceId": "public", "type": "text" }, { "appName": "", "createTime": 0, "dataId": "qtc-user.yaml", "groupName": "DEFAULT_GROUP", "id": "873476606771859456", "md5": null, "modifyTime": 0, "namespaceId": "public", "type": "text" } ], "pageNumber": 1, "pagesAvailable": 1, "totalCount": 2 }}3.7 停止Beta配置
Description
停止指定配置的Beta配置
只有在发布配置时设置了
Header的betaIps后,将配置变更为BETA发布中的状态,调用此接口才能停止BETA发布状态。
Since
3.0.0
Request Method
DELETE
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/cs/config/beta
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespaceId | string | No | public | 命名空间 |
dataId | string | Yes | None | 配置ID |
groupName | string | Yes | None | 分组Name |
Response Data
| Name | Type | Description |
|---|---|---|
data | boolean | 操作结果 |
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/cs/config/beta?namespaceId=public&dataId=example&groupName=DEFAULT_GROUP'- Response example
{ "code": 0, "message": "success", "data": true}3.8 查询Beta配置
Description
查询指定配置的Beta配置
只有在发布配置时设置了
Header的betaIps后,将配置变更为BETA发布中的状态,调用此接口才能停止BETA发布状态。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/cs/config/beta
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespaceId | string | No | public | 命名空间 |
dataId | string | Yes | None | 配置ID |
groupName | string | Yes | None | 分组Name |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
id | string | beta配置的存储ID。 |
dataId | string | 配置的dataId。 |
groupName | string | 配置的groupName。 |
namespaceId | string | 配置所属的命名空间。 |
desc | string | 配置描述。 |
md5 | string | 配置内容的MD5值。 |
configTags | string | 配置的标签。 |
encryptedDataKey | string | 加密配置内容的密钥,使用配置加密插件时存在。 |
appName | string | 配置所属的应用名称。 |
type | string | 配置类型。 |
createTime | integer | 配置创建时间。 |
modifyTime | integer | 配置修改时间。 |
createUser | string | 配置创建人。 |
createIp | string | 配置创建IP。 |
grayName | string | 灰度发布规则名称, 固定为beta。 |
grayRule | string | 灰度发布规则,格式为JSON,其中的expr为beta的ip列表。 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/config/beta?namespaceId=public&dataId=example&groupName=DEFAULT_GROUP'- Response example
{ "code": 0, "message": "success", "data": { "appName": "", "configTags": null, "content": "bbb11xxccc", "createIp": null, "createTime": 0, "createUser": "nacos", "dataId": "example", "desc": null, "encryptedDataKey": null, "grayName": "beta", "grayRule": "{\"type\":\"beta\",\"version\":\"1.0.0\",\"expr\":\"1.1.1.1\",\"priority\":2147483647}", "groupName": "DEFAULT_GROUP", "id": "873481464488923136", "md5": "2f080e5e21ba12bb8ca6894ac0fc5862", "modifyTime": 1741683449619, "namespaceId": "public", "type": null }}3.9 导入并发布配置
Description
导入配置并发布到指定命名空间
Since
3.0.0
Request Method
POST
Request body type: multipart/form-data. Parameters are sent in the request body.
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/cs/config/import
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespaceId | string | No | public | |
src_user | string | No | None | |
policy | string | No | ABORT | |
file | MultipartFile | No | ZIP file containing skill package |
Response Data
| Name | Type | Description |
|---|---|---|
data | map<string, object> | Import result. |
data.succCount | integer | 成功导入数量 |
data.skipCount | integer | 跳过导入数量 |
Examples
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/cs/config/import' \-H 'Content-Type: multipart/form-data' \-F 'namespaceId=test' \-F 'file=@/path/to/config.zip'- Response example
{ "code": 0, "message": "success", "data": { "succCount": 10, "skipCount": 2 }}3.10 导出配置
Description
导出指定配置为ZIP文件。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/cs/config/export
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespaceId | string | No | public | |
groupName | string | No | "" | |
dataId | string | No | "" | |
ids | array | No | None | |
appName | string | No | - |
使用时建议分开使用
ids和dataId+groupName的组合,只选择一种方式,另一类传入空字符串,否则可能导致导出文件为空内容。
Response Data
返回体为ZIP文件,包含配置内容和元数据
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/config/export?namespaceId=public&ids=' --output config.zip3.11 克隆配置
Description
克隆配置到指定命名空间
Since
3.0.0
Request Method
POST
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/cs/config/clone
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespaceId | string | Yes | public | |
policy | string | No | ABORT | |
src_user | string | No | - |
Request Parameters
请求体类型为 application/json,为配置列表数组,每项为 SameNamespaceCloneConfigBean(cfgId、dataId、group)。
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
succCount | integer | 成功导入数量 |
skipCount | integer | 跳过导入数量 |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/cs/config/clone' -d "namespaceId=test&policy=ABORT" \-H 'Content-Type: application/json' \-d "[{\"cfgId\":\"838029534438625280\",\"dataId\":\"111\",\"group\":\"DEFAULT_GROUP\"},{\"cfgId\":\"838033747294031872\",\"dataId\":\"qtc-user.yaml\",\"group\":\"DEFAULT_GROUP\"}]"- Response example
{ "code": 0, "message": "success", "data": { "succCount": 2, "skipCount": 0 }}3.12. 查询配置历史列表
Description
获取指定配置的历史版本列表
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/cs/history/list
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespaceId | string | No | public | 命名空间 |
groupName | string | Yes | None | 配置分组名 |
dataId | string | Yes | None | 配置名 |
pageNo | integer | Yes | 1 | 当前页 |
pageSize | integer | Yes | 100(最大为500) | 页条目数 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
totalCount | integer | 历史记录的总数。 |
pageNumber | integer | 当前页码,起始为1。 |
pagesAvailable | integer | 可用页码。 |
pageItems | array | History record list. |
pageItems[i].id | string | 历史记录的ID。 |
pageItems[i].dataId | string | 配置的dataId。 |
pageItems[i].groupName | string | 配置的groupName。 |
pageItems[i].namespaceId | string | 配置所属的命名空间。 |
pageItems[i].appName | string | 配置所属的appName。 |
pageItems[i].opType | string | 操作类型,I为插入、U为更新、D为删除。 |
pageItems[i].publishType | string | 发布类型,formal为普通发布,gray为beta发布。 |
pageItems[i].srcIp | string | 发布的来源IP。 |
pageItems[i].srcUser | string | 发布的用户,仅在开启鉴权并登录用户后才发布配置才存在。 |
pageItems[i].createTime | integer | 配置创建时间。 |
pageItems[i].modifyTime | integer | 配置修改时间。 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/history/list?dataId=nacos.example&groupName=DEFAULT_GROUP&namespaceId=public&pageNo=1&pageSize=100'- Response example
{ "code": 0, "message": "success", "data": { "pageItems": [ { "appName": "", "createTime": 1272988800000, "dataId": "nacos.example", "groupName": "DEFAULT_GROUP", "id": "102", "md5": null, "modifyTime": 1741762032116, "namespaceId": "public", "opType": "D ", "publishType": "formal", "srcIp": "127.0.0.1", "srcUser": "nacos", "type": null }, { "appName": "", "createTime": 1272988800000, "dataId": "nacos.example", "groupName": "DEFAULT_GROUP", "id": "101", "md5": null, "modifyTime": 1741761841295, "namespaceId": "public", "opType": "I ", "publishType": "formal", "srcIp": "127.0.0.1", "srcUser": "nacos", "type": null } ], "pageNumber": 1, "pagesAvailable": 1, "totalCount": 2 }}3.13. 查询配置某一历史版本详情
Description
通过该接口,可以查询配置的某次历史变更记录。
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/cs/history
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| namespaceId | string | No | public | 命名空间 |
| groupName | string | Yes | None | 配置分组名 |
| dataId | string | Yes | None | 配置名 |
| nid | integer | Yes | None | 配置历史Id |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
id | string | 历史记录的ID。 |
dataId | string | 配置的dataId。 |
groupName | string | 配置的groupName。 |
namespaceId | string | 配置所属的命名空间。 |
content | string | |
appName | string | 配置所属的appName。 |
opType | string | 操作类型,I为插入、U为更新、D为删除。 |
publishType | string | 发布类型,formal为普通发布,gray为beta发布。 |
srcIp | string | 发布的来源IP。 |
srcUser | string | 发布的用户,仅在开启鉴权并登录用户后才发布配置才存在。 |
createTime | integer | 配置创建时间。 |
modifyTime | integer | 配置修改时间。 |
grayName | string | 灰度发布规则名称, 固定为beta。 |
extInfo | string | Extended information. It currently includes src_user, type, and c_desc; when publishType is gray, it also includes grayRule. |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/history/??dataId=111&groupName=DEFAULT_GROUP&nid=7'- Response example
{ "code": 0, "data": { "appName": "", "content": "bbb11xx", "createTime": 1272988800000, "dataId": "111", "encryptedDataKey": "", "extInfo": "{\"src_user\":\"nacos\",\"type\":\"text\",\"c_desc\":\"111\"}", "grayName": "", "groupName": "DEFAULT_GROUP", "id": "7", "md5": "7d37afdb0b04d958d529bcb6de44fa71", "modifyTime": 1741682102157, "namespaceId": "public", "opType": "I ", "publishType": "formal", "srcIp": "0:0:0:0:0:0:0:1", "srcUser": "nacos", "type": null }, "message": "success"}3.14. 查询配置上一版本信息
Description
获取指定配置的上一版本
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/cs/history/previous
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| namespaceId | string | No | public | 命名空间 |
| groupName | string | Yes | None | 配置分组名 |
| dataId | string | Yes | None | 配置名 |
| id | integer | Yes | None | 配置Id |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
id | string | 历史记录的ID。 |
dataId | string | 配置的dataId。 |
groupName | string | 配置的groupName。 |
namespaceId | string | 配置所属的命名空间。 |
content | string | |
appName | string | 配置所属的appName。 |
opType | string | 操作类型,I为插入、U为更新、D为删除。 |
publishType | string | 发布类型,formal为普通发布,gray为beta发布。 |
srcIp | string | 发布的来源IP。 |
srcUser | string | 发布的用户,仅在开启鉴权并登录用户后才发布配置才存在。 |
createTime | integer | 配置创建时间。 |
modifyTime | integer | 配置修改时间。 |
grayName | string | 灰度发布规则名称, 固定为beta。 |
extInfo | string | Extended information. It currently includes src_user, type, and c_desc; when publishType is gray, it also includes grayRule. |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/history/previous?id=101&dataId=nacos.example&groupName=DEFAULT_GROUP&namespaceId=public'- Response example
{ "code": 0, "data": { "appName": "", "content": "bbb11xx", "createTime": 1272988800000, "dataId": "nacos.example", "encryptedDataKey": "", "extInfo": "{\"src_user\":\"nacos\",\"type\":\"text\",\"c_desc\":\"111\"}", "grayName": "", "groupName": "DEFAULT_GROUP", "id": "7", "md5": "7d37afdb0b04d958d529bcb6de44fa71", "modifyTime": 1741682102157, "namespaceId": "public", "opType": "I ", "publishType": "formal", "srcIp": "0:0:0:0:0:0:0:1", "srcUser": "nacos", "type": null }, "message": "success"}3.15. 查询指定命名空间下的配置列表
Description
获取指定命名空间下的配置信息列表
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/cs/history/configs
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| namespaceId | string | Yes | None | 命名空间 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
dataId | string | 配置的dataId。 |
groupName | string | 配置的groupName。 |
其他字段均无用。
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/history/configs?namespaceId=public'- Response example
{ "code": 0, "message": "success", "data": [ { "appName": "", "createTime": 0, "dataId": "111", "groupName": "DEFAULT_GROUP", "id": "0", "md5": null, "modifyTime": 1741682102161, "namespaceId": "public", "type": "text" }, { "appName": "", "createTime": 0, "dataId": "qtc-user.yaml", "groupName": "DEFAULT_GROUP", "id": "0", "md5": null, "modifyTime": 1741682291519, "namespaceId": "public", "type": "text" } ]}3.16 查询容量信息
Description
查询指定分组或命名空间的容量信息
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/cs/capacity
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
groupName | string | No | None | 分组Name |
namespaceId | string | No | None | 命名空间ID |
注意 :groupName 和 namespaceId 至少需要提供一个。
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
id | integer | 容量信息的唯一ID |
groupName | string | 分组Name |
namespaceId | string | 命名空间ID |
quota | integer | 配额 |
usage | integer | 当前使用量 |
maxSize | integer | 最大单配置大小 |
gmtCreate | string | 创建时间,将废弃 |
gmtModified | string | 最后修改时间,将废弃 |
maxAggrCount | integer | 未使用,将废弃 |
maxAggrSize | integer | 未使用,将废弃 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/capacity?namespaceId=public'- Response example
{ "code": 0, "message": "success", "data": { "gmtCreate": null, "gmtModified": null, "id": "1", "maxAggrCount": 10000, "maxAggrSize": 1024, "maxSize": 102400, "namespaceId": "public", "quota": 200, "usage": 2 }}3.17 更新容量信息
Description
更新指定分组或命名空间的容量信息。如果容量信息未初始化,则会自动初始化
Since
3.0.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/cs/capacity
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
groupName | string | Yes | 分组Name,与命名空间ID 两者必须有其一 |
namespaceId | string | No | 命名空间ID,与分组Name 两者必须有其一 |
quota | integer | No | 配额 |
maxSize | integer | No | 最大大小 |
maxAggrCount | integer | No | - |
maxAggrSize | integer | No | - |
Response Data
| Name | Type | Description |
|---|---|---|
data | boolean | 操作结果 |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/cs/capacity' -d 'namespaceId=public"a=200&maxSize=2048'- Response example
{ "code": 0, "message": "success", "data": true}3.18 手动触发本地缓存更新
Description
手动触发从存储中加载所有配置数据到本地缓存。
Since
3.0.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/cs/ops/localCache
Request Parameters
无
Response Data
| Name | Type | Description |
|---|---|---|
data | string | 操作结果 |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/cs/ops/localCache'- Response example
{ "code": 0, "message": "success", "data": "Local cache updated from store successfully!"}3.19 设置日志级别
Description
动态设置指定模块的日志级别
Since
3.0.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/cs/ops/log
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
logName | string | Yes | None | 模块Name |
logLevel | string | Yes | None | 日志级别(如INFO、DEBUG) |
Response Data
| Name | Type | Description |
|---|---|---|
data | string | 操作结果 |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/cs/ops/log' -d "logName=config-server&logLevel=DEBUG"- Response example
{ "code": 0, "message": "success", "data": "Log level updated successfully! Module: com.alibaba.nacos, Log Level: DEBUG"}3.20 执行Derby数据库操作
Description
执行Derby数据库的查询操作(仅支持 SELECT 语句)
注意 此接口需要开启
nacos.config.derby.ops.enabled配置,且数据库为Derby时才可使用,仅提供给运维人员进行Derby数据库排查数据问题时使用。
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/cs/ops/derby
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
sql | string | Yes | None | SQL 查询语句 |
Response Data
| Name | Type | Description |
|---|---|---|
data | array | Query result. |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/ops/derby?sql=SELECT%20*%20FROM%20config_info'- Response example
{ "code": 0, "message": "success", "data": [ { "APP_NAME": "", "CONTENT": "bbb11xx", "C_DESC": "111", "C_SCHEMA": null, "C_USE": null, "DATA_ID": "111", "EFFECT": null, "ENCRYPTED_DATA_KEY": "", "GMT_CREATE": "2025-03-11T08:35:02.161+00:00", "GMT_MODIFIED": "2025-03-11T08:35:02.161+00:00", "GROUP_ID": "DEFAULT_GROUP", "ID": 873475812546842624, "MD5": "7d37afdb0b04d958d529bcb6de44fa71", "SRC_IP": "0:0:0:0:0:0:0:1", "SRC_USER": "nacos", "TENANT_ID": "public", "TYPE": "text" } ]}若未开启功能,则返回
{ "code": 30000, "data": null, "message": "Derby ops is disabled, please set `nacos.config.derby.ops.enabled=true` to enabled this feature."}3.21 导入Derby数据库数据
Description
从外部数据源导入数据到Derby数据库
注意 此接口需要开启
nacos.config.derby.ops.enabled配置,且数据库为Derby时才可使用,仅提供给运维人员进行Derby数据库排查数据问题时使用。
Since
3.0.0
Request Method
POST
请求体类型:multipart/form-data,参数放在请求体中。
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/cs/ops/derby/import
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
file | MultipartFile | No | None | 导入文件(SQL 文件)。 |
Response Data
| Name | Type | Description |
|---|---|---|
data | string | 导入结果信息 |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/cs/ops/derby/import' \-H 'Content-Type: multipart/form-data' \-F 'file=@data.sql'- Response example
{ "code": 0, "message": "success", "data": "Data imported successfully!"}3.22 获取客户端订阅信息
Description
获取指定 IP 客户端的订阅配置信息
Since
3.0.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/cs/listener
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
ip | string | Yes | None | 客户端 IP 地址 |
all | boolean | No | false | 是否返回所有配置信息 |
namespaceId | string | No | public | 命名空间ID |
aggregation | boolean | No | true | 是否从其他节点聚合 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
queryType | string | 订阅者查询Type,该接口为ip。 |
listenersStatus | map<string, string> | 订阅者列表,key为订阅的配置信息,格式为dataId+groupName+namespaceId,value为订阅者订阅当前配置的MD5值。 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/listener?ip=127.0.0.1&namespaceId=public'- Response example
{ "code": 0, "message": "success", "data": { "listenersStatus": { "qtc-user.yaml+DEFAULT_GROUP+public": "32cacc65accfdab47954de3fc781e938" }, "queryType": "ip" }}3.23 获取集群客户端指标
Description
获取集群中指定 IP 客户端的配置指标信息
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/cs/metrics/cluster
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
ip | string | Yes | None | 客户端 IP 地址 |
dataId | string | No | None | 配置ID |
groupName | string | No | None | 分组Name |
namespaceId | string | No | public | 命名空间ID |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
data | 服务信息 | |
data.{namespaceId}.isFixedServer | boolean | 是否固定服务器 |
data.{namespaceId}.snapshotDir | string | 快照目录路径 |
data.{namespaceId}.clientVersion | string | 客户端版本 |
data.{namespaceId}.serverUrls | string | 服务器URL列表 |
data.{namespaceId}.listenConfigSize | integer | 监听配置大小 |
data.{namespaceId}.metricValues.cacheData | string | 缓存数据md5值 |
data.{namespaceId}.metricValues.snapshotData | string | 快照数据md5值 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/metrics/cluster?ip=127.0.0.1&dataId=example&groupName=DEFAULT_GROUP&namespaceId=public'- Response example
{ "code": 0, "message": "success", "data": { "a981e0a8-f394-425c-ac2a-ab753586428b": { "isFixedServer": true, "snapshotDir": "/path/to/nacos/config", "clientVersion": "Nacos-Java-Client:v2.1.0", "serverUrls": "http://127.0.0.1:8848", "listenConfigSize": 1, "metricValues": { "cacheData": "asdasd:a8f5f167f44f4964e6c998dee827110c", "snapshotData": "asdasd:a8f5f167f44f4964e6c998dee827110c" } } }}3.24 获取本地客户端指标
Description
获取本地机器上指定 IP 客户端指标信息
Since
3.0.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/cs/metrics/ip
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
ip | string | Yes | None | 客户端 IP 地址 |
dataId | string | No | None | 配置ID |
groupName | string | No | None | 分组Name |
namespaceId | string | No | public | 命名空间 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
data | 服务信息 | |
data.{namespaceId}.isFixedServer | boolean | 是否固定服务器 |
data.{namespaceId}.snapshotDir | string | 快照目录路径 |
data.{namespaceId}.clientVersion | string | 客户端版本 |
data.{namespaceId}.serverUrls | string | 服务器URL列表 |
data.{namespaceId}.listenConfigSize | integer | 监听配置大小 |
data.{namespaceId}.metricValues.cacheData | string | 缓存数据md5值 |
data.{namespaceId}.metricValues.snapshotData | string | 快照数据md5值 |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/metrics/ip?ip=127.0.0.1&dataId=example&groupName=DEFAULT_GROUP&namespaceId=public'- Response example
{ "code": 0, "message": "success", "data": { "a981e0a8-f394-425c-ac2a-ab753586428b": { "isFixedServer": true, "snapshotDir": "/path/to/nacos/config", "clientVersion": "Nacos-Java-Client:v2.1.0", "serverUrls": "http://127.0.0.1:8848", "listenConfigSize": 1, "metricValues": { "cacheData": "asdasd:a8f5f167f44f4964e6c998dee827110c", "snapshotData": "asdasd:a8f5f167f44f4964e6c998dee827110c" } } }}3.25. 更新配置元数据
Description
通过该接口,可以更新配置的元数据信息:仅能更新Description和标签。
Since
3.1.0
Request Method
PUT
Authorization
需要具有对应命名空间写入权限的用户身份。
Request URL
/nacos/v3/admin/cs/config/metadata
Request Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
dataId | string | Yes | None | 配置ID |
groupName | string | Yes | None | 分组Name |
namespaceId | string | No | public | 命名空间 |
desc | string | No | null | 配置的新Description |
configTags | string | No | null | 配置的新标签 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
data | boolean | 操作结果 |
Examples
- Request example
curl -X PUT '127.0.0.1:8848/v3/admin/cs/config/metadata' \-d 'namespaceId=public' \-d 'groupName=DEFAULT_GROUP' \-d 'dataId=test' \-d 'desc=testDesc' \-d 'configTags=customTag'- Response example
{ "code" : 0, "message" : "success", "data" : true}3.26. Get Gray Configuration
Description
This interface retrieves the details of a specified gray configuration.
Since
3.2.2
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/cs/config/gray
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID. Defaults to public when omitted. |
groupName | string | Yes | Configuration group name. |
dataId | string | Yes | Configuration ID. |
grayName | string | Yes | Gray configuration name. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.dataId | string | Configuration ID. |
| data.groupName | string | Configuration group name. |
| data.namespaceId | string | Namespace ID. |
| data.content | string | Gray configuration content. |
| data.grayName | string | Gray configuration name. |
| data.grayRule | string | Gray matching rule. |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/config/gray?namespaceId=public&groupName=DEFAULT_GROUP&dataId=example&grayName=gray'- Response example
{ "code": 0, "message": "success", "data": {}}3.27. Publish Gray Configuration
Description
This interface publishes a gray configuration using tagv2 gray matching rules.
Since
3.2.2
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/cs/config/gray
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID. Defaults to public when omitted. |
groupName | string | Yes | Configuration group name. |
dataId | string | Yes | Configuration ID. |
content | string | Yes | Gray configuration content. |
grayName | string | Yes | Gray configuration name. |
grayType | string | No | Gray rule type. |
grayMatchRuleExp | string | Yes | Gray matching rule expression. |
grayVersion | string | Yes | Gray version. |
grayPriority | integer | No | Gray rule priority. |
type | string | No | Configuration type. |
srcUser | string | No | Operator username. |
encryptedDataKey | string | No | Data key for encrypted configuration content. |
Response Data
| Name | Type | Description |
|---|---|---|
| data | boolean | Whether the gray configuration was published successfully. |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/cs/config/gray' \ -d 'namespaceId=public' \ -d 'groupName=DEFAULT_GROUP' \ -d 'dataId=example' \ -d 'content=gray-content' \ -d 'grayName=gray' \ -d 'grayType=tagv2' \ -d 'grayMatchRuleExp=tag=gray' \ -d 'grayVersion=1' \ -d 'grayPriority=1'- Response example
{ "code": 0, "message": "success", "data": true}3.28. Delete Gray Configuration
Description
This interface deletes a specified gray configuration.
Since
3.2.2
Request Method
DELETE
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/cs/config/gray
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID. Defaults to public when omitted. |
groupName | string | Yes | Configuration group name. |
dataId | string | Yes | Configuration ID. |
grayName | string | Yes | Gray configuration name. |
Response Data
| Name | Type | Description |
|---|---|---|
| data | boolean | Whether the gray configuration was deleted successfully. |
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/cs/config/gray?namespaceId=public&groupName=DEFAULT_GROUP&dataId=example&grayName=gray'- Response example
{ "code": 0, "message": "success", "data": true}4. MCP 管理
4.1. 查询MCP服务的服务列表
Description
通过该接口,可以查询托管在Nacos上的MCP服务的服务列表。
Since
3.0.1
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ai/mcp/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pageNo | integer | Yes | 当前页,默认为1 |
pageSize | integer | Yes | 页条目数,默认为20,最大为500 |
namespaceId | string | No | MCP服务的命名空间ID,默认为public |
mcpName | string | No | MCP服务的名字模版,为空时查询所有MCP服务,当search为blur时,可使用*进行模糊搜索 |
search | string | No | Search mode: blur or accurate. Defaults to blur. |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
totalCount | integer | 符合条件的服务的总数。 |
pageNumber | integer | 当前页码,起始为1。 |
pagesAvailable | integer | 可用页码。 |
pageItems | array | Service list. |
pageItems[i].id | string | MCP service ID, usually a UUID. |
pageItems[i].name | string | MCP service name. |
pageItems[i].protocol | string | MCP protocol, such as stdio, sse, streamable, http, or dubbo. |
pageItems[i].frontProtocol | string | Frontend protocol exposed by the MCP service, usually for protocol converters such as gateways. If no converter is used, it is the same as protocol. |
pageItems[i].description | string | MCP service description. |
pageItems[i].repository | string | MCP service repository. |
pageItems[i].versionDetail | object | Latest version information of the MCP service. |
pageItems[i].localServerConfig | map<string, object> | Startup information for a local MCP service when the MCP service type is stdio. |
pageItems[i].remoteServerConfig | object | Remote service information when the MCP service type is not stdio. |
pageItems[i].latestPublishedVersion | string | Latest published version of the MCP service. |
pageItems[i].versionDetails | array | MCP service version details. |
pageItems[i].capabilities | array | Capability types supported by the MCP service, such as TOOL, PROMPT, and RESOURCE. |
其中VersionDetail结构如下:
| Name | Type | Description |
|---|---|---|
version | string | MCP service version. |
release_date | string | MCP service release time. |
is_latest | boolean | Whether this is the latest version of the MCP service. |
Examples
- Request example
curl -X GET '127.0.0.1:8848/nacos/v3/admin/ai/mcp/list?pageNo=1&pageSize=100&namespaceId=public&search=blur'- Response example
{ "code": 0, "message": "success", "data": { "totalCount": 1, "pageNumber": 1, "pagesAvailable": 1, "pageItems": [ { "id": "d7a64724-a556-4fe4-82fa-e806d43e00dc", "name": "test", "protocol": "stdio", "frontProtocol": "stdio", "description": "ceshi", "repository": null, "versionDetail": { "version": "1.0.0", "release_date": "2025-05-22T06:40:37Z", "is_latest": null }, "remoteServerConfig": null, "localServerConfig": null, "enabled": true, "capabilities": null, "latestPublishedVersion": "1.0.0", "versionDetails": [ { "version": "1.0.0", "release_date": "2025-05-22T06:40:37Z", "is_latest": null } ] } ] }}4.2. 查询MCP服务的详情
Description
通过该接口,可以查询托管在Nacos上指定MCP服务的服务的详细信息。
Since
3.0.1
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ai/mcp
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | MCP服务的命名空间ID,默认为public |
mcpId | string | No | MCP服务的ID,一般为UUID,与mcpName二选一输入,建议传入此值。 |
mcpName | string | No | MCP服务的名字模版,与mcpId二选一输入,建议传入mcpId。 |
version | string | No | MCP服务的版本,未传入是返回最新版本 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
id | string | MCP服务的ID,一般为UUID。 |
name | string | MCP服务名。 |
namespaceId | string | MCP服务所属的命名空间ID。 |
protocol | string | MCP的协议,如stdio,sse,streamable,http,dubbo等。 |
frontProtocol | string | MCP的前端暴露协议,一般是提供给协议转换器(如网关)使用,若无转换器,则与protocol相同,如stdio,sse,streamable,http,dubbo等。 |
description | string | MCP服务的描述。 |
repository | string | MCP服务的存储仓库。 |
versionDetail | object | Queried version information of the MCP service. |
localServerConfig | map<string, object> | Startup information for a local MCP service when the MCP service type is stdio. |
remoteServerConfig | object | Remote service information when the MCP service type is not stdio. |
enabled | boolean | MCP服务是否启用。 |
capabilities | array | Capability types supported by the MCP service, such as TOOL, PROMPT, and RESOURCE. |
backendEndpoints | array | Backend endpoint details when the MCP service type is not stdio. |
toolSpec | map<string, object> | Tool details when the MCP service supports the TOOL capability. |
allVersions | array | All version details of the MCP service. |
其中VersionDetail结构如下:
| Name | Type | Description |
|---|---|---|
version | string | MCP service version. |
release_date | string | MCP service release time. |
is_latest | boolean | Whether this is the latest version of the MCP service. |
Examples
- Request example
curl -X GET '127.0.0.1:8848/nacos/v3/admin/ai/mcp?namespaceId=public&mcpName=test&mcpId=d7a64724-a556-4fe4-82fa-e806d43e00dc'- Response example
{ "code": 0, "message": "success", "data": { "id": "d7a64724-a556-4fe4-82fa-e806d43e00dc", "name": "test", "protocol": "stdio", "frontProtocol": "stdio", "description": "ceshi", "repository": null, "versionDetail": { "version": "1.0.0", "release_date": "2025-05-22T06:40:37Z", "is_latest": true }, "remoteServerConfig": null, "localServerConfig": { "test": {} }, "enabled": true, "capabilities": [], "backendEndpoints": null, "toolSpec": null, "allVersions": [ { "version": "1.0.0", "release_date": "2025-05-22T06:40:37Z", "is_latest": true } ], "namespaceId": "public" }}4.3. 更新MCP服务
Description
通过该接口,可以更新托管在Nacos上的MCP服务。
Since
3.0.1
Request Method
PUT
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ai/mcp
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | MCP服务的命名空间ID,默认为public |
serverSpecification | string | Yes | MCP服务的描述详情 |
toolSpecification | string | No | MCP服务的工具描述详情 |
endpointSpecification | string | No | MCP服务的远端服务地址详情,仅在非stdio协议时生效 |
overrideExisting | boolean | No | MCP服务更新时是否覆盖原 endpointSpecification,仅在非stdio协议时生效 |
latest | boolean | No | - |
其中serverSpecification、toolSpecification、endpointSpecification参数的详细内容如下:
serverSpecification
| Name | Type | Description |
|---|---|---|
id | string | MCP服务的ID,一般为UUID,必须传入,用于定位待更新的MCP服务。 |
name | string | MCP服务名。 |
protocol | string | MCP的协议,如stdio,sse,streamable,http,dubbo等。 |
frontProtocol | string | MCP的前端暴露协议,一般是提供给协议转换器(如网关)使用,若无转换器,则与protocol相同,如stdio,sse,streamable,http,dubbo等。 |
description | string | MCP服务的描述。 |
repository | string | MCP服务的存储仓库。 |
versionDetail | object | MCP service version information. |
version | string | MCP服务的简易版本版本信息,主要用于兼容,若已设置versionDetail,则该字段无效。 |
localServerConfig | map<string, object> | Startup information for a local MCP service when the MCP service type is stdio. |
remoteServerConfig | object | Remote service information when the MCP service type is not stdio. |
enabled | boolean | MCP服务是否启用。 |
capabilities | array | Capability types supported by the MCP service, such as TOOL, PROMPT, and RESOURCE. |
其中VersionDetail结构如下:
| Name | Type | Description |
|---|---|---|
version | string | MCP服务的版本号。 |
release_date | string | MCP服务的版本发布时间。 |
is_latest | boolean | MCP服务的版本是否为最新版本。 |
toolSpecification
| Name | Type | Description |
|---|---|---|
tools | array | Tool list provided by the MCP Server. See the standard MCP protocol definition of MCP Tool. |
toolsMeta | map<string, object> | Extra metadata for tools provided by the MCP Server. This can extend information not defined in the standard MCP protocol. The key is the name of McpTool, and the value is the extended metadata. |
securitySchemes | array | MCP tool security schemes. See the standard MCP protocol. |
其中McpTool结构如下:
| Name | Type | Description |
|---|---|---|
name | string | MCP 工具的名称 |
description | string | MCP 工具的描述 |
inputSchema | map<string, object> | MCP tool input schema. See the standard MCP protocol; it mainly includes type, required flag, and description. |
其中McpToolMeta 结构如下:
| Name | Type | Description |
|---|---|---|
invokeContext | map<string, string> | MCP 工具调用时的上下文信息,如后端服务的Path等。 |
enabled | boolean | MCP工具是否启用。 |
templates | map<string, string> | MCP工具的模板信息。用于进行协议转换时进行参数的映射。 |
其中SecurityScheme 结构如下:
| Name | Type | Description |
|---|---|---|
id | string | 安全方案的ID,将被MCP工具使用和引用。。 |
type | string | 安全方案的类型。可能的值包括:http、apiKey、localEnv或其他自定义扩展。 |
scheme | string | 安全方案的子方案类型。当 type 为 http 时使用。可能的值包括:basic 或 bearer。 |
in | string | 安全方案的位置。可能的值有:query、header。 |
name | string | 安全方案的名称。当 type 为 apiKey 或 localEnv 时使用。例如,apiKey 的密钥名称或 localEnv 的环境名称。 |
defaultCredential | string | 当配置参数中未输入身份时的默认凭证。可选。 |
endpointSpecification
| Name | Type | Description |
|---|---|---|
type | string | MCP endpoint的后端服务类型,可选值REF和DIRECT. |
data | map<string, string> | MCP endpoint的后端服务的实际数据, 根据type的不同,传入的参数不同,如REF传入的为namespaceId, groupName 和 serviceName;DIRECT传入的为address 和 port。 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
data | string | MCP服务更新结果。 |
Examples
- Request example
curl -X PUT '127.0.0.1:8848/nacos/v3/admin/ai/mcp' \-d 'namespaceId=public' \-d 'mcpName=test' \-d 'serverSpecification={"protocol":"stdio","frontProtocol":"stdio","name":"test","id":"d7a64724-a556-4fe4-82fa-e806d43e00dc","description":"ceshi","versionDetail":{"version":"1.0.0"},"enabled":true,"localServerConfig":{"test":{}}}'- Response example
{ "code" : 0, "message" : "success", "data" : "ok"}4.4. 创建MCP服务
Description
通过该接口,可以创建托管在Nacos上的MCP服务,可以是存量API转换的MCP服务,也可以是MCP市场中的MCP服务。
Since
3.0.1
Request Method
POST
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ai/mcp
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | MCP服务的命名空间ID,默认为public |
serverSpecification | string | Yes | MCP服务的描述详情 |
toolSpecification | string | No | MCP服务的工具描述详情 |
endpointSpecification | string | No | MCP服务的远端服务地址详情,仅在非stdio协议时生效 |
其中serverSpecification、toolSpecification、endpointSpecification参数的详细内容如下:
serverSpecification
| Name | Type | Description |
|---|---|---|
id | string | MCP服务的ID,一般为UUID,无需传入,系统自动生成。 |
name | string | MCP服务名。 |
protocol | string | MCP的协议,如stdio,sse,streamable,http,dubbo等。 |
frontProtocol | string | MCP的前端暴露协议,一般是提供给协议转换器(如网关)使用,若无转换器,则与protocol相同,如stdio,sse,streamable,http,dubbo等。 |
description | string | MCP服务的描述。 |
repository | string | MCP服务的存储仓库。 |
versionDetail | object | MCP service version information. |
version | string | MCP服务的简易版本版本信息,主要用于兼容,若已设置versionDetail,则该字段无效。 |
localServerConfig | map<string, object> | Startup information for a local MCP service when the MCP service type is stdio. |
remoteServerConfig | object | Remote service information when the MCP service type is not stdio. |
enabled | boolean | MCP服务是否启用。 |
capabilities | array | Capability types supported by the MCP service, such as TOOL, PROMPT, and RESOURCE. |
其中VersionDetail结构如下:
| Name | Type | Description |
|---|---|---|
version | string | MCP服务的版本号。 |
release_date | string | MCP服务的版本发布时间。 |
is_latest | boolean | MCP服务的版本是否为最新版本。 |
toolSpecification
| Name | Type | Description |
|---|---|---|
tools | array | Tool list provided by the MCP Server. See the standard MCP protocol definition of MCP Tool. |
toolsMeta | map<string, object> | Extra metadata for tools provided by the MCP Server. This can extend information not defined in the standard MCP protocol. The key is the name of McpTool, and the value is the extended metadata. |
securitySchemes | array | MCP tool security schemes. See the standard MCP protocol. |
其中McpTool结构如下:
| Name | Type | Description |
|---|---|---|
name | string | MCP 工具的名称 |
description | string | MCP 工具的描述 |
inputSchema | map<string, object> | MCP tool input schema. See the standard MCP protocol; it mainly includes type, required flag, and description. |
其中McpToolMeta 结构如下:
| Name | Type | Description |
|---|---|---|
invokeContext | map<string, string> | MCP 工具调用时的上下文信息,如后端服务的Path等。 |
enabled | boolean | MCP工具是否启用。 |
templates | map<string, string> | MCP工具的模板信息。用于进行协议转换时进行参数的映射。 |
其中SecurityScheme 结构如下:
| Name | Type | Description |
|---|---|---|
id | string | 安全方案的ID,将被MCP工具使用和引用。。 |
type | string | 安全方案的类型。可能的值包括:http、apiKey、localEnv或其他自定义扩展。 |
scheme | string | 安全方案的子方案类型。当 type 为 http 时使用。可能的值包括:basic 或 bearer。 |
in | string | 安全方案的位置。可能的值有:query、header。 |
name | string | 安全方案的名称。当 type 为 apiKey 或 localEnv 时使用。例如,apiKey 的密钥名称或 localEnv 的环境名称。 |
defaultCredential | string | 当配置参数中未输入身份时的默认凭证。可选。 |
endpointSpecification
| Name | Type | Description |
|---|---|---|
type | string | MCP endpoint的后端服务类型,可选值REF和DIRECT. |
data | map<string, string> | MCP endpoint的后端服务的实际数据, 根据type的不同,传入的参数不同,如REF传入的为namespaceId, groupName 和 serviceName;DIRECT传入的为address 和 port。 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
data | string | 新建MCP服务的id。 |
Examples
- Request example
curl -X POST '127.0.0.1:8848/nacos/v3/admin/ai/mcp' \-d 'namespaceId=public' \-d 'mcpName=test' \-d 'serverSpecification={"protocol":"stdio","frontProtocol":"stdio","name":"test","id":"","description":"ceshi","versionDetail":{"version":"1.0.0"},"enabled":true,"localServerConfig":{"test":{}}}'- Response example
{ "code" : 0, "message" : "success", "data" : "58e5b430-b16d-4f28-9334-edb64303dc23"}4.5. 删除MCP服务
Description
通过该接口,可以删除托管在Nacos上的MCP服务。
Since
3.0.1
Request Method
DELETE
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ai/mcp
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | MCP服务的命名空间ID,默认为public |
mcpId | string | No | MCP服务的ID,一般为UUID,与mcpName二选一输入,建议传入此值。 |
mcpName | string | No | MCP服务的名字模版,与mcpId二选一输入,建议传入mcpId。 |
version | string | No | MCP服务的版本,未传入是为最新版本 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
data | string | MCP服务删除结果。 |
Examples
- Request example
curl -X DELETE '127.0.0.1:8848/nacos/v3/admin/ai/mcp?namespaceId=public&mcpName=test&mcpId=d7a64724-a556-4fe4-82fa-e806d43e00dc'- Response example
{ "code" : 0, "message" : "success", "data" : "ok"}5. A2A注册中心
5.1. 查询指定AgentCard的版本列表
Description
通过该接口,可以查询指定托管在Nacos上的AgentCard的版本列表。
Since
3.1.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ai/a2a/version/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | AgentCard所属的命名空间,默认public |
agentName | string | Yes | AgentCard的名称 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
data[i].version | string | AgentCard的版本号。 |
data[i].createdAt | string | 该版本的创建时间。 |
data[i].updatedAt | string | 该版本的最后更新时间。 |
data[i].latest | boolean | 该版本是否标记为最新发布版本。 |
Examples
- Request example
curl -X GET '127.0.0.1:8848/nacos/v3/admin/ai/a2a/version/list?namespaceId=public&agentName=GeoSpatial+Route+Planner+Agent'- Response example
{ "code" : 0, "message" : "success", "data" : [ { "version" : "1.2.0", "createdAt" : "2025-09-12T03:33:51Z", "updatedAt" : "2025-09-12T07:21:49Z", "latest" : true } ]}5.2. 查询AgentCard的列表
Description
通过该接口,可以查询托管在Nacos上的AgentCard的列表。
Since
3.1.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ai/a2a/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pageNo | integer | Yes | 当前页,默认为1 |
pageSize | integer | Yes | 页条目数,默认为100 |
namespaceId | string | No | AgentCard的命名空间ID,默认为public |
agentName | string | No | AgentCard的名称,为空是查询所有AgentCard |
search | string | No | blur or accurate |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
totalCount | integer | 符合条件的服务的总数。 |
pageNumber | integer | 当前页码,起始为1。 |
pagesAvailable | integer | 可用页码。 |
pageItems | array | Service list. |
pageItems[i].protocolVersion | string | A2A protocol version of the AgentCard. |
pageItems[i].name | string | AgentCard name. |
pageItems[i].description | string | AgentCard description. |
pageItems[i].version | string | AgentCard version. |
pageItems[i].iconUrl | string | AgentCard icon URL. |
pageItems[i].capabilities | object | AgentCard capabilities, matching A2A standard capabilities. |
pageItems[i].skills | array | AgentCard skill list, matching A2A standard skill. |
pageItems[i].latestPublishedVersion | string | Latest published version of the AgentCard. |
pageItems[i].versionDetails | array | All version details of the AgentCard. |
pageItems[i].registrationType | string | Default registration type of the AgentCard. Optional values are URL and SERVICE. |
其中AgentVersionDetail包含内容如下:
| Name | Type | Description |
|---|---|---|
version | string | AgentCard version. |
createdAt | string | Creation time of this version. |
updatedAt | string | Last update time of this version. |
latest | boolean | Whether this version is marked as the latest published version. |
Examples
- Request example
curl -X GET '127.0.0.1:8848/nacos/v3/admin/ai/a2a/list?pageNo=1&pageSize=100&namespaceId=public&search=blur'- Response example
{ "code" : 0, "message" : "success", "data" : { "totalCount" : 1, "pageNumber" : 1, "pagesAvailable" : 1, "pageItems" : [ { "protocolVersion" : "0.2.9", "name" : "GeoSpatial Route Planner Agent", "description" : "Provides advanced route planning, traffic analysis, and custom map generation services. This agent can calculate optimal routes, estimate travel times considering real-time traffic, and create personalized maps with points of interest.", "version" : "1.2.0", "iconUrl" : "https://georoute-agent.example.com/icon.png", "capabilities" : { "streaming" : true, "pushNotifications" : true, "stateTransitionHistory" : false, "extensions" : null }, "skills" : [ { "id" : "route-optimizer-traffic", "name" : "Traffic-Aware Route Optimizer", "description" : "Calculates the optimal driving route between two or more locations, taking into account real-time traffic conditions, road closures, and user preferences (e.g., avoid tolls, prefer highways).", "tags" : [ "maps", "routing", "navigation", "directions", "traffic" ], "examples" : [ "Plan a route from '1600 Amphitheatre Parkway, Mountain View, CA' to 'San Francisco International Airport' avoiding tolls.", "{\"origin\": {\"lat\": 37.422, \"lng\": -122.084}, \"destination\": {\"lat\": 37.7749, \"lng\": -122.4194}, \"preferences\": [\"avoid_ferries\"]}" ], "inputModes" : [ "application/json", "text/plain" ], "outputModes" : [ "application/json", "application/vnd.geo+json", "text/html" ] }, { "id" : "custom-map-generator", "name" : "Personalized Map Generator", "description" : "Creates custom map images or interactive map views based on user-defined points of interest, routes, and style preferences. Can overlay data layers.", "tags" : [ "maps", "customization", "visualization", "cartography" ], "examples" : [ "Generate a map of my upcoming road trip with all planned stops highlighted.", "Show me a map visualizing all coffee shops within a 1-mile radius of my current location." ], "inputModes" : [ "application/json" ], "outputModes" : [ "image/png", "image/jpeg", "application/json", "text/html" ] } ], "latestPublishedVersion" : "1.2.0", "versionDetails" : [ { "version" : "1.2.0", "createdAt" : "2025-09-12T03:33:51Z", "updatedAt" : "2025-09-12T07:21:49Z", "latest" : true } ], "registrationType" : "URL" } ] }}5.3. 查询AgentCard的详情
Description
通过该接口,可以查询托管在Nacos上指定AgentCard的详细信息。
Since
3.1.0
Request Method
GET
Authorization
需对应命名空间的读权限
Request URL
/nacos/v3/admin/ai/a2a
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | AgentCard所属的命名空间,默认public |
agentName | string | Yes | AgentCard的名称 |
version | string | No | AgentCard的版本号,为空时返回最新版本详情 |
registrationType | string | No | AgentCard的默认注册类型,可选URL和SERVICE。未填写时根据此AgentCard的默认registrationType进行url的生成 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
protocolVersion | string | AgentCard的A2A协议版本。 |
name | string | AgentCard的名称。 |
description | string | AgentCard的描述。 |
version | string | AgentCard的版本号。 |
iconUrl | string | AgentCard的iconURL。 |
capabilities | object | AgentCard capabilities, matching A2A standard capabilities. |
skills | array | AgentCard skill list, matching A2A standard skill. |
url | string | AgentCard的默认访问的URL。 |
preferredTransport | string | AgentCard的默认访问URL的传输协议,应该为JSONRPC,GRPC,HTTP+JSON。 |
additionalInterfaces | array | All accessible interfaces of the AgentCard, matching the A2A standard. |
provider | object | AgentCard provider information, matching the A2A standard. |
documentationUrl | string | AgentCard的文档 URL。 |
securitySchemes | map<string, object> | AgentCard security scheme definitions, matching the A2A standard. |
security | array | All security requirement objects of the AgentCard. |
defaultInputModes | array | All default input modes of the AgentCard. |
defaultOutputModes | array | All default output modes of the AgentCard. |
supportsAuthenticatedExtendedCard | string | AgentCard是否支持认证的扩展卡。 |
registrationType | string | AgentCard的默认注册类型,可选URL和SERVICE。 |
latestVersion | string | AgentCard当前版本时否为最新版本。 |
Examples
- Request example
curl -X GET '127.0.0.1:8848/nacos/v3/admin/ai/a2a?namespaceId=public&agentName=GeoSpatial+Route+Planner+Agent&version=1.0.0®istrationType=SERVICE'- Response example
{ "code" : 0, "message" : "success", "data" : { "protocolVersion" : "0.2.9", "name" : "GeoSpatial Route Planner Agent", "description" : "Provides advanced route planning, traffic analysis, and custom map generation services. This agent can calculate optimal routes, estimate travel times considering real-time traffic, and create personalized maps with points of interest.", "version" : "1.2.0", "iconUrl" : "https://georoute-agent.example.com/icon.png", "capabilities" : { "streaming" : true, "pushNotifications" : true, "stateTransitionHistory" : false, "extensions" : null }, "skills" : [ { "id" : "route-optimizer-traffic", "name" : "Traffic-Aware Route Optimizer", "description" : "Calculates the optimal driving route between two or more locations, taking into account real-time traffic conditions, road closures, and user preferences (e.g., avoid tolls, prefer highways).", "tags" : [ "maps", "routing", "navigation", "directions", "traffic" ], "examples" : [ "Plan a route from '1600 Amphitheatre Parkway, Mountain View, CA' to 'San Francisco International Airport' avoiding tolls.", "{\"origin\": {\"lat\": 37.422, \"lng\": -122.084}, \"destination\": {\"lat\": 37.7749, \"lng\": -122.4194}, \"preferences\": [\"avoid_ferries\"]}" ], "inputModes" : [ "application/json", "text/plain" ], "outputModes" : [ "application/json", "application/vnd.geo+json", "text/html" ] }, { "id" : "custom-map-generator", "name" : "Personalized Map Generator", "description" : "Creates custom map images or interactive map views based on user-defined points of interest, routes, and style preferences. Can overlay data layers.", "tags" : [ "maps", "customization", "visualization", "cartography" ], "examples" : [ "Generate a map of my upcoming road trip with all planned stops highlighted.", "Show me a map visualizing all coffee shops within a 1-mile radius of my current location." ], "inputModes" : [ "application/json" ], "outputModes" : [ "image/png", "image/jpeg", "application/json", "text/html" ] } ], "url" : "https://georoute-agent.example.com/a2a/v1", "preferredTransport" : "JSONRPC", "additionalInterfaces" : [ { "url" : "https://georoute-agent.example.com/a2a/v1", "transport" : "JSONRPC" }, { "url" : "https://georoute-agent.example.com/a2a/grpc", "transport" : "GRPC" }, { "url" : "https://georoute-agent.example.com/a2a/json", "transport" : "HTTP+JSON" } ], "provider" : { "organization" : "Example Geo Services Inc.", "url" : "https://www.examplegeoservices.com" }, "documentationUrl" : "https://docs.examplegeoservices.com/georoute-agent/api", "securitySchemes" : { "google" : { "type" : "openIdConnect", "openIdConnectUrl" : "https://accounts.google.com/.well-known/openid-configuration" } }, "security" : [ { "google" : [ "openid", "profile", "email" ] } ], "defaultInputModes" : [ "application/json", "text/plain" ], "defaultOutputModes" : [ "application/json", "image/png" ], "supportsAuthenticatedExtendedCard" : true, "registrationType" : "URL", "latestVersion" : true }}5.4. 更新AgentCard
Description
通过该接口,可以更新托管在Nacos上的AgentCard。
Since
3.1.0
Request Method
PUT
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ai/a2a
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | AgentCard所属的命名空间,默认public |
agentCard | string | Yes | AgentCard的完整对象,详情请参考标准AgentCard |
registrationType | string | No | AgentCard的默认注册类型,可选URL和SERVICE。未填写时根据此AgentCard的默认registrationType进行url的生成 |
setAsLatest | boolean | No | 是否设置此版本为最新发布版本,默认为false |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
data | string | AgentCard服务更新结果。 |
Examples
- Request example
curl -X PUT '127.0.0.1:8848/nacos/v3/admin/ai/a2a' \-d 'namespaceId=public' \-d 'agentCard={"protocolVersion":"0.2.9","name":"GeoSpatial Route Planner Agent","description":"Provides advanced route planning, traffic analysis, and custom map generation services. This agent can calculate optimal routes, estimate travel times considering real-time traffic, and create personalized maps with points of interest.","url":"https://georoute-agent.example.com/a2a/v1","preferredTransport":"JSONRPC","additionalInterfaces":[{"url":"https://georoute-agent.example.com/a2a/v1","transport":"JSONRPC"},{"url":"https://georoute-agent.example.com/a2a/grpc","transport":"GRPC"},{"url":"https://georoute-agent.example.com/a2a/json","transport":"HTTP+JSON"}],"provider":{"organization":"Example Geo Services Inc.","url":"https://www.examplegeoservices.com"},"iconUrl":"https://georoute-agent.example.com/icon.png","version":"1.2.0","documentationUrl":"https://docs.examplegeoservices.com/georoute-agent/api","capabilities":{"streaming":true,"pushNotifications":true,"stateTransitionHistory":false},"securitySchemes":{"google":{"type":"openIdConnect","openIdConnectUrl":"https://accounts.google.com/.well-known/openid-configuration"}},"security":[{"google":["openid","profile","email"]}],"defaultInputModes":["application/json","text/plain"],"defaultOutputModes":["application/json","image/png"],"skills":[{"id":"route-optimizer-traffic","name":"Traffic-Aware Route Optimizer","description":"Calculates the optimal driving route between two or more locations, taking into account real-time traffic conditions, road closures, and user preferences (e.g., avoid tolls, prefer highways).","tags":["maps","routing","navigation","directions","traffic"],"examples":["Plan a route from '\''1600 Amphitheatre Parkway, Mountain View, CA'\'' to '\''San Francisco International Airport'\'' avoiding tolls.","{\"origin\": {\"lat\": 37.422, \"lng\": -122.084}, \"destination\": {\"lat\": 37.7749, \"lng\": -122.4194}, \"preferences\": [\"avoid_ferries\"]}"],"inputModes":["application/json","text/plain"],"outputModes":["application/json","application/vnd.geo+json","text/html"]},{"id":"custom-map-generator","name":"Personalized Map Generator","description":"Creates custom map images or interactive map views based on user-defined points of interest, routes, and style preferences. Can overlay data layers.","tags":["maps","customization","visualization","cartography"],"examples":["Generate a map of my upcoming road trip with all planned stops highlighted.","Show me a map visualizing all coffee shops within a 1-mile radius of my current location."],"inputModes":["application/json"],"outputModes":["image/png","image/jpeg","application/json","text/html"]}],"supportsAuthenticatedExtendedCard":true,"signatures":[{"protected":"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpPU0UiLCJraWQiOiJrZXktMSIsImprdSI6Imh0dHBzOi8vZXhhbXBsZS5jb20vYWdlbnQvandrcy5qc29uIn0","signature":"QFdkNLNszlGj3z3u0YQGt_T9LixY3qtdQpZmsTdDHDe3fXV9y9-B3m2-XgCpzuhiLt8E0tV6HXoZKHv4GtHgKQ"}]}' \-d 'registrationType=SERVICE' \-d 'setAsLatest=true'- Response example
{ "code" : 0, "message" : "success", "data" : "ok"}5.5. 创建AgentCard
Description
通过该接口,可以创建托管在Nacos上的AgentCard。
Since
3.1.0
Request Method
POST
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ai/a2a
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | AgentCard所属的命名空间,默认public |
agentCard | string | Yes | AgentCard的完整对象,详情请参考标准AgentCard |
registrationType | string | No | AgentCard的默认注册类型,可选URL和SERVICE。未填写时根据此AgentCard的默认registrationType进行url的生成, 默认为URL |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
data | string | AgentCard发布结果。 |
Examples
- Request example
curl -X POST '127.0.0.1:8848/nacos/v3/admin/ai/a2a' \-d 'namespaceId=public' \-d 'agentCard={"protocolVersion":"0.2.9","name":"GeoSpatial Route Planner Agent","description":"Provides advanced route planning, traffic analysis, and custom map generation services. This agent can calculate optimal routes, estimate travel times considering real-time traffic, and create personalized maps with points of interest.","url":"https://georoute-agent.example.com/a2a/v1","preferredTransport":"JSONRPC","additionalInterfaces":[{"url":"https://georoute-agent.example.com/a2a/v1","transport":"JSONRPC"},{"url":"https://georoute-agent.example.com/a2a/grpc","transport":"GRPC"},{"url":"https://georoute-agent.example.com/a2a/json","transport":"HTTP+JSON"}],"provider":{"organization":"Example Geo Services Inc.","url":"https://www.examplegeoservices.com"},"iconUrl":"https://georoute-agent.example.com/icon.png","version":"1.2.0","documentationUrl":"https://docs.examplegeoservices.com/georoute-agent/api","capabilities":{"streaming":true,"pushNotifications":true,"stateTransitionHistory":false},"securitySchemes":{"google":{"type":"openIdConnect","openIdConnectUrl":"https://accounts.google.com/.well-known/openid-configuration"}},"security":[{"google":["openid","profile","email"]}],"defaultInputModes":["application/json","text/plain"],"defaultOutputModes":["application/json","image/png"],"skills":[{"id":"route-optimizer-traffic","name":"Traffic-Aware Route Optimizer","description":"Calculates the optimal driving route between two or more locations, taking into account real-time traffic conditions, road closures, and user preferences (e.g., avoid tolls, prefer highways).","tags":["maps","routing","navigation","directions","traffic"],"examples":["Plan a route from '\''1600 Amphitheatre Parkway, Mountain View, CA'\'' to '\''San Francisco International Airport'\'' avoiding tolls.","{\"origin\": {\"lat\": 37.422, \"lng\": -122.084}, \"destination\": {\"lat\": 37.7749, \"lng\": -122.4194}, \"preferences\": [\"avoid_ferries\"]}"],"inputModes":["application/json","text/plain"],"outputModes":["application/json","application/vnd.geo+json","text/html"]},{"id":"custom-map-generator","name":"Personalized Map Generator","description":"Creates custom map images or interactive map views based on user-defined points of interest, routes, and style preferences. Can overlay data layers.","tags":["maps","customization","visualization","cartography"],"examples":["Generate a map of my upcoming road trip with all planned stops highlighted.","Show me a map visualizing all coffee shops within a 1-mile radius of my current location."],"inputModes":["application/json"],"outputModes":["image/png","image/jpeg","application/json","text/html"]}],"supportsAuthenticatedExtendedCard":true,"signatures":[{"protected":"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpPU0UiLCJraWQiOiJrZXktMSIsImprdSI6Imh0dHBzOi8vZXhhbXBsZS5jb20vYWdlbnQvandrcy5qc29uIn0","signature":"QFdkNLNszlGj3z3u0YQGt_T9LixY3qtdQpZmsTdDHDe3fXV9y9-B3m2-XgCpzuhiLt8E0tV6HXoZKHv4GtHgKQ"}]}' \-d 'registrationType=SERVICE'- Response example
{ "code" : 0, "message" : "success", "data" : "ok"}5.6. 删除AgentCard
Description
通过该接口,可以删除托管在Nacos上的AgentCard。
Since
3.1.0
Request Method
DELETE
Authorization
需对应命名空间的写权限
Request URL
/nacos/v3/admin/ai/a2a
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | AgentCard所属的命名空间,默认public |
agentName | string | Yes | AgentCard的名称 |
version | string | No | AgentCard的版本号,为空时返回最新版本详情 |
Response Data
返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。
| Name | Type | Description |
|---|---|---|
data | string | AgentCard删除结果。 |
Examples
- Request example
curl -X DELETE '127.0.0.1:8848/nacos/v3/admin/ai/a2a?namespaceId=public&agentName=GeoSpatial+Route+Planner+Agent&version=1.0.0'- Response example
{ "code" : 0, "message" : "success", "data" : "ok"}6. AI Prompt Management
6.1. Publish Prompt
Description
This API publishes a new Prompt version.
Since
3.2.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. Defaults to public. |
promptKey | string | Yes | Prompt key. |
version | string | Yes | Version. |
template | string | No | Template content. |
commitMsg | string | No | Commit message. |
description | string | No | Description. |
bizTags | string | No | Business tags. |
variables | string | No | Prompt template variable definitions as a JSON string. |
Response Data
On success, the API returns the common response body with data set to true; on failure, it returns the Nacos OpenAPI common response format.
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/prompt' \ -d 'namespaceId=public' -d 'promptKey=my-prompt' -d 'version=1.0.0' -d 'template=hello'- Response example
{ "code": 0, "message": "success", "data": true}6.2. Delete Prompt
Description
This API deletes the specified Prompt.
Since
3.2.0
Request Method
DELETE
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
Response Data
On success, the API returns the common response body with data set to true; on failure, it returns the Nacos OpenAPI common response format.
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/ai/prompt?namespaceId=public&promptKey=my-prompt'- Response example
{ "code": 0, "message": "success", "data": true}6.3. Get Prompt Detail
Description
This API queries Prompt details by version or label.
Since
3.2.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/detail
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
version | string | No | Version. |
label | string | No | Label. |
md5 | string | No | Content MD5. |
Response Data
The response body follows the Nacos OpenAPI common response format. data contains fields such as promptKey, version, template, commitMsg, and md5.
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/prompt/detail?namespaceId=public&promptKey=my-prompt&version=1.0.0'- Response example
{ "code": 0, "message": "success", "data": { "version": "1.0.0", "template": "", "commitMsg": "" }}6.4. Bind Label
Description
This API binds a label to the specified Prompt version.
Since
3.2.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/label
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
label | string | Yes | Label name. |
version | string | Yes | Version. |
Response Data
On success, the API returns the common response body with data set to true; on failure, it returns the Nacos OpenAPI common response format.
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ai/prompt/label' \ -d 'namespaceId=public' -d 'promptKey=my-prompt' -d 'label=stable' -d 'version=1.0.0'- Response example
{ "code": 0, "message": "success", "data": true}6.5. Unbind Label
Description
This API unbinds a label from a Prompt.
Since
3.2.0
Request Method
DELETE
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/label
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
label | string | Yes | Label name. |
Response Data
On success, the API returns the common response body with data set to true; on failure, it returns the Nacos OpenAPI common response format.
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/ai/prompt/label?namespaceId=public&promptKey=my-prompt&label=stable'- Response example
{ "code": 0, "message": "success", "data": true}6.6. List Prompts
Description
This API queries Prompts by page.
Since
3.2.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pageNo | integer | Yes | Page number. |
pageSize | integer | Yes | Number of records per page. |
namespaceId | string | No | Namespace. |
promptKey | string | No | Prompt key filter. |
search | string | No | Search mode: blur or accurate. |
bizTags | string | No | Business tags. |
Response Data
The response body follows the Nacos OpenAPI common response format. data is a paginated object that contains fields such as totalCount, pageNumber, pagesAvailable, and pageItems.
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/prompt/list?pageNo=1&pageSize=10&namespaceId=public&search=blur'- Response example
{ "code": 0, "message": "success", "data": { "totalCount": 1, "pageNumber": 1, "pagesAvailable": 1, "pageItems": [ { "promptKey": "my-prompt", "description": "" } ] }}6.7. Get Prompt Metadata
Description
This API queries metadata of the specified Prompt.
Since
3.2.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/metadata
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
Response Data
The response body follows the Nacos OpenAPI common response format. data contains fields such as promptKey, description, bizTags, latestVersion, versions, and labels.
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/prompt/metadata?namespaceId=public&promptKey=my-prompt'- Response example
{ "code": 0, "message": "success", "data": { "promptKey": "my-prompt", "description": "", "bizTags": "" }}6.8. Update Prompt Metadata
Description
This API updates Prompt metadata, such as description and business tags.
Since
3.2.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/metadata
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
description | string | No | Description. |
bizTags | string | No | Business tags. |
Response Data
On success, the API returns the common response body with data set to true; on failure, it returns the Nacos OpenAPI common response format.
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ai/prompt/metadata' \ -d 'namespaceId=public' -d 'promptKey=my-prompt' -d 'description=desc'- Response example
{ "code": 0, "message": "success", "data": true}6.9. List Prompt Versions
Description
This API queries versions of the specified Prompt by page.
Since
3.2.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/versions
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
pageNo | integer | Yes | Page number. |
pageSize | integer | Yes | Number of records per page. |
Response Data
The response body follows the Nacos OpenAPI common response format. data is a paginated object that contains totalCount, pageNumber, pagesAvailable, and pageItems; each item contains fields such as version, commitMsg, and gmtModified.
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/prompt/versions?namespaceId=public&promptKey=my-prompt&pageNo=1&pageSize=10'- Response example
{ "code": 0, "message": "success", "data": { "totalCount": 1, "pageNumber": 1, "pagesAvailable": 1, "pageItems": [ { "version": "1.0.0", "commitMsg": "" } ] }}6.10. Update Prompt Business Tags
Description
This API updates Prompt business tags.
Since
3.2.1
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/biz-tags
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
bizTags | string | No | Business tags. |
6.11. Update Prompt Description
Description
This API updates the Prompt description.
Since
3.2.1
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/description
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
description | string | Yes | Description. |
6.12. Create Prompt Draft
Description
This API creates a Prompt draft version, or recreates a draft from an existing version.
Since
3.2.1
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/draft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
basedOnVersion | string | No | Version to base the draft on. |
targetVersion | string | No | Target version. |
template | string | No | Template content. |
variables | string | No | Prompt template variable definitions as a JSON string. |
commitMsg | string | No | Commit message. |
description | string | No | Description. |
bizTags | string | No | Business tags. |
6.13. Update Prompt Draft
Description
This API updates the current Prompt draft content.
Since
3.2.1
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/draft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
template | string | Yes | Template content. |
variables | string | No | Prompt template variable definitions as a JSON string. |
commitMsg | string | No | Commit message. |
6.14. Delete Prompt Draft
Description
This API deletes the current Prompt draft version.
Since
3.2.1
Request Method
DELETE
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/draft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
6.15. Force Publish Prompt Version
Description
This API force-publishes a Prompt version while bypassing pipeline validation.
Since
3.2.1
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/force-publish
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
version | string | Yes | Version number. |
updateLatestLabel | boolean | No | Whether to update the latest label after publishing. |
6.16. Get Prompt Governance Details
Description
This API retrieves Prompt metadata, version governance information, and version summaries.
Since
3.2.1
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/governance
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
6.17. Update Prompt Labels
Description
This API updates the runtime routing labels of a Prompt.
Since
3.2.1
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/labels
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
labels | string | Yes | Label JSON string. |
6.18. Offline Prompt Version
Description
This API takes a specified Prompt version offline.
Since
3.2.1
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/offline
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
version | string | Yes | Version number. |
6.19. Online Prompt Version
Description
This API brings a specified Prompt version online.
Since
3.2.1
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/online
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
version | string | Yes | Version number. |
6.20. Publish Prompt Version
Description
This API publishes an approved Prompt version.
Since
3.2.1
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/publish
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
version | string | Yes | Version number. |
updateLatestLabel | boolean | No | Whether to update the latest label after publishing. |
6.21. Redraft Prompt Version
Description
This API converts a reviewed Prompt version back to a draft.
Since
3.2.2
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/redraft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
version | string | Yes | Version number. |
6.22. Submit Prompt Version for Review
Description
This API submits a Prompt version to the pipeline for review.
Since
3.2.1
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/submit
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
version | string | No | Version number. |
6.23. Get Prompt Version Details
Description
This API retrieves details of a specified Prompt version.
Since
3.2.1
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/version
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
version | string | No | Version number. |
6.24. Download Prompt Version
Description
This API downloads a specified Prompt version as a Markdown file.
Since
3.2.2
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/prompt/version/download
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
promptKey | string | Yes | Prompt key. |
version | string | No | Version number. |
7. AI Skills Management
7.1. Get Skill Details
Description
This API obtains the details of a specified skill by namespace and skill name.
Since
3.2.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
skillName | string | Yes | Skill name. |
Response Data
The response follows the Nacos open API unified response format. data contains fields such as name, description, instruction, resource, version, inputModes, and outputModes.
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/skills?namespaceId=public&skillName=my-skill'- Response example
{ "code": 0, "message": "success", "data": { "name": "my-skill", "description": "", "version": "1.0.0", "inputModes": [], "outputModes": [] }}7.2. Create Skill Draft Version
Description
This API creates a draft version of a skill based on an existing version or a new SkillCard.
Since
3.2.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/draft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
skillName | string | No | Skill name. |
basedOnVersion | string | No | Create the draft based on this version. |
targetVersion | string | No | Target version. |
skillCard | string | No | Skill card JSON; required if basedOnVersion is not set |
Response Data
On success, returns the unified response body with data as a string indicating the draft creation result. On failure, returns the Nacos open API unified response format.
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/skills/draft' \ -d 'namespaceId=public' -d 'skillName=my-skill' -d 'basedOnVersion=1.0.0'- Response example
{ "code": 0, "message": "success", "data": "ok"}7.3. Update Skill Draft Content
Description
This API updates the SkillCard content of the current skill draft version.
Since
3.2.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/draft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
skillCard | string | Yes | Skill card JSON string containing complete Skill information |
skillName | string | Yes | Skill name. |
Response Data
On success, returns the unified response body with data as a string indicating the draft update result. On failure, returns the Nacos open API unified response format.
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ai/skills/draft' \ -d 'namespaceId=public' -d 'skillName=my-skill' -d 'skillCard={}'- Response example
{ "code": 0, "message": "success", "data": "ok"}7.4. Delete Skill
Description
This API deletes a skill from Nacos by namespace and skill name.
Since
3.2.0
Request Method
DELETE
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
skillName | string | Yes | Skill name. |
Response Data
On success, returns the unified response body with data as a string indicating the operation result, such as “ok”. On failure, returns the Nacos open API unified response format.
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/ai/skills?namespaceId=public&skillName=my-skill'- Response example
{ "code": 0, "message": "success", "data": "ok"}7.5. List Skills
Description
This API filters and paginates the skill list by query conditions.
Since
3.2.1
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pageNo | integer | Yes | Page number. |
pageSize | integer | Yes | Page size. |
filterableForm | string | Yes | Filter condition form. |
namespaceId | string | No | Namespace. |
skillName | string | No | Skill name filter. |
search | string | No | Search mode: accurate or blur |
Response Data
The response follows the Nacos open API unified response format. data is a pagination structure containing totalCount, pageNumber, pagesAvailable, and pageItems. Each item includes fields such as name, description, and updateTime.
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/skills/list?pageNo=1&pageSize=100&namespaceId=public&search=blur'- Response example
{ "code": 0, "message": "success", "data": { "totalCount": 1, "pageNumber": 1, "pagesAvailable": 1, "pageItems": [ { "name": "my-skill", "description": "", "version": "1.0.0" } ] }}7.6. Upload Skill from ZIP File
Description
This API uploads a ZIP package in multipart/form-data format and registers the skill. The file must be a valid skill package.
Since
3.2.2
Request Method
POST
请求体类型:multipart/form-data,参数放在请求体中。
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/upload
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID. Defaults to public. |
overwrite | boolean | No | Whether to overwrite an existing skill with the same name. |
targetVersion | string | No | Target version after upload. |
commitMsg | string | No | Commit message. |
file | file | No | ZIP file containing skill package. |
Response Data
On success, returns the unified response body with data as the uploaded skill name. On failure, returns the Nacos open API unified response format.
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/skills/upload' \ -F "file=@skill.zip" -F "namespaceId=public" -F "overwrite=false" -F "targetVersion=1.0.0" -F "commitMsg=initial"- Response example
{ "code": 0, "message": "success", "data": "uploaded-skill-name"}7.7. Delete Skill Draft Version
Description
This API deletes the current draft version of a specified skill.
Since
3.2.0
Request Method
DELETE
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/draft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
skillName | string | Yes | Skill name. |
7.8. Update Skill Business Tags
Description
This API updates the business tag list of a skill without changing the version status.
Since
3.2.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/biz-tags
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
skillName | string | Yes | Skill name. |
bizTags | string | Yes | Business tags. |
7.9. Update Skill Version Labels
Description
This API updates the version routing labels of a skill, such as latest.
Since
3.2.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/labels
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
skillName | string | Yes | Skill name. |
labels | string | Yes | Label JSON string. |
7.10. Skill Version Online, Offline, and Publish Operations
Description
The following APIs are used to control the skill version publishing workflow.
Request Parameters
| Method | Request URL | Key parameters |
|---|---|---|
POST | /nacos/v3/admin/ai/skills/offline | namespaceId、skillName、scope、version |
POST | /nacos/v3/admin/ai/skills/online | namespaceId、skillName、scope、version |
POST | /nacos/v3/admin/ai/skills/publish | namespaceId、skillName、version、updateLatestLabel |
PUT | /nacos/v3/admin/ai/skills/scope | namespaceId、skillName、scope |
POST | /nacos/v3/admin/ai/skills/submit | namespaceId、skillName、version |
7.11. Get Skill Version Details
Since
3.2.0
Request Method
GET
Request URL
/nacos/v3/admin/ai/skills/version
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
skillName | string | Yes | Skill name. |
version | string | No | Version number. |
7.12. Download Skill Version ZIP Package
Since
3.2.0
Request Method
GET
Request URL
/nacos/v3/admin/ai/skills/version/download
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
skillName | string | Yes | Skill name. |
version | string | No | Version number. |
7.13. Offline Skill
Description
This interface allows executing an offline operation on a specific version or the entire skill, making it not callable.
Since
3.2.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/offline
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
skillName | string | Yes | Skill name. |
scope | string | No | Use ‘skill’ for skill-level offline; otherwise version-level |
version | string | No | Version identifier. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/skills/offline' -d "namespaceId=namespaceId&skillName=skillName&scope=scope&version=version"- Response example
{ "code": 0, "message": "success", "data": {}}7.14. Online Skill
Description
This interface allows executing an online operation on a specific version or the entire skill, making it callable.
Since
3.2.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/online
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
skillName | string | Yes | Skill name. |
scope | string | No | Use ‘skill’ for skill-level online; otherwise version-level |
version | string | No | Version identifier. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/skills/online' -d "namespaceId=namespaceId&skillName=skillName&scope=scope&version=version"- Response example
{ "code": 0, "message": "success", "data": {}}7.15. Publish Skill Version
Description
This interface allows publishing an approved skill version.
Since
3.2.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/publish
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
skillName | string | Yes | Skill name. |
version | string | Yes | Version identifier. |
updateLatestLabel | boolean | No | Whether to update the latest label after publishing. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/skills/publish' -d "namespaceId=namespaceId&skillName=skillName&version=version&updateLatestLabel=updateLatestLabel"- Response example
{ "code": 0, "message": "success", "data": {}}7.16. Update Skill Visibility Scope
Description
This interface allows setting the visibility scope of a skill to PUBLIC or PRIVATE.
Since
3.2.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/scope
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
skillName | string | Yes | Skill name. |
scope | string | Yes | PUBLIC or PRIVATE |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ai/skills/scope' -d "namespaceId=namespaceId&skillName=skillName&scope=scope"- Response example
{ "code": 0, "message": "success", "data": {}}7.17. Submit Skill Version for Review
Description
This interface allows submitting a skill draft version to the pipeline for review.
Since
3.2.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/submit
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
skillName | string | Yes | Skill name. |
version | string | No | Version identifier. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/skills/submit' -d "namespaceId=namespaceId&skillName=skillName&version=version"- Response example
{ "code": 0, "message": "success", "data": {}}7.18. Force Publish Skill Version
Description
This API force-publishes a Skill version while bypassing pipeline validation.
Since
3.2.1
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/force-publish
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
skillName | string | Yes | Skill name. |
version | string | Yes | Version number. |
updateLatestLabel | boolean | No | Whether to update the latest label after publishing. |
7.19. Redraft Skill Version
Description
This API converts a reviewed Skill version back to a draft.
Since
3.2.2
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/redraft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
skillName | string | Yes | Skill name. |
version | string | Yes | Version number. |
7.20. Batch Upload Skills
Description
This API batch uploads Skills from a ZIP file that contains multiple Skill subdirectories.
Since
3.2.2
Request Method
POST
Request body type: multipart/form-data. Parameters are sent in the request body.
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/skills/upload/batch
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
overwrite | boolean | No | Whether to overwrite existing skills with the same names. |
file | file | No | ZIP package containing multiple Skill subdirectories. |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/skills/upload/batch' \ -F "file=@skills.zip" -F "namespaceId=public" -F "overwrite=false"8. AgentSpec Management
8.1. Get AgentSpec
Description
This interface allows getting the latest published version of an AgentSpec by namespace and name.
Since
3.2.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data.namespaceId | string | - |
| data.data.name | string | - |
| data.data.description | string | - |
| data.data.updateTime | integer | - |
| data.data.enable | boolean | - |
| data.data.bizTags | string | - |
| data.data.from | string | - |
| data.data.scope | string | - |
| data.data.labels | object | - |
| data.data.editingVersion | string | - |
| data.data.reviewingVersion | string | - |
| data.data.onlineCnt | integer | - |
| data.data.downloadCount | integer | - |
| data.data.versions | array | - |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs?namespaceId=public&agentSpecName=my-agentspec'- Response example
{ "code": 0, "message": "success", "data": {}}8.2. Delete AgentSpec
Description
This interface allows deleting an AgentSpec and all its versions by namespace and name.
Since
3.2.0
Request Method
DELETE
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs?namespaceId=public&agentSpecName=my-agentspec'- Response example
{ "code": 0, "message": "success", "data": {}}8.3. Update AgentSpec Business Tags
Description
This interface allows updating the business tag list of an AgentSpec without changing version status.
Since
3.2.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/biz-tags
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
bizTags | string | Yes | Business tags; pass multiple tags using the agreed format. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/biz-tags' -d "namespaceId=public&agentSpecName=my-agentspec&bizTags=demo"- Response example
{ "code": 0, "message": "success", "data": {}}8.4. Create AgentSpec Draft Version
Description
This interface allows creating an AgentSpec draft version based on an existing version.
Since
3.2.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/draft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
basedOnVersion | string | No | Base version used to create the draft. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/draft' -d "namespaceId=public&agentSpecName=my-agentspec&basedOnVersion=1.0.0"- Response example
{ "code": 0, "message": "success", "data": {}}8.5. Update AgentSpec Draft Content
Description
This interface allows updating the card content of the current AgentSpec draft version.
Since
3.2.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/draft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | No | AgentSpec name. |
agentSpecCard | string | Yes | AgentSpec card JSON string containing complete AgentSpec information |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/draft' -d "namespaceId=public&agentSpecName=my-agentspec&agentSpecCard={}"- Response example
{ "code": 0, "message": "success", "data": {}}8.6. Delete AgentSpec Draft Version
Description
This interface allows deleting the current draft version of a specified AgentSpec.
Since
3.2.0
Request Method
DELETE
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/draft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X DELETE 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/draft?namespaceId=public&agentSpecName=my-agentspec'- Response example
{ "code": 0, "message": "success", "data": {}}8.7. Update AgentSpec Version Labels
Description
This interface allows updating AgentSpec version routing labels (e.g. latest label) without changing version status.
Since
3.2.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/labels
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
labels | string | Yes | Version labels, usually as a JSON string. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/labels' -d "namespaceId=public&agentSpecName=my-agentspec&labels={\"latest\":\"1.0.0\"}"- Response example
{ "code": 0, "message": "success", "data": {}}8.8. List AgentSpecs
Description
This interface allows paginated listing of AgentSpecs by namespace and name.
Since
3.2.1
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pageNo | integer | Yes | Page number, starting from 1. |
pageSize | integer | Yes | Number of items per page. |
filterableForm | string | Yes | Filter condition form. |
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | No | AgentSpec name. |
search | string | No | Search mode: accurate or blur. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/list?pageNo=1&pageSize=20&namespaceId=public&agentSpecName=my-agentspec&search=accurate'- Response example
{ "code": 0, "message": "success", "data": {}}8.9. Offline AgentSpec
Description
This interface allows executing an offline operation on a specific version or the entire AgentSpec, making it not callable.
Since
3.2.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/offline
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
scope | string | No | Use ‘agentspec’ for agentspec-level offline; otherwise version-level |
version | string | No | Version identifier. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/offline' -d "namespaceId=public&agentSpecName=my-agentspec&scope=agentspec&version=1.0.0"- Response example
{ "code": 0, "message": "success", "data": {}}8.10. Online AgentSpec
Description
This interface allows executing an online operation on a specific version or the entire AgentSpec, making it callable.
Since
3.2.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/online
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
scope | string | No | Use ‘agentspec’ for agentspec-level online; otherwise version-level |
version | string | No | Version identifier. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/online' -d "namespaceId=public&agentSpecName=my-agentspec&scope=agentspec&version=1.0.0"- Response example
{ "code": 0, "message": "success", "data": {}}8.11. Publish AgentSpec Version
Description
This interface allows publishing an approved AgentSpec version.
Since
3.2.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/publish
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
version | string | Yes | Version identifier. |
updateLatestLabel | boolean | No | Whether to update the latest label after publishing. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/publish' -d "namespaceId=public&agentSpecName=my-agentspec&version=1.0.0&updateLatestLabel=true"- Response example
{ "code": 0, "message": "success", "data": {}}8.12. Update AgentSpec Visibility Scope
Description
This interface allows setting the visibility scope of an AgentSpec to PUBLIC or PRIVATE.
Since
3.2.0
Request Method
PUT
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/scope
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
scope | string | Yes | PUBLIC or PRIVATE |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X PUT 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/scope' -d "namespaceId=public&agentSpecName=my-agentspec&scope=PUBLIC"- Response example
{ "code": 0, "message": "success", "data": {}}8.13. Submit AgentSpec Version for Review
Description
This interface allows submitting an AgentSpec draft version to the pipeline for review.
Since
3.2.0
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/submit
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
version | string | No | Version identifier. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/submit' -d "namespaceId=public&agentSpecName=my-agentspec&version=1.0.0"- Response example
{ "code": 0, "message": "success", "data": {}}8.14. Upload AgentSpec
Description
This interface allows uploading a ZIP-packaged AgentSpec; the package is parsed and the AgentSpec is created or updated.
Since
3.2.0
Request Method
POST
Request body type: multipart/form-data. Parameters are sent in the request body.
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/upload
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
overwrite | boolean | No | Whether to overwrite an existing resource with the same name. |
file | file | No | ZIP file containing AgentSpec package. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data | string | - |
Examples
- Request example
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/upload' -F "file=@agentspec.zip" -F "namespaceId=public" -F "overwrite=false"- Response example
{ "code": 0, "message": "success", "data": {}}8.15. Get AgentSpec Version
Description
This interface allows getting a specific version of an AgentSpec by namespace, name, and version.
Since
3.2.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/version
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
version | string | No | Version identifier. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | - |
| data.message | string | - |
| data.data.namespaceId | string | - |
| data.data.name | string | - |
| data.data.description | string | - |
| data.data.bizTags | string | - |
| data.data.content | string | - |
| data.data.resource | object | - |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/agentspecs/version?namespaceId=public&agentSpecName=my-agentspec&version=1.0.0'- Response example
{ "code": 0, "message": "success", "data": {}}8.16. Force Publish AgentSpec Version
Description
This API force-publishes an AgentSpec version while bypassing pipeline validation.
Since
3.2.1
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/force-publish
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
version | string | Yes | Version number. |
updateLatestLabel | boolean | No | Whether to update the latest label after publishing. |
8.17. Redraft AgentSpec Version
Description
This API converts a reviewed AgentSpec version back to a draft.
Since
3.2.2
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/redraft
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
version | string | Yes | Version number. |
8.18. Get AgentSpec Version Metadata
Description
This API retrieves metadata for a specified AgentSpec version without reading resource file content.
Since
3.2.1
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/agentspecs/version/meta
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace ID, default is public. |
agentSpecName | string | Yes | AgentSpec name. |
version | string | No | Version number. |
9. Pipeline Execution Records
9.1. List Pipeline Execution Records
Description
This API lists Pipeline execution records by resource type, resource name, namespace, and version with pagination.
Since
3.2.1
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/pipelines
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
resourceType | string | Yes | Resource type. |
resourceName | string | No | Resource name. |
namespaceId | string | No | Namespace. |
version | string | No | Resource version. |
pageNo | integer | Yes | Page number. |
pageSize | integer | Yes | Page size. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | Response code. |
| data.message | string | Response message. |
| data.data | string | Paginated Pipeline execution records. |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/pipelines?resourceType=agentspec&resourceName=my-agentspec&namespaceId=public&version=1.0.0&pageNo=1&pageSize=20'- Response example
{ "code": 0, "message": "success", "data": {}}9.2. Get Pipeline Execution Record Details
Description
This API retrieves Pipeline execution record details by Pipeline ID.
Since
3.2.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/pipelines/{pipelineId}
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pipelineId | string | Yes | Pipeline ID. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | Response code. |
| data.message | string | Response message. |
| data.data.executionId | string | Pipeline execution ID. |
| data.data.resourceType | string | Resource type. |
| data.data.resourceName | string | Resource name. |
| data.data.namespaceId | string | Namespace. |
| data.data.version | string | Resource version. |
| data.data.status | string | Execution status. |
| data.data.pipeline | array | Pipeline stage information. |
| data.data.createTime | integer | Creation time. |
| data.data.updateTime | integer | Update time. |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/pipelines/pipeline-001'- Response example
{ "code": 0, "message": "success", "data": {}}9.3. List Pipeline Execution Records
Description
This API lists Pipeline execution records by resource type, resource name, namespace, and version with pagination.
Since
3.2.0
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/pipelines/list
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
resourceType | string | Yes | Resource type. |
resourceName | string | No | Resource name. |
namespaceId | string | No | Namespace. |
version | string | No | Resource version. |
pageNo | integer | Yes | Page number. |
pageSize | integer | Yes | Page size. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | Response code. |
| data.message | string | Response message. |
| data.data | string | Paginated Pipeline execution records. |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/pipelines/list?resourceType=agentspec&resourceName=my-agentspec&namespaceId=public&version=1.0.0&pageNo=1&pageSize=20'- Response example
{ "code": 0, "message": "success", "data": {}}9.4. Get Pipeline Execution Record Details
Description
This API retrieves Pipeline execution record details by Pipeline ID.
Since
3.2.1
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/pipelines/detail
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pipelineId | string | Yes | Pipeline ID. |
Response Data
| Name | Type | Description |
|---|---|---|
| data.code | integer | Response code. |
| data.message | string | Response message. |
| data.data.executionId | string | Pipeline execution ID. |
| data.data.resourceType | string | Resource type. |
| data.data.resourceName | string | Resource name. |
| data.data.namespaceId | string | Namespace. |
| data.data.version | string | Resource version. |
| data.data.status | string | Execution status. |
| data.data.pipeline | array | Pipeline stage information. |
| data.data.createTime | integer | Creation time. |
| data.data.updateTime | integer | Update time. |
Examples
- Request example
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/ai/pipelines/detail?pipelineId=pipeline-001'- Response example
{ "code": 0, "message": "success", "data": {}}10. AI Resource Import
10.1. List AI Resource Import Sources
Description
This API lists the currently configured AI resource import sources.
Since
3.2.2
Request Method
GET
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/import/sources
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
resourceType | string | No | Resource type. |
10.2. Search External AI Resources
Description
This API searches importable external AI resources from a specified import source.
Since
3.2.2
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/import/search
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
resourceType | string | Yes | Resource type. |
sourceId | string | Yes | Import source ID. |
query | string | No | Search keyword. |
cursor | string | No | Pagination cursor. |
limit | integer | No | Result limit. |
options | string | No | Extension options as a JSON string. |
10.3. Validate AI Resource Import Items
Description
This API validates whether selected external AI resources can be imported.
Since
3.2.2
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/import/validate
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
resourceType | string | Yes | Resource type. |
sourceId | string | Yes | Import source ID. |
selectedItems | string | Yes | Resource items to validate as a JSON string. |
overwriteExisting | boolean | No | Whether to overwrite existing resources. |
options | string | No | Extension options as a JSON string. |
10.4. Execute AI Resource Import
Description
This API imports the selected external AI resources.
Since
3.2.2
Request Method
POST
Authorization
Administrator permissions required.
Request URL
/nacos/v3/admin/ai/import/execute
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceId | string | No | Namespace. |
resourceType | string | Yes | Resource type. |
sourceId | string | Yes | Import source ID. |
selectedItems | string | Yes | Resource items to import as a JSON string. |
overwriteExisting | boolean | No | Whether to overwrite existing resources. |
skipInvalid | boolean | No | Whether to skip invalid resource items. |
validationToken | string | No | Validation token. |
options | string | No | Extension options as a JSON string. |