Skip to content
OpenClaw 不踩坑恶意 Skills ,企业需 Skills Registry:Nacos 3.2 发布Know more

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 FitNot 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 the nacos.server.contextPath configuration item.
  • module: Admin API module name, such as server, cs, ns, or core.
  • subPath: Admin API subpath, such as state, namespace, or config. 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字段中的返回参数。

NameTypeDescription
${connectionId}object每条 gRPC connection ID.
${connectionId}.abilityTableobjectCapability list supported by the gRPC connection, namely the client.
${connectionId}.metaInfo.clientIpstringSource IP of the gRPC connection.
${connectionId}.metaInfo.localPortintegergRPC port of this Nacos Server.
${connectionId}.metaInfo.versionstringVersion of the gRPC connection, namely the client.
${connectionId}.metaInfo.createTimestringCreation time of the gRPC connection.
${connectionId}.metaInfo.lastActiveTimeintegerLast heartbeat time of the gRPC connection.
${connectionId}.metaInfo.labels.sourcestringModule of the gRPC connection. Optional values are naming, config, and cluster, representing registry, configuration, and inter-cluster connections respectively.
${connectionId}.metaInfo.clusterSourcebooleanWhether the gRPC connection is an inter-cluster connection. When true, ${connectionId}.metaInfo.labels.source is cluster.
${connectionId}.metaInfo.sdkSourcebooleanWhether the gRPC connection comes from a client. When true, ${connectionId}.metaInfo.labels.source is naming or config.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
countintegerYes需要均衡的连接个数
redirectAddressstringNo预期均衡的Nacos Server目标,仅提供给客户端参考。

Response Data

成功则返回success,失败则返回Nacos open API 统一返回体格式

Examples

  • Request example
Terminal window
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/core/loader/reloadCurrent' -d "count=100"
  • Response example
success

1.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

NameTypeRequiredDescription
connectionIdstringYes需要均衡的连接Id
redirectAddressstringNo预期均衡的Nacos Server目标。

Response Data

成功则返回success,失败则返回Nacos open API 统一返回体格式

Examples

  • Request example
Terminal window
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字段中的返回参数。

NameTypeDescription
totalinteger该集群中所有节点的连接数总和
mininteger该集群中所有节点的最小连接数
avginteger该集群中所有节点的平均连接数
maxinteger该集群中所有节点的最大连接数
memberCountinteger该集群中所有节点的个数
metricsCountinteger该集群中已统计到概览信息的节点个数
detailarrayOverview information of all nodes in the cluster. See the following fields.
detail[].addressstring节点地址
detail[].metric.loadnumber节点的负载率,主要对应节点的Load指标,参考值
detail[].metric.sdkConCountinteger连接到该节点的SDK连接数,主要对应客户端连接数
detail[].metric.conCountinteger连接到该节点的总连接数,包含了SDK和集群间的连接
detail[].metric.cpunumber节点的CPU使用率,参考值

Examples

  • Request example
Terminal window
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字段中的返回参数。

NameTypeDescription
ipstring节点IP
portinteger节点端口
statestringNode state: UP/DOWN/SUSPICIOUS
extendInfoobjectExtended node information. See the following fields.
extendInfo.lastRefreshTimeinteger节点上一次更新时间戳,单位毫秒
extendInfo.raftMetaDataobjectRaft metadata of the node, including fields such as leader and term for each Raft Group.
extendInfo.raftPortinteger节点的Raft端口
extendInfo.supportGrayModelboolean是否支持灰度模型
extendInfo.versionstring节点的版本
addressstring节点地址,格式为ip:port
failAccessCntinteger探测失败的次数,及report失败的次数,超过一定次数state会被改为DOWN
abilitiesobjectCapabilities supported by the node.
grpcReportEnabledboolean标记节点是否支持grpc上报心跳能力,用于适配老版本升级,后续将移除
extendInfo.readyToUpgradeboolean是否ready升级到Nacos2.0,于2.2版本后废弃,即将移除

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
addressstringNo节点地址,支持按地址过滤。
statestringNoNode state: UP/DOWN/SUSPICIOUS

Response Data

返回体遵循Nacos open API 统一返回体格式data字段为获取本节点信息的返回数据的列表。

Examples

  • Request example
Terminal window
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集群地址发现的方式,目前支持两种方式:fileaddress-server

Since

3.0.0

Request Method

PUT

Authorization

Administrator permissions required.

Request URL

/nacos/v3/admin/core/cluster/lookup

Request Parameters

NameTypeRequiredDescription
typestringYesaddress-server/file/standalone

Response Data

返回体遵循Nacos open API 统一返回体格式

NameTypeDescription
databooleantrue表示更新成功,false表示更新失败。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
commandstringYesRaft运维操作指令,具体的命令请参考下表。
valuestringYes命令的参数,具体的命令内容请参考下表。
groupIdstringNoRaft集群的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 统一返回体格式

NameTypeDescription
datastring固定为null

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
logNamestringYes具体的日志文件的Name,具体支持的日志Name见下表。
logLevelstringYes日志的级别,可选值为ALLTRACEDEBUGINFOWARNERROROFF
logName对应的具体日志文件
core-authcore-auth.log
core-raftprotocol-raft.log
core-distroprotocol-distro.log
core-clusternacos-cluster.log

Response Data

返回体遵循Nacos open API 统一返回体格式

NameTypeDescription
datastring固定为null

Examples

  • Request example
Terminal window
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)自动均衡整个集群的客户端连接。

自动均衡逻辑:

  1. 根据整个集群的客户端连接数和Nacos Server节点数量计算平均连接数avg、节点连接数下限阈值lowLimitCount(=avg * ( 1-loaderFactor))、节点连接数上限阈值overLimitCount(=avg * (1+loaderFactor))
  2. 将高负载节点的部分客户端连接重定向到低负载节点。

Since

3.0.0

Request Method

POST

Authorization

Administrator permissions required.

Request URL

/nacos/v3/admin/core/loader/smartReloadCluster

Request Parameters

NameTypeRequiredDescription
loaderFactornumberNo-

Response Data

成功则返回:

{
"code": 0,
"message": "success",
"data": null
}

失败则返回:

{
"code": 30000,
"message": "server error",
"data": null
}

Examples

  • Request example
Terminal window
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/core/loader/smartReloadCluster' -d "loaderFactor=0.1"
  • Response example
success

1.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 统一返回体格式

NameTypeDescription
resourcestring生产器Name
infoobject生产器详情
info.currentIdinteger当前ID
info.workerIdintegerworkerID

成功则返回:

{
"code": 0,
"message": "success",
"data": [
{
"resource": "resourceName",
"info": {
"currentId": 1,
"workerId": 2
}
}
]
}

失败则返回:

{
"code": 30000,
"message": "server error",
"data": null
}

Examples

  • Request example
Terminal window
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/core/ops/ids'
  • Response example
success

1.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字段中的返回参数。

NameTypeDescription
databoolean是否更新成功

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringYes命名空间 ID

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
namespacestring命名空间 ID
namespaceShowNamestring命名空间展示名
namespaceDescstring命名空间描述
quotainteger配置数量配额
configCountinteger当前配置数量
typeintegerType

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringYes命名空间 ID
namespaceNamestringYes命名空间展示名
namespaceDescstringNo命名空间描述

Response Data

成功则返回统一返回体,datatrue 表示成功;失败则返回Nacos open API 统一返回体格式

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间 ID,不传则由服务端生成
namespaceNamestringYes命名空间展示名
namespaceDescstringNo命名空间描述

Response Data

成功则返回统一返回体,datatrue 表示成功;失败则返回Nacos open API 统一返回体格式

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringYes命名空间 ID

Response Data

成功则返回统一返回体,datatrue 表示成功;失败则返回Nacos open API 统一返回体格式

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringYes-

Response Data

返回体遵循Nacos open API 统一返回体格式datatrue 表示已存在,false 表示不存在。

Examples

  • Request example
Terminal window
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
Terminal window
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
Terminal window
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字段中的返回参数。

NameTypeDescription
datastring存活状态,如 “ok”

Examples

  • Request example
Terminal window
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字段中的返回参数。

NameTypeDescription
datastring可读状态,如 “ok”

Examples

  • Request example
Terminal window
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,包含以下字段:

NameTypeRequiredDescription
pluginTypestringYes插件类型,如 auth。
pluginNamestringYes插件名称。
configstringYes插件配置项。
localOnlybooleanNo是否仅写本地,不持久化。

Response Data

返回体遵循Nacos open API 统一返回体格式data 为字符串表示操作结果。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
pluginTypestringYes插件类型,如 auth
pluginNamestringYes插件名称

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
pluginIdstring插件 ID
pluginTypestring插件类型
pluginNamestring插件名称
enabledboolean是否启用
criticalboolean是否关键插件
configurableboolean是否可配置
configobject配置内容
configDefinitionsarray配置定义列表

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
pluginTypestringNo插件类型,不传则返回全部

Response Data

返回体遵循Nacos open API 统一返回体格式data 为插件对象数组。

Examples

  • Request example
Terminal window
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,包含以下字段:

NameTypeRequiredDescription
pluginTypestringYes插件类型。
pluginNamestringYes插件名称。
enabledbooleanYes是否启用。
localOnlybooleanNo是否仅写本地。

Response Data

返回体遵循Nacos open API 统一返回体格式data 为字符串表示操作结果。

Examples

  • Request example
Terminal window
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字段中的返回参数。

NameTypeDescription
clientBeatIntervalintegerNacos1.X客户端的默认心跳间隔
defaultCacheMillisinteger客户端订阅的服务列表的默认缓存时间
pushCacheMillisinteger推送的服务列表的默认缓存时间,优先级高于defaultCacheMillis
distroEnabledboolean是否开启Distro协议同步,仅当集群压力过大,影响到集群稳定性时,临时修改为false缓解,改为false后可能导致部分数据不一致,需要尽快恢复
healthCheckEnabledboolean是否开启健康检查,仅当集群压力过大,影响到集群稳定性时,临时修改为false缓解,改为false后不会因为心跳过期,tcp/http探测超时而修改实例的健康状态,以及不会因过期删除实例,需要尽快恢复
lightBeatEnabledboolean是否开启轻量心跳,针对Nacos1.2.X~1.4.X版本客户端生效,修改为false后,Nacos1.2.X~1.4.X版本客户端将使用全量心跳进行续约
pushEnabledboolean是否开启推送功能,仅当集群压力过大,影响到集群稳定性时,临时修改为false,改为false后,Nacos客户端将不再收到服务端的主动推送
push${Language}Versionstring可支持推送的最小客户端版本,当不希望针对小于某些版本进行数据推送时,可以修改该值,比如修改pushJavaVersion为2.0.0,则小于2.0.0的Java客户端将不会收到推送数据
${type}HealthParamsobjectHealth 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
Terminal window
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

NameTypeRequiredDescription
entrystringYes修改的开关或配置Name
valuestringYes开关或配置的新值,不同的开关或配置的Type不同,具体请参考开关和配置参数
debugbooleanNo是否开启调试模式,开启后,修改的配置不会同步到集群其他节点中,仅在本节点生效,默认为false

Response Data

NameTypeDescription
datastring成功为ok

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
onlyStatusbooleanNotrue只显示状态

onlyStatus设置为true时,只返回表示系统状态的字符串

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
statusstring系统状态
serviceCountinteger服务数量
instanceCountinteger实例数量
subscribeCountinteger订阅数量
clientCountinteger客户端数量
connectionBasedClientCountinteger连接数量
ephemeralIpPortClientCountinteger临时客户端数量
persistentIpPortClientCountinteger持久客户端数量
responsibleClientCountinteger响应客户端数

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription

请求体字段:

NameTypeRequiredDescription
logNamestringYes需要修改的日志Name。
logLevelstringYes日志级别的新值。

Response Data

NameTypeDescription
datastring成功为ok

Examples

  • Request example
Terminal window
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

NameTypeDescription
dataarrayClient ID list.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
clientIdstringYes客户端ID

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
clientIdstring客户端的唯一 ID。
ephemeralboolean客户端是否为临时客户端
lastUpdatedTimeinteger客户端的最后更新时间(时间戳)
clientTypestring客户端Type
connectTypestring连接Type(仅适用于 2.x 客户端)
appNamestring客户端所属的应用名称
versionstring客户端的版本号
clientIpstring客户端的 IP 地址
clientPortstring客户端的端口号

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
clientIdstringYes客户端ID

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
namespaceIdstring命名空间
groupNamestring分组名
serviceNamestring服务名
publisherInfoobject该服务下注册的实例
publisherInfo.ipstringIP地址
publisherInfo.portinteger端口号
publisherInfo.clusterNamestring集群名

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
clientIdstringYes客户端ID

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
namespaceIdstring命名空间
groupNamestring分组名
serviceNamestring服务名
subscriberInfoobject订阅信息
subscriberInfo.appNamestring应用
subscriberInfo.agentstring客户端信息
subscriberInfo.addressstring地址

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
namespaceIdstringNo"public"
groupNamestringNo"DEFAULT_GROUP"
serviceNamestringYesNone
ipstringNoNone
portintegerNoNone

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
clientIdstring客户端id
ipstring实例的IP
portinteger实例的端口
clusterNamestring实例的集群名

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
namespaceIdstringNo"public"
groupNamestringNo"DEFAULT_GROUP"
serviceNamestringYesNone
ipstringNoNone
portintegerNoNone

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
clientIdstring客户端id
addressstring订阅者客户端的IP
agentstring订阅者客户端的版本
appNamestring订阅者客户端的应用名,unknown表示未配置或客户端不支持

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
ipstringYes客户端IP
portintegerYesClient port.

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
responsibleServerstring负责的服务器信息

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间ID
serviceNamestringYes服务名称
clusterNamestringYes集群Name
checkPortintegerNo健康检查端口
useInstancePort4CheckbooleanNo是否使用实例端口进行健康检查
healthCheckerstringNo健康检查器配置(JSON 字符串)
metadatastringNo集群的扩展元数据,默认为""
groupNamestringNo-

Response Data

NameTypeDescription
datastring操作结果信息

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间ID,默认为public
serviceNamestringYes服务名称
groupNamestringNo分组Name,默认为DEFAULT_GROUP
clusterNamestringNo集群Name,默认DEFAULT
ipstringYes实例IP
portintegerYes实例端口
healthybooleanYes健康状态(true 为健康)

Response Data

NameTypeDescription
datastring操作结果信息

Examples

  • Request example
Terminal window
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

NameTypeDescription
dataMap<String, AbstractHealthChecker>健康检查器Type及其配置

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间ID,默认为public
serviceNamestringYes服务名称
groupNamestringNo分组Name,默认为DEFAULT_GROUP
clusterNamestringNo集群Name,默认为DEFAULT
ipstringYes实例IP
portintegerYes实例端口
weightnumberNo实例权重,默认为1.0
healthybooleanNo健康状态,默认为true
enabledbooleanNo是否启用,默认为true
metadatastringNo实例元数据
ephemeralbooleanNo是否临时实例

Response Data

NameTypeDescription
datastring操作结果信息

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间ID,默认为public
serviceNamestringYes服务名称
groupNamestringNo分组Name,默认为DEFAULT_GROUP
clusterNamestringNo集群Name,默认为DEFAULT
ipstringYes实例IP
portintegerYes实例端口

Response Data

NameTypeDescription
datastring操作结果信息

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间ID,默认为public
serviceNamestringYes服务名称
groupNamestringNo分组Name,默认为DEFAULT_GROUP
clusterNamestringNo集群Name,默认为DEFAULT
ipstringYes实例IP
portintegerYes实例端口
weightnumberNo实例权重,默认为1.0
healthybooleanNo健康状态,默认为true
enabledbooleanNo是否启用,默认为true
metadatastringNo实例元数据
ephemeralbooleanNo是否临时实例

Response Data

NameTypeDescription
datastring操作结果信息

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间ID,默认为public
serviceNamestringYes服务名称
groupNamestringNo分组Name,默认为DEFAULT_GROUP
instancesstringNo实例列表(JSON数组 字符串)默认为""表示所有实例更新;若指定时,每个元素代表一个需要更新的实例,必须需要包含ipport字段,clusterName字段为可选,
metadatastringYes元数据
consistencyTypestringNo一致性Typeephemeralpersist,对应服务的ephemeral,默认为ephemeral

Response Data

NameTypeDescription
updatedarrayUpdated instance list.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间ID,默认为public
serviceNamestringYes服务名称
groupNamestringNo分组Name,默认为DEFAULT_GROUP
instancesstringNo实例列表(JSON 字符串),默认为""
metadatastringYes元数据
consistencyTypestringNo一致性Type,默认为""

Response Data

NameTypeDescription
dataInstanceMetadataBatchOperationVo操作结果信息
data.updatedarrayUpdated instance list.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间ID,默认为public
serviceNamestringYes服务名称
ipstringYes实例IP
portintegerYes实例端口
clusterNamestringNo集群Name,默认为DEFAULT
weightnumberNo实例权重,默认为1.0
enabledbooleanNo是否启用,默认启用
metadatastringNo实例元数据(JSON 字符串)
ephemeralbooleanNo-
groupNamestringNo-
healthybooleanNo-

Response Data

NameTypeDescription
datastring操作结果信息

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间ID,默认public
groupNamestringNo分组Name,默认为DEFAULT_GROUP
serviceNamestringYes服务名称
clusterNamestringNoCluster name. If not provided, instances of all clusters will be returned.
healthyOnlybooleanNo是否只返回健康实例,默认为false

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
serviceNamestring服务名,格式为groupName@@serviceName
clusterNamestring实例所在的集群Name
ipstring实例IP
portinteger实例端口号
weightnumber实例权重
healthyboolean实例是否健康
enabledboolean实例是否可用
ephemeralboolean是否为临时实例
metadatamap<string, string>Instance metadata.
instanceIdstring实例Id

关于心跳的参数instanceHeartBeatInterval, instanceHeartBeatTimeOutipDeleteTimeout 用于兼容1.X客户端的心跳模式数据,后续版本可能会移除对1.X客户端的支持,届时这3个参数将被废弃。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间Id,默认为public
groupNamestringNoGroup name. Defaults to DEFAULT_GROUP.
serviceNamestringYes服务名
clusterNamestringNo集群Name,默认为DEFAULT
ipstringYesIP地址
portintegerYes端口号

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
serviceNamestring服务名,格式为groupName@@serviceName
clusterNamestring实例所在的集群Name
ipstring实例IP
portinteger实例端口号
weightnumber实例权重
healthyboolean实例是否健康
enabledboolean实例是否可用
ephemeralboolean是否为临时实例
metadatamap<string, string>Instance metadata.
instanceIdstring实例Id

关于心跳的参数instanceHeartBeatInterval, instanceHeartBeatTimeOutipDeleteTimeout 用于兼容1.X客户端的心跳模式数据,后续版本可能会移除对1.X客户端的支持,届时这3个参数将被废弃。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间Id,默认为public
groupNamestringNo分组名,默认为DEFAULT_GROUP
serviceNamestringYes服务名
metadatastringNo服务元数据,默认为空
ephemeralbooleanNo是否为临时实例,默认为false
protectThresholdnumberNo保护阈值,默认为0
selectorstringNo访问策略,默认为空

Response Data

NameTypeDescription
databoolean是否执行成功

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间Id,默认为public
groupNamestringNo分组名,默认为DEFAULT_GROUP
serviceNamestringYes服务名

Response Data

NameTypeDescription
databoolean是否执行成功

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间Id,默认为public
groupNamestringNo分组名,默认为DEFAULT_GROUP
serviceNamestringYes服务名

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
namespaceIdstring服务所属的namespaceId。
groupNamestring服务所属的groupName。
serviceNamestring服务名。
ephemeralboolean服务的持久化属性,true为临时服务,false为持久化服务。
protectThresholdnumber服务防护阈值。
selectorobjectService selector.
metadataobjectService metadata.
clusterMapobjectService cluster map. The key is the cluster name and the value is the cluster details.
clusterMap.$ClusterName.clusterNamestring集群名。
clusterMap.$ClusterName.healthCheckerobjectHealth checker.
clusterMap.$ClusterName.healthyCheckPortinteger健康检查端口。
clusterMap.$ClusterName.useInstancePortForCheckboolean是否使用所注册的实例的IP:Port进行健康检查。
clusterMap.$ClusterName.metadatamap<string, string>Cluster metadata.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间Id,默认为public
pageNointegerYes当前页,默认为1
pageSizeintegerYes页条目数,默认为20,最大为500
groupNameParamstringNo-
ignoreEmptyServicebooleanNo-
serviceNameParamstringNo-
withInstancesbooleanNo-

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
totalCountinteger符合条件的服务的总数。
pageNumberinteger当前页码,起始为1
pagesAvailableinteger可用页码。
pageItemsarrayService list.
pageItems[i].namestring服务名。
pageItems[i].groupNamestring服务的分组名。
pageItems[i].clusterCountstring服务下的集群数量。
pageItems[i].ipCountstring服务下的实例数量。
pageItems[i].healthyInstanceCountstring服务下的健康实例数量。
pageItems[i].triggerFlagstring是否触发了服务的保护。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间Id,默认为public
groupNamestringNo分组名,默认为DEFAULT_GROUP
serviceNamestringYes服务名
metadatastringNo服务元数据,默认为空
protectThresholdnumberNo保护阈值,默认为0
selectorstringNo访问策略,默认为空
ephemeralbooleanNo-

Response Data

NameTypeDescription
databoolean是否执行成功

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNo命名空间ID,默认为public
serviceNamestringYes服务名称
groupNamestringNo分组Name,默认是DEFAULT_GROUP
pageNointegerYes页码
pageSizeintegerYes每页大小
aggregationbooleanNo是否聚合,默认为true

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
totalCountinteger符合条件的服务的总数。
pageNumberinteger当前页码,起始为1
pagesAvailableinteger可用页码。
pageItemsarrayService list.
pageItems[i].ipstring订阅者IP。
pageItems[i].portinteger订阅者端口。
pageItems[i].addressstring订阅者地址, 一般为ip:port
pageItems[i].agentstring订阅者客户端版本。
pageItems[i].appNamestring订阅者所属应用。
pageItems[i].namespaceIdstring订阅者所属命名空间。
pageItems[i].groupNamestring订阅的分组名。
pageItems[i].serviceNamestring订阅的服务名。

Examples

  • Request example
Terminal window
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

NameTypeDescription
dataarraySelector type list.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
namespaceIdstringNopublic命名空间
groupNamestringYesNone配置分组名
dataIdstringYesNone配置名

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
idstring配置在存储系统中的ID,一般为Long 类型的字符串。
dataIdstring配置ID。
groupNamestring配置分组。
namespaceIdstring命名空间ID。
contentstring配置内容。
descstring配置描述。
md5string配置内容的MD5值。
configTagsstring配置的标签。
encryptedDataKeystring加密配置内容的密钥,使用配置加密插件时存在。
appNamestring配置所属的应用名称。
typestring配置类型。
createTimeinteger配置创建时间。
modifyTimeinteger配置修改时间。
createUserstring配置创建人。
createIpstring配置创建IP。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
namespaceIdstringNopublic
groupNamestringYesNone
dataIdstringYesNone
contentstringYesNone
appNamestringNoNone
configTagsstringNoNone
descstringNoNone
typestringNoNone
encryptedDataKeystringNo-
srcUserstringNo-
tagstringNo-

Response Data

NameTypeDescription
databoolean是否执行成功

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
namespaceIdstringNopublic命名空间
groupNamestringYesNone配置分组名
dataIdstringYesNone配置名

Response Data

NameTypeDescription
databoolean是否执行成功

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
idsarrayYesConfig ID list. Separate multiple IDs with commas.

Response Data

NameTypeDescription
databoolean操作结果

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

NameTypeRequiredDefaultDescription
namespaceIdstringNopublic命名空间
dataIdstringYesNone配置ID
groupNamestringYesNone分组Name
aggregationbooleanNotrueWhether to aggregate data from other nodes.

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
queryTypestring订阅者查询Type,该接口为config
listenersStatusmap<string, string>订阅者列表,key为订阅者IP,value为订阅者订阅当前配置的MD5值。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
pageNointegerYes1
pageSizeintegerYes100
namespaceIdstringNopublic
dataIdstringYes""
groupNamestringYes""
appNamestringNo
configTagsstringNo
typestringNo
configDetailstringYes
searchstringNoSearch mode: blur or accurate. Defaults to blur.

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
totalCountinteger符合规则的配置总数。
pagesAvailableinteger可用页码总数。
pageNumberinteger当前页码。
pageItemsarrayConfigurations matching the query criteria.
pageItems[i].idstring配置在存储系统中的ID,一般为Long 类型的字符串。
pageItems[i].dataIdstring配置ID。
pageItems[i].groupNamestring配置分组。
pageItems[i].namespaceIdstring命名空间ID。
pageItems[i].md5string配置内容的MD5值。
pageItems[i].appNamestring配置所属的应用名称。
pageItems[i].typestring配置类型。
pageItems[i].createTimeinteger配置创建时间。
pageItems[i].modifyTimeinteger配置修改时间。

Examples

  • Request example
Terminal window
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配置

只有在发布配置时设置了HeaderbetaIps后,将配置变更为BETA发布中的状态,调用此接口才能停止BETA发布状态。

Since

3.0.0

Request Method

DELETE

Authorization

需对应命名空间的权限

Request URL

/nacos/v3/admin/cs/config/beta

Request Parameters

NameTypeRequiredDefaultDescription
namespaceIdstringNopublic命名空间
dataIdstringYesNone配置ID
groupNamestringYesNone分组Name

Response Data

NameTypeDescription
databoolean操作结果

Examples

  • Request example
Terminal window
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配置

只有在发布配置时设置了HeaderbetaIps后,将配置变更为BETA发布中的状态,调用此接口才能停止BETA发布状态。

Since

3.0.0

Request Method

GET

Authorization

需对应命名空间的权限

Request URL

/nacos/v3/admin/cs/config/beta

Request Parameters

NameTypeRequiredDefaultDescription
namespaceIdstringNopublic命名空间
dataIdstringYesNone配置ID
groupNamestringYesNone分组Name

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
idstringbeta配置的存储ID。
dataIdstring配置的dataId。
groupNamestring配置的groupName。
namespaceIdstring配置所属的命名空间。
descstring配置描述。
md5string配置内容的MD5值。
configTagsstring配置的标签。
encryptedDataKeystring加密配置内容的密钥,使用配置加密插件时存在。
appNamestring配置所属的应用名称。
typestring配置类型。
createTimeinteger配置创建时间。
modifyTimeinteger配置修改时间。
createUserstring配置创建人。
createIpstring配置创建IP。
grayNamestring灰度发布规则名称, 固定为beta
grayRulestring灰度发布规则,格式为JSON,其中的expr为beta的ip列表。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
namespaceIdstringNopublic
src_userstringNoNone
policystringNoABORT
fileMultipartFileNoZIP file containing skill package

Response Data

NameTypeDescription
datamap<string, object>Import result.
data.succCountinteger成功导入数量
data.skipCountinteger跳过导入数量

Examples

Terminal window
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

NameTypeRequiredDefaultDescription
namespaceIdstringNopublic
groupNamestringNo""
dataIdstringNo""
idsarrayNoNone
appNamestringNo-

使用时建议分开使用 idsdataId + groupName 的组合,只选择一种方式,另一类传入空字符串,否则可能导致导出文件为空内容。

Response Data

返回体为ZIP文件,包含配置内容和元数据

Examples

  • Request example
Terminal window
curl -X GET 'http://127.0.0.1:8848/nacos/v3/admin/cs/config/export?namespaceId=public&ids=' --output config.zip

3.11 克隆配置

Description

克隆配置到指定命名空间

Since

3.0.0

Request Method

POST

Authorization

需对应命名空间的权限

Request URL

/nacos/v3/admin/cs/config/clone

Request Parameters

NameTypeRequiredDefaultDescription
namespaceIdstringYespublic
policystringNoABORT
src_userstringNo-

Request Parameters

请求体类型为 application/json,为配置列表数组,每项为 SameNamespaceCloneConfigBeancfgIddataIdgroup)。

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
succCountinteger成功导入数量
skipCountinteger跳过导入数量

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
namespaceIdstringNopublic命名空间
groupNamestringYesNone配置分组名
dataIdstringYesNone配置名
pageNointegerYes1当前页
pageSizeintegerYes100(最大为500页条目数

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
totalCountinteger历史记录的总数。
pageNumberinteger当前页码,起始为1
pagesAvailableinteger可用页码。
pageItemsarrayHistory record list.
pageItems[i].idstring历史记录的ID。
pageItems[i].dataIdstring配置的dataId。
pageItems[i].groupNamestring配置的groupName。
pageItems[i].namespaceIdstring配置所属的命名空间。
pageItems[i].appNamestring配置所属的appName。
pageItems[i].opTypestring操作类型,I为插入、U为更新、D为删除。
pageItems[i].publishTypestring发布类型,formal为普通发布,gray为beta发布。
pageItems[i].srcIpstring发布的来源IP。
pageItems[i].srcUserstring发布的用户,仅在开启鉴权并登录用户后才发布配置才存在。
pageItems[i].createTimeinteger配置创建时间。
pageItems[i].modifyTimeinteger配置修改时间。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
namespaceIdstringNopublic命名空间
groupNamestringYesNone配置分组名
dataIdstringYesNone配置名
nidintegerYesNone配置历史Id

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
idstring历史记录的ID。
dataIdstring配置的dataId。
groupNamestring配置的groupName。
namespaceIdstring配置所属的命名空间。
contentstring
appNamestring配置所属的appName。
opTypestring操作类型,I为插入、U为更新、D为删除。
publishTypestring发布类型,formal为普通发布,gray为beta发布。
srcIpstring发布的来源IP。
srcUserstring发布的用户,仅在开启鉴权并登录用户后才发布配置才存在。
createTimeinteger配置创建时间。
modifyTimeinteger配置修改时间。
grayNamestring灰度发布规则名称, 固定为beta
extInfostringExtended information. It currently includes src_user, type, and c_desc; when publishType is gray, it also includes grayRule.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
namespaceIdstringNopublic命名空间
groupNamestringYesNone配置分组名
dataIdstringYesNone配置名
idintegerYesNone配置Id

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
idstring历史记录的ID。
dataIdstring配置的dataId。
groupNamestring配置的groupName。
namespaceIdstring配置所属的命名空间。
contentstring
appNamestring配置所属的appName。
opTypestring操作类型,I为插入、U为更新、D为删除。
publishTypestring发布类型,formal为普通发布,gray为beta发布。
srcIpstring发布的来源IP。
srcUserstring发布的用户,仅在开启鉴权并登录用户后才发布配置才存在。
createTimeinteger配置创建时间。
modifyTimeinteger配置修改时间。
grayNamestring灰度发布规则名称, 固定为beta
extInfostringExtended information. It currently includes src_user, type, and c_desc; when publishType is gray, it also includes grayRule.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
namespaceIdstringYesNone命名空间

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
dataIdstring配置的dataId。
groupNamestring配置的groupName。

其他字段均无用。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
groupNamestringNoNone分组Name
namespaceIdstringNoNone命名空间ID

注意groupNamenamespaceId 至少需要提供一个。

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
idinteger容量信息的唯一ID
groupNamestring分组Name
namespaceIdstring命名空间ID
quotainteger配额
usageinteger当前使用量
maxSizeinteger最大单配置大小
gmtCreatestring创建时间,将废弃
gmtModifiedstring最后修改时间,将废弃
maxAggrCountinteger未使用,将废弃
maxAggrSizeinteger未使用,将废弃

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
groupNamestringYes分组Name,与命名空间ID 两者必须有其一
namespaceIdstringNo命名空间ID,与分组Name 两者必须有其一
quotaintegerNo配额
maxSizeintegerNo最大大小
maxAggrCountintegerNo-
maxAggrSizeintegerNo-

Response Data

NameTypeDescription
databoolean操作结果

Examples

  • Request example
Terminal window
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/cs/capacity' -d 'namespaceId=public&quota=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

NameTypeDescription
datastring操作结果

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
logNamestringYesNone模块Name
logLevelstringYesNone日志级别(如INFODEBUG

Response Data

NameTypeDescription
datastring操作结果

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
sqlstringYesNoneSQL 查询语句

Response Data

NameTypeDescription
dataarrayQuery result.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
fileMultipartFileNoNone导入文件(SQL 文件)。

Response Data

NameTypeDescription
datastring导入结果信息

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
ipstringYesNone客户端 IP 地址
allbooleanNofalse是否返回所有配置信息
namespaceIdstringNopublic命名空间ID
aggregationbooleanNotrue是否从其他节点聚合

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
queryTypestring订阅者查询Type,该接口为ip
listenersStatusmap<string, string>订阅者列表,key为订阅的配置信息,格式为dataId+groupName+namespaceId,value为订阅者订阅当前配置的MD5值。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
ipstringYesNone客户端 IP 地址
dataIdstringNoNone配置ID
groupNamestringNoNone分组Name
namespaceIdstringNopublic命名空间ID

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
data服务信息
data.{namespaceId}.isFixedServerboolean是否固定服务器
data.{namespaceId}.snapshotDirstring快照目录路径
data.{namespaceId}.clientVersionstring客户端版本
data.{namespaceId}.serverUrlsstring服务器URL列表
data.{namespaceId}.listenConfigSizeinteger监听配置大小
data.{namespaceId}.metricValues.cacheDatastring缓存数据md5值
data.{namespaceId}.metricValues.snapshotDatastring快照数据md5值

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
ipstringYesNone客户端 IP 地址
dataIdstringNoNone配置ID
groupNamestringNoNone分组Name
namespaceIdstringNopublic命名空间

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
data服务信息
data.{namespaceId}.isFixedServerboolean是否固定服务器
data.{namespaceId}.snapshotDirstring快照目录路径
data.{namespaceId}.clientVersionstring客户端版本
data.{namespaceId}.serverUrlsstring服务器URL列表
data.{namespaceId}.listenConfigSizeinteger监听配置大小
data.{namespaceId}.metricValues.cacheDatastring缓存数据md5值
data.{namespaceId}.metricValues.snapshotDatastring快照数据md5值

Examples

  • Request example
Terminal window
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

NameTypeRequiredDefaultDescription
dataIdstringYesNone配置ID
groupNamestringYesNone分组Name
namespaceIdstringNopublic命名空间
descstringNonull配置的新Description
configTagsstringNonull配置的新标签

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
databoolean操作结果

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID. Defaults to public when omitted.
groupNamestringYesConfiguration group name.
dataIdstringYesConfiguration ID.
grayNamestringYesGray configuration name.

Response Data

NameTypeDescription
data.dataIdstringConfiguration ID.
data.groupNamestringConfiguration group name.
data.namespaceIdstringNamespace ID.
data.contentstringGray configuration content.
data.grayNamestringGray configuration name.
data.grayRulestringGray matching rule.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID. Defaults to public when omitted.
groupNamestringYesConfiguration group name.
dataIdstringYesConfiguration ID.
contentstringYesGray configuration content.
grayNamestringYesGray configuration name.
grayTypestringNoGray rule type.
grayMatchRuleExpstringYesGray matching rule expression.
grayVersionstringYesGray version.
grayPriorityintegerNoGray rule priority.
typestringNoConfiguration type.
srcUserstringNoOperator username.
encryptedDataKeystringNoData key for encrypted configuration content.

Response Data

NameTypeDescription
databooleanWhether the gray configuration was published successfully.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID. Defaults to public when omitted.
groupNamestringYesConfiguration group name.
dataIdstringYesConfiguration ID.
grayNamestringYesGray configuration name.

Response Data

NameTypeDescription
databooleanWhether the gray configuration was deleted successfully.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
pageNointegerYes当前页,默认为1
pageSizeintegerYes页条目数,默认为20,最大为500
namespaceIdstringNoMCP服务的命名空间ID,默认为public
mcpNamestringNoMCP服务的名字模版,为空时查询所有MCP服务,当searchblur时,可使用*进行模糊搜索
searchstringNoSearch mode: blur or accurate. Defaults to blur.

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
totalCountinteger符合条件的服务的总数。
pageNumberinteger当前页码,起始为1
pagesAvailableinteger可用页码。
pageItemsarrayService list.
pageItems[i].idstringMCP service ID, usually a UUID.
pageItems[i].namestringMCP service name.
pageItems[i].protocolstringMCP protocol, such as stdio, sse, streamable, http, or dubbo.
pageItems[i].frontProtocolstringFrontend 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].descriptionstringMCP service description.
pageItems[i].repositorystringMCP service repository.
pageItems[i].versionDetailobjectLatest version information of the MCP service.
pageItems[i].localServerConfigmap<string, object>Startup information for a local MCP service when the MCP service type is stdio.
pageItems[i].remoteServerConfigobjectRemote service information when the MCP service type is not stdio.
pageItems[i].latestPublishedVersionstringLatest published version of the MCP service.
pageItems[i].versionDetailsarrayMCP service version details.
pageItems[i].capabilitiesarrayCapability types supported by the MCP service, such as TOOL, PROMPT, and RESOURCE.

其中VersionDetail结构如下:

NameTypeDescription
versionstringMCP service version.
release_datestringMCP service release time.
is_latestbooleanWhether this is the latest version of the MCP service.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoMCP服务的命名空间ID,默认为public
mcpIdstringNoMCP服务的ID,一般为UUID,与mcpName二选一输入,建议传入此值。
mcpNamestringNoMCP服务的名字模版,与mcpId二选一输入,建议传入mcpId
versionstringNoMCP服务的版本,未传入是返回最新版本

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
idstringMCP服务的ID,一般为UUID。
namestringMCP服务名。
namespaceIdstringMCP服务所属的命名空间ID。
protocolstringMCP的协议,如stdio,sse,streamable,http,dubbo等。
frontProtocolstringMCP的前端暴露协议,一般是提供给协议转换器(如网关)使用,若无转换器,则与protocol相同,如stdio,sse,streamable,http,dubbo等。
descriptionstringMCP服务的描述。
repositorystringMCP服务的存储仓库。
versionDetailobjectQueried version information of the MCP service.
localServerConfigmap<string, object>Startup information for a local MCP service when the MCP service type is stdio.
remoteServerConfigobjectRemote service information when the MCP service type is not stdio.
enabledbooleanMCP服务是否启用。
capabilitiesarrayCapability types supported by the MCP service, such as TOOL, PROMPT, and RESOURCE.
backendEndpointsarrayBackend endpoint details when the MCP service type is not stdio.
toolSpecmap<string, object>Tool details when the MCP service supports the TOOL capability.
allVersionsarrayAll version details of the MCP service.

其中VersionDetail结构如下:

NameTypeDescription
versionstringMCP service version.
release_datestringMCP service release time.
is_latestbooleanWhether this is the latest version of the MCP service.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoMCP服务的命名空间ID,默认为public
serverSpecificationstringYesMCP服务的描述详情
toolSpecificationstringNoMCP服务的工具描述详情
endpointSpecificationstringNoMCP服务的远端服务地址详情,仅在非stdio协议时生效
overrideExistingbooleanNoMCP服务更新时是否覆盖原 endpointSpecification,仅在非stdio协议时生效
latestbooleanNo-

其中serverSpecificationtoolSpecificationendpointSpecification参数的详细内容如下:

serverSpecification

NameTypeDescription
idstringMCP服务的ID,一般为UUID,必须传入,用于定位待更新的MCP服务。
namestringMCP服务名。
protocolstringMCP的协议,如stdio,sse,streamable,http,dubbo等。
frontProtocolstringMCP的前端暴露协议,一般是提供给协议转换器(如网关)使用,若无转换器,则与protocol相同,如stdio,sse,streamable,http,dubbo等。
descriptionstringMCP服务的描述。
repositorystringMCP服务的存储仓库。
versionDetailobjectMCP service version information.
versionstringMCP服务的简易版本版本信息,主要用于兼容,若已设置versionDetail,则该字段无效。
localServerConfigmap<string, object>Startup information for a local MCP service when the MCP service type is stdio.
remoteServerConfigobjectRemote service information when the MCP service type is not stdio.
enabledbooleanMCP服务是否启用。
capabilitiesarrayCapability types supported by the MCP service, such as TOOL, PROMPT, and RESOURCE.

其中VersionDetail结构如下:

NameTypeDescription
versionstringMCP服务的版本号。
release_datestringMCP服务的版本发布时间。
is_latestbooleanMCP服务的版本是否为最新版本。

toolSpecification

NameTypeDescription
toolsarrayTool list provided by the MCP Server. See the standard MCP protocol definition of MCP Tool.
toolsMetamap<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.
securitySchemesarrayMCP tool security schemes. See the standard MCP protocol.

其中McpTool结构如下:

NameTypeDescription
namestringMCP 工具的名称
descriptionstringMCP 工具的描述
inputSchemamap<string, object>MCP tool input schema. See the standard MCP protocol; it mainly includes type, required flag, and description.

其中McpToolMeta 结构如下:

NameTypeDescription
invokeContextmap<string, string>MCP 工具调用时的上下文信息,如后端服务的Path等。
enabledbooleanMCP工具是否启用。
templatesmap<string, string>MCP工具的模板信息。用于进行协议转换时进行参数的映射。

其中SecurityScheme 结构如下:

NameTypeDescription
idstring安全方案的ID,将被MCP工具使用和引用。。
typestring安全方案的类型。可能的值包括:httpapiKeylocalEnv或其他自定义扩展。
schemestring安全方案的子方案类型。当 typehttp 时使用。可能的值包括:basicbearer
instring安全方案的位置。可能的值有:queryheader
namestring安全方案的名称。当 typeapiKeylocalEnv 时使用。例如,apiKey 的密钥名称或 localEnv 的环境名称。
defaultCredentialstring当配置参数中未输入身份时的默认凭证。可选。

endpointSpecification

NameTypeDescription
typestringMCP endpoint的后端服务类型,可选值REFDIRECT.
datamap<string, string>MCP endpoint的后端服务的实际数据, 根据type的不同,传入的参数不同,如REF传入的为namespaceId, groupNameserviceNameDIRECT传入的为addressport

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
datastringMCP服务更新结果。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoMCP服务的命名空间ID,默认为public
serverSpecificationstringYesMCP服务的描述详情
toolSpecificationstringNoMCP服务的工具描述详情
endpointSpecificationstringNoMCP服务的远端服务地址详情,仅在非stdio协议时生效

其中serverSpecificationtoolSpecificationendpointSpecification参数的详细内容如下:

serverSpecification

NameTypeDescription
idstringMCP服务的ID,一般为UUID,无需传入,系统自动生成。
namestringMCP服务名。
protocolstringMCP的协议,如stdio,sse,streamable,http,dubbo等。
frontProtocolstringMCP的前端暴露协议,一般是提供给协议转换器(如网关)使用,若无转换器,则与protocol相同,如stdio,sse,streamable,http,dubbo等。
descriptionstringMCP服务的描述。
repositorystringMCP服务的存储仓库。
versionDetailobjectMCP service version information.
versionstringMCP服务的简易版本版本信息,主要用于兼容,若已设置versionDetail,则该字段无效。
localServerConfigmap<string, object>Startup information for a local MCP service when the MCP service type is stdio.
remoteServerConfigobjectRemote service information when the MCP service type is not stdio.
enabledbooleanMCP服务是否启用。
capabilitiesarrayCapability types supported by the MCP service, such as TOOL, PROMPT, and RESOURCE.

其中VersionDetail结构如下:

NameTypeDescription
versionstringMCP服务的版本号。
release_datestringMCP服务的版本发布时间。
is_latestbooleanMCP服务的版本是否为最新版本。

toolSpecification

NameTypeDescription
toolsarrayTool list provided by the MCP Server. See the standard MCP protocol definition of MCP Tool.
toolsMetamap<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.
securitySchemesarrayMCP tool security schemes. See the standard MCP protocol.

其中McpTool结构如下:

NameTypeDescription
namestringMCP 工具的名称
descriptionstringMCP 工具的描述
inputSchemamap<string, object>MCP tool input schema. See the standard MCP protocol; it mainly includes type, required flag, and description.

其中McpToolMeta 结构如下:

NameTypeDescription
invokeContextmap<string, string>MCP 工具调用时的上下文信息,如后端服务的Path等。
enabledbooleanMCP工具是否启用。
templatesmap<string, string>MCP工具的模板信息。用于进行协议转换时进行参数的映射。

其中SecurityScheme 结构如下:

NameTypeDescription
idstring安全方案的ID,将被MCP工具使用和引用。。
typestring安全方案的类型。可能的值包括:httpapiKeylocalEnv或其他自定义扩展。
schemestring安全方案的子方案类型。当 typehttp 时使用。可能的值包括:basicbearer
instring安全方案的位置。可能的值有:queryheader
namestring安全方案的名称。当 typeapiKeylocalEnv 时使用。例如,apiKey 的密钥名称或 localEnv 的环境名称。
defaultCredentialstring当配置参数中未输入身份时的默认凭证。可选。

endpointSpecification

NameTypeDescription
typestringMCP endpoint的后端服务类型,可选值REFDIRECT.
datamap<string, string>MCP endpoint的后端服务的实际数据, 根据type的不同,传入的参数不同,如REF传入的为namespaceId, groupNameserviceNameDIRECT传入的为addressport

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
datastring新建MCP服务的id。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoMCP服务的命名空间ID,默认为public
mcpIdstringNoMCP服务的ID,一般为UUID,与mcpName二选一输入,建议传入此值。
mcpNamestringNoMCP服务的名字模版,与mcpId二选一输入,建议传入mcpId
versionstringNoMCP服务的版本,未传入是为最新版本

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
datastringMCP服务删除结果。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoAgentCard所属的命名空间,默认public
agentNamestringYesAgentCard的名称

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
data[i].versionstringAgentCard的版本号。
data[i].createdAtstring该版本的创建时间。
data[i].updatedAtstring该版本的最后更新时间。
data[i].latestboolean该版本是否标记为最新发布版本。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
pageNointegerYes当前页,默认为1
pageSizeintegerYes页条目数,默认为100
namespaceIdstringNoAgentCard的命名空间ID,默认为public
agentNamestringNoAgentCard的名称,为空是查询所有AgentCard
searchstringNoblur or accurate

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
totalCountinteger符合条件的服务的总数。
pageNumberinteger当前页码,起始为1
pagesAvailableinteger可用页码。
pageItemsarrayService list.
pageItems[i].protocolVersionstringA2A protocol version of the AgentCard.
pageItems[i].namestringAgentCard name.
pageItems[i].descriptionstringAgentCard description.
pageItems[i].versionstringAgentCard version.
pageItems[i].iconUrlstringAgentCard icon URL.
pageItems[i].capabilitiesobjectAgentCard capabilities, matching A2A standard capabilities.
pageItems[i].skillsarrayAgentCard skill list, matching A2A standard skill.
pageItems[i].latestPublishedVersionstringLatest published version of the AgentCard.
pageItems[i].versionDetailsarrayAll version details of the AgentCard.
pageItems[i].registrationTypestringDefault registration type of the AgentCard. Optional values are URL and SERVICE.

其中AgentVersionDetail包含内容如下:

NameTypeDescription
versionstringAgentCard version.
createdAtstringCreation time of this version.
updatedAtstringLast update time of this version.
latestbooleanWhether this version is marked as the latest published version.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoAgentCard所属的命名空间,默认public
agentNamestringYesAgentCard的名称
versionstringNoAgentCard的版本号,为空时返回最新版本详情
registrationTypestringNoAgentCard的默认注册类型,可选URLSERVICE。未填写时根据此AgentCard的默认registrationType进行url的生成

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
protocolVersionstringAgentCard的A2A协议版本。
namestringAgentCard的名称。
descriptionstringAgentCard的描述。
versionstringAgentCard的版本号。
iconUrlstringAgentCard的iconURL。
capabilitiesobjectAgentCard capabilities, matching A2A standard capabilities.
skillsarrayAgentCard skill list, matching A2A standard skill.
urlstringAgentCard的默认访问的URL。
preferredTransportstringAgentCard的默认访问URL的传输协议,应该为JSONRPC,GRPC,HTTP+JSON
additionalInterfacesarrayAll accessible interfaces of the AgentCard, matching the A2A standard.
providerobjectAgentCard provider information, matching the A2A standard.
documentationUrlstringAgentCard的文档 URL。
securitySchemesmap<string, object>AgentCard security scheme definitions, matching the A2A standard.
securityarrayAll security requirement objects of the AgentCard.
defaultInputModesarrayAll default input modes of the AgentCard.
defaultOutputModesarrayAll default output modes of the AgentCard.
supportsAuthenticatedExtendedCardstringAgentCard是否支持认证的扩展卡。
registrationTypestringAgentCard的默认注册类型,可选URLSERVICE
latestVersionstringAgentCard当前版本时否为最新版本。

Examples

  • Request example
Terminal window
curl -X GET '127.0.0.1:8848/nacos/v3/admin/ai/a2a?namespaceId=public&agentName=GeoSpatial+Route+Planner+Agent&version=1.0.0&registrationType=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

NameTypeRequiredDescription
namespaceIdstringNoAgentCard所属的命名空间,默认public
agentCardstringYesAgentCard的完整对象,详情请参考标准AgentCard
registrationTypestringNoAgentCard的默认注册类型,可选URLSERVICE。未填写时根据此AgentCard的默认registrationType进行url的生成
setAsLatestbooleanNo是否设置此版本为最新发布版本,默认为false

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
datastringAgentCard服务更新结果。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoAgentCard所属的命名空间,默认public
agentCardstringYesAgentCard的完整对象,详情请参考标准AgentCard
registrationTypestringNoAgentCard的默认注册类型,可选URLSERVICE。未填写时根据此AgentCard的默认registrationType进行url的生成, 默认为URL

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
datastringAgentCard发布结果。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoAgentCard所属的命名空间,默认public
agentNamestringYesAgentCard的名称
versionstringNoAgentCard的版本号,为空时返回最新版本详情

Response Data

返回体遵循Nacos open API 统一返回体格式,下表只阐述data字段中的返回参数。

NameTypeDescription
datastringAgentCard删除结果。

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace. Defaults to public.
promptKeystringYesPrompt key.
versionstringYesVersion.
templatestringNoTemplate content.
commitMsgstringNoCommit message.
descriptionstringNoDescription.
bizTagsstringNoBusiness tags.
variablesstringNoPrompt 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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt 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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
versionstringNoVersion.
labelstringNoLabel.
md5stringNoContent 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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
labelstringYesLabel name.
versionstringYesVersion.

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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
labelstringYesLabel 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
Terminal window
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

NameTypeRequiredDescription
pageNointegerYesPage number.
pageSizeintegerYesNumber of records per page.
namespaceIdstringNoNamespace.
promptKeystringNoPrompt key filter.
searchstringNoSearch mode: blur or accurate.
bizTagsstringNoBusiness 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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt 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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
descriptionstringNoDescription.
bizTagsstringNoBusiness 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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
pageNointegerYesPage number.
pageSizeintegerYesNumber 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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
bizTagsstringNoBusiness 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
descriptionstringYesDescription.

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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
basedOnVersionstringNoVersion to base the draft on.
targetVersionstringNoTarget version.
templatestringNoTemplate content.
variablesstringNoPrompt template variable definitions as a JSON string.
commitMsgstringNoCommit message.
descriptionstringNoDescription.
bizTagsstringNoBusiness 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
templatestringYesTemplate content.
variablesstringNoPrompt template variable definitions as a JSON string.
commitMsgstringNoCommit 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
versionstringYesVersion number.
updateLatestLabelbooleanNoWhether 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
labelsstringYesLabel 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
versionstringYesVersion 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
versionstringYesVersion 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
versionstringYesVersion number.
updateLatestLabelbooleanNoWhether 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
versionstringYesVersion 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
versionstringNoVersion 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
versionstringNoVersion 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
promptKeystringYesPrompt key.
versionstringNoVersion 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
skillNamestringYesSkill 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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
skillNamestringNoSkill name.
basedOnVersionstringNoCreate the draft based on this version.
targetVersionstringNoTarget version.
skillCardstringNoSkill 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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
skillCardstringYesSkill card JSON string containing complete Skill information
skillNamestringYesSkill 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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
skillNamestringYesSkill 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
Terminal window
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

NameTypeRequiredDescription
pageNointegerYesPage number.
pageSizeintegerYesPage size.
filterableFormstringYesFilter condition form.
namespaceIdstringNoNamespace.
skillNamestringNoSkill name filter.
searchstringNoSearch 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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID. Defaults to public.
overwritebooleanNoWhether to overwrite an existing skill with the same name.
targetVersionstringNoTarget version after upload.
commitMsgstringNoCommit message.
filefileNoZIP 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
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
skillNamestringYesSkill 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
skillNamestringYesSkill name.
bizTagsstringYesBusiness 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
skillNamestringYesSkill name.
labelsstringYesLabel 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

MethodRequest URLKey parameters
POST/nacos/v3/admin/ai/skills/offlinenamespaceIdskillNamescopeversion
POST/nacos/v3/admin/ai/skills/onlinenamespaceIdskillNamescopeversion
POST/nacos/v3/admin/ai/skills/publishnamespaceIdskillNameversionupdateLatestLabel
PUT/nacos/v3/admin/ai/skills/scopenamespaceIdskillNamescope
POST/nacos/v3/admin/ai/skills/submitnamespaceIdskillNameversion

7.11. Get Skill Version Details

Since

3.2.0

Request Method

GET

Request URL

/nacos/v3/admin/ai/skills/version

Request Parameters

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
skillNamestringYesSkill name.
versionstringNoVersion 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
skillNamestringYesSkill name.
versionstringNoVersion 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
skillNamestringYesSkill name.
scopestringNoUse ‘skill’ for skill-level offline; otherwise version-level
versionstringNoVersion identifier.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
skillNamestringYesSkill name.
scopestringNoUse ‘skill’ for skill-level online; otherwise version-level
versionstringNoVersion identifier.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
skillNamestringYesSkill name.
versionstringYesVersion identifier.
updateLatestLabelbooleanNoWhether to update the latest label after publishing.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
skillNamestringYesSkill name.
scopestringYesPUBLIC or PRIVATE

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
skillNamestringYesSkill name.
versionstringNoVersion identifier.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
skillNamestringYesSkill name.
versionstringYesVersion number.
updateLatestLabelbooleanNoWhether 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
skillNamestringYesSkill name.
versionstringYesVersion 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
overwritebooleanNoWhether to overwrite existing skills with the same names.
filefileNoZIP package containing multiple Skill subdirectories.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.data.namespaceIdstring-
data.data.namestring-
data.data.descriptionstring-
data.data.updateTimeinteger-
data.data.enableboolean-
data.data.bizTagsstring-
data.data.fromstring-
data.data.scopestring-
data.data.labelsobject-
data.data.editingVersionstring-
data.data.reviewingVersionstring-
data.data.onlineCntinteger-
data.data.downloadCountinteger-
data.data.versionsarray-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.
bizTagsstringYesBusiness tags; pass multiple tags using the agreed format.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.
basedOnVersionstringNoBase version used to create the draft.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringNoAgentSpec name.
agentSpecCardstringYesAgentSpec card JSON string containing complete AgentSpec information

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.
labelsstringYesVersion labels, usually as a JSON string.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
pageNointegerYesPage number, starting from 1.
pageSizeintegerYesNumber of items per page.
filterableFormstringYesFilter condition form.
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringNoAgentSpec name.
searchstringNoSearch mode: accurate or blur.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.
scopestringNoUse ‘agentspec’ for agentspec-level offline; otherwise version-level
versionstringNoVersion identifier.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.
scopestringNoUse ‘agentspec’ for agentspec-level online; otherwise version-level
versionstringNoVersion identifier.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.
versionstringYesVersion identifier.
updateLatestLabelbooleanNoWhether to update the latest label after publishing.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.
scopestringYesPUBLIC or PRIVATE

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.
versionstringNoVersion identifier.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
overwritebooleanNoWhether to overwrite an existing resource with the same name.
filefileNoZIP file containing AgentSpec package.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.datastring-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.
versionstringNoVersion identifier.

Response Data

NameTypeDescription
data.codeinteger-
data.messagestring-
data.data.namespaceIdstring-
data.data.namestring-
data.data.descriptionstring-
data.data.bizTagsstring-
data.data.contentstring-
data.data.resourceobject-

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.
versionstringYesVersion number.
updateLatestLabelbooleanNoWhether 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.
versionstringYesVersion 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace ID, default is public.
agentSpecNamestringYesAgentSpec name.
versionstringNoVersion 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

NameTypeRequiredDescription
resourceTypestringYesResource type.
resourceNamestringNoResource name.
namespaceIdstringNoNamespace.
versionstringNoResource version.
pageNointegerYesPage number.
pageSizeintegerYesPage size.

Response Data

NameTypeDescription
data.codeintegerResponse code.
data.messagestringResponse message.
data.datastringPaginated Pipeline execution records.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
pipelineIdstringYesPipeline ID.

Response Data

NameTypeDescription
data.codeintegerResponse code.
data.messagestringResponse message.
data.data.executionIdstringPipeline execution ID.
data.data.resourceTypestringResource type.
data.data.resourceNamestringResource name.
data.data.namespaceIdstringNamespace.
data.data.versionstringResource version.
data.data.statusstringExecution status.
data.data.pipelinearrayPipeline stage information.
data.data.createTimeintegerCreation time.
data.data.updateTimeintegerUpdate time.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
resourceTypestringYesResource type.
resourceNamestringNoResource name.
namespaceIdstringNoNamespace.
versionstringNoResource version.
pageNointegerYesPage number.
pageSizeintegerYesPage size.

Response Data

NameTypeDescription
data.codeintegerResponse code.
data.messagestringResponse message.
data.datastringPaginated Pipeline execution records.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
pipelineIdstringYesPipeline ID.

Response Data

NameTypeDescription
data.codeintegerResponse code.
data.messagestringResponse message.
data.data.executionIdstringPipeline execution ID.
data.data.resourceTypestringResource type.
data.data.resourceNamestringResource name.
data.data.namespaceIdstringNamespace.
data.data.versionstringResource version.
data.data.statusstringExecution status.
data.data.pipelinearrayPipeline stage information.
data.data.createTimeintegerCreation time.
data.data.updateTimeintegerUpdate time.

Examples

  • Request example
Terminal window
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

NameTypeRequiredDescription
resourceTypestringNoResource 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
resourceTypestringYesResource type.
sourceIdstringYesImport source ID.
querystringNoSearch keyword.
cursorstringNoPagination cursor.
limitintegerNoResult limit.
optionsstringNoExtension 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
resourceTypestringYesResource type.
sourceIdstringYesImport source ID.
selectedItemsstringYesResource items to validate as a JSON string.
overwriteExistingbooleanNoWhether to overwrite existing resources.
optionsstringNoExtension 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

NameTypeRequiredDescription
namespaceIdstringNoNamespace.
resourceTypestringYesResource type.
sourceIdstringYesImport source ID.
selectedItemsstringYesResource items to import as a JSON string.
overwriteExistingbooleanNoWhether to overwrite existing resources.
skipInvalidbooleanNoWhether to skip invalid resource items.
validationTokenstringNoValidation token.
optionsstringNoExtension options as a JSON string.