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
查询一个服务下个某个实例详情。
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request GET 'http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName={{serviceName2}}&ip={{ip}}&port={{port}}'
Response Response Example
{
    "metadata": {},
    "instanceId": "10.10.10.10-8888-DEFAULT-nacos.test.2",
    "port": 8888,
    "service": "nacos.test.2",
    "healthy": false,
    "ip": "10.10.10.10",
    "clusterName": "DEFAULT",
    "weight": 1
}

Request

Query Params
serviceName
string 
required
服务名
Example:
{{serviceName2}}
groupName
string 
optional
分组名
ip
string 
required
实例IP
Example:
{{ip}}
port
string 
required
实例端口
Example:
{{port}}
namespaceId
string 
optional
命名空间ID
cluster
string 
optional
集群名称
Example:
DEFAULT
healthyOnly
string 
optional
boolean,默认为false,是否只返回健康实例
Example:
false
ephemeral
string 
optional
boolean,是否临时实例

Responses

🟢200成功
application/json
Body
metadata
object 
required
instanceId
string 
required
port
integer 
required
service
string 
required
healthy
boolean 
required
ip
string 
required
clusterName
string 
required
weight
integer 
required
Previous
查询实例列表
Next
发送实例心跳
Built with