Nacos API
  1. 服务发现
Nacos API
  • 概述
    • Nacos 简介
    • 概念
    • 架构
  • 配置管理
    • 获取配置
      GET
    • 监听配置
      POST
    • 发布配置
      POST
    • 删除配置
      DELETE
    • 查历史版本
      GET
    • 查询历史版本详情
      GET
    • 查询配置上一版本信息
      GET
  • 服务发现
    • 注销实例
      DELETE
    • 注册实例
      POST
    • 修改实例
      PUT
    • 查询实例列表
      GET
    • 查询实例详情
      GET
    • 发送实例心跳
      PUT
    • 创建服务
      POST
    • 删除服务
      DELETE
    • 修改服务
      PUT
    • 查询服务
      GET
    • 查询服务列表
      GET
    • 查询系统开关
      GET
    • 修改系统开关
      PUT
    • 查看系统当前数据指标
      GET
    • 查看当前集群Server列表
      GET
    • 查看当前集群leader
      GET
    • 更新实例的健康状态
      PUT
    • 批量更新实例元数据(Beta)
      PUT
    • 批量删除实例元数据(Beta)
      DELETE
  • 命名空间
    • 查询命名空间列表
    • 创建命名空间
    • 修改命名空间
    • 删除命名空间
  1. 服务发现

查询实例列表

GET
/nacos/v1/ns/instance/list
查询服务下的实例列表
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request GET 'http://127.0.0.1:8848/nacos/v1/ns/instance/list?serviceName={{serviceName1}}'
Response Response Example
{
    "name": "DEFAULT_GROUP@@nacos.test.1",
    "groupName": "DEFAULT_GROUP",
    "clusters": "",
    "cacheMillis": 10000,
    "hosts": [
        {
            "instanceId": "10.10.10.10#8888#DEFAULT#DEFAULT_GROUP@@nacos.test.1",
            "ip": "10.10.10.10",
            "port": 8888,
            "weight": 1,
            "healthy": false,
            "enabled": true,
            "ephemeral": false,
            "clusterName": "DEFAULT",
            "serviceName": "DEFAULT_GROUP@@nacos.test.1",
            "metadata": {},
            "instanceHeartBeatInterval": 5000,
            "instanceIdGenerator": "simple",
            "instanceHeartBeatTimeOut": 15000,
            "ipDeleteTimeout": 30000
        }
    ],
    "lastRefTime": 1528787794594,
    "checksum": "",
    "allIPs": false,
    "reachProtectionThreshold": false,
    "valid": true
}

Request

Query Params
serviceName
string 
required
服务名
Example:
{{serviceName1}}
groupName
string 
optional
分组名
namespaceId
string 
optional
命名空间ID
clusters
string 
optional
集群名称
healthyOnly
string 
optional
是否只返回健康实例

Responses

🟢200成功
application/json
Body
name
string 
required
groupName
string 
required
clusters
string 
required
cacheMillis
integer 
required
hosts
array [object {14}] 
required
instanceId
string 
optional
ip
string 
optional
port
integer 
optional
weight
integer 
optional
healthy
boolean 
optional
enabled
boolean 
optional
ephemeral
boolean 
optional
clusterName
string 
optional
serviceName
string 
optional
metadata
object 
optional
instanceHeartBeatInterval
integer 
optional
instanceIdGenerator
string 
optional
instanceHeartBeatTimeOut
integer 
optional
ipDeleteTimeout
integer 
optional
lastRefTime
integer 
required
checksum
string 
required
allIPs
boolean 
required
reachProtectionThreshold
boolean 
required
valid
boolean 
required
Previous
修改实例
Next
查询实例详情
Built with