Instances
Instance registration, query, and isolation.
Instance registration, query, and isolation.
Default Base URL: http://127.0.0.1:8090. Management APIs require Authorization (token from login).
Instances
Query/manage instances; client registration is under Client APIs. Write bodies are Instance arrays.
/naming/v1/instancesAuth requiredList instances
Filter by service/host/etc. Enrich mislabels Path; all are query.
Parameters
- Authorizationheader · stringrequired
Token from login.
- servicequery · stringoptional
Service (provide service/namespace/host filters).
- namespacequery · stringoptional
Namespace.
- hostquery · stringoptional
Host.
- idquery · stringoptional
Instance ID.
- healthyquery · booloptional
Healthy.
- isolatequery · booloptional
Isolated.
- protocolquery · stringoptional
Protocol.
- versionquery · stringoptional
Version.
- keysquery · stringoptional
Metadata keys.
- valuesquery · stringoptional
Metadata values.
- offsetquery · integeroptional
Offset.
- limitquery · integeroptional
Page size.
curl -sS 'http://127.0.0.1:8090/naming/v1/instances?namespace=default&service=payment' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success",
"instances": [{ "host": "10.0.0.8", "port": 8080, "healthy": true }]
}/naming/v1/instancesAuth requiredCreate instances
Write bodies are usually protobuf message arrays; fields below are per-object (see specification).
Parameters
- Authorizationheader · stringrequired
Token from login.
- (body)body · Instance[]required
Request body is a JSON array of Instance: [{...}, ...]. Fields below are the full per-item schema (including nested).
- idbody · stringoptional
id
- servicebody · stringoptional
service
- namespacebody · stringrequired
namespace
- hostbody · stringrequired
host
- portbody · uint32optional
port
- protocolbody · stringoptional
protocol
- versionbody · stringoptional
version
- prioritybody · uint32optional
priority
- weightbody · uint32optional
weight
- enable_health_checkbody · booloptional
enable_health_check
- health_checkbody · HealthCheckoptional
health_check
- typebody · enum(HealthCheckType)optional
type enum: UNKNOWN | HEARTBEAT | TCP | HTTP
- heartbeatbody · HeartbeatHealthCheckoptional
heartbeat
- ttlbody · uint32optional
ttl
- tcpbody · TcpHealthCheckoptional
tcp
- intervalbody · uint32optional
interval
- httpbody · HttpHealthCheckoptional
http
- intervalbody · uint32optional
interval
- pathbody · stringoptional
path
- healthybody · booloptional
healthy
- isolatebody · booloptional
isolate
- locationbody · Locationoptional
location
- regionbody · stringoptional
region
- zonebody · stringoptional
zone
- campusbody · stringoptional
campus
- metadatabody · map<string,string>optional
metadata
Response fields
- codebody · uint32required
Business code; success is usually 200000.
- infobody · stringoptional
Info message.
- instancebody · Instanceoptional
Instance entity fields (batch APIs nest under responses[]).
- idbody · stringoptional
id
- servicebody · stringoptional
service
- namespacebody · stringoptional
namespace
- hostbody · stringoptional
host
- portbody · uint32optional
port
- protocolbody · stringoptional
protocol
- versionbody · stringoptional
version
- prioritybody · uint32optional
priority
- weightbody · uint32optional
weight
- enable_health_checkbody · booloptional
enable_health_check
- health_checkbody · HealthCheckoptional
health_check
- typebody · enum(HealthCheckType)optional
type enum: UNKNOWN | HEARTBEAT | TCP | HTTP
- heartbeatbody · HeartbeatHealthCheckoptional
heartbeat
- ttlbody · uint32optional
ttl
- tcpbody · TcpHealthCheckoptional
tcp
- intervalbody · uint32optional
interval
- httpbody · HttpHealthCheckoptional
http
- intervalbody · uint32optional
interval
- pathbody · stringoptional
path
- healthybody · booloptional
healthy
- isolatebody · booloptional
isolate
- locationbody · Locationoptional
location
- regionbody · stringoptional
region
- zonebody · stringoptional
zone
- campusbody · stringoptional
campus
- metadatabody · map<string,string>optional
metadata
- ctimebody · stringoptional
ctime
- mtimebody · stringoptional
mtime
- revisionbody · stringoptional
revision
curl -sS -X POST 'http://127.0.0.1:8090/naming/v1/instances' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[{"service":"payment","namespace":"default","host":"10.0.0.8","port":8080,"weight":100,"healthy":true}]'{
"code": 200000,
"info": "execute success",
"amount": 1
}/naming/v1/instancesAuth requiredUpdate instances
Update instances; body is an array.
Parameters
- Authorizationheader · stringrequired
Token from login.
- (body)body · Instance[]required
Request body is a JSON array of Instance: [{...}, ...]. Fields below are the full per-item schema (including nested).
- idbody · stringoptional
id
- servicebody · stringoptional
service
- namespacebody · stringoptional
namespace
- hostbody · stringoptional
host
- portbody · uint32optional
port
- protocolbody · stringoptional
protocol
- versionbody · stringoptional
version
- prioritybody · uint32optional
priority
- weightbody · uint32optional
weight
- enable_health_checkbody · booloptional
enable_health_check
- health_checkbody · HealthCheckoptional
health_check
- typebody · enum(HealthCheckType)optional
type enum: UNKNOWN | HEARTBEAT | TCP | HTTP
- heartbeatbody · HeartbeatHealthCheckoptional
heartbeat
- ttlbody · uint32optional
ttl
- tcpbody · TcpHealthCheckoptional
tcp
- intervalbody · uint32optional
interval
- httpbody · HttpHealthCheckoptional
http
- intervalbody · uint32optional
interval
- pathbody · stringoptional
path
- healthybody · booloptional
healthy
- isolatebody · booloptional
isolate
- locationbody · Locationoptional
location
- regionbody · stringoptional
region
- zonebody · stringoptional
zone
- campusbody · stringoptional
campus
- metadatabody · map<string,string>optional
metadata
Response fields
- codebody · uint32required
Business code; success is usually 200000.
- infobody · stringoptional
Info message.
- instancebody · Instanceoptional
Instance entity fields (batch APIs nest under responses[]).
- idbody · stringoptional
id
- servicebody · stringoptional
service
- namespacebody · stringoptional
namespace
- hostbody · stringoptional
host
- portbody · uint32optional
port
- protocolbody · stringoptional
protocol
- versionbody · stringoptional
version
- prioritybody · uint32optional
priority
- weightbody · uint32optional
weight
- enable_health_checkbody · booloptional
enable_health_check
- health_checkbody · HealthCheckoptional
health_check
- typebody · enum(HealthCheckType)optional
type enum: UNKNOWN | HEARTBEAT | TCP | HTTP
- heartbeatbody · HeartbeatHealthCheckoptional
heartbeat
- ttlbody · uint32optional
ttl
- tcpbody · TcpHealthCheckoptional
tcp
- intervalbody · uint32optional
interval
- httpbody · HttpHealthCheckoptional
http
- intervalbody · uint32optional
interval
- pathbody · stringoptional
path
- healthybody · booloptional
healthy
- isolatebody · booloptional
isolate
- locationbody · Locationoptional
location
- regionbody · stringoptional
region
- zonebody · stringoptional
zone
- campusbody · stringoptional
campus
- metadatabody · map<string,string>optional
metadata
- ctimebody · stringoptional
ctime
- mtimebody · stringoptional
mtime
- revisionbody · stringoptional
revision
curl -sS -X PUT 'http://127.0.0.1:8090/naming/v1/instances' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[{"id":"<id>","service":"payment","namespace":"default","host":"10.0.0.8","port":8080,"weight":80}]'{
"code": 200000,
"info": "execute success",
"amount": 1
}/naming/v1/instances/deleteAuth requiredDelete instances
Delete instances; body arrays with id or service/namespace/host/port.
Parameters
- Authorizationheader · stringrequired
Token from login.
- (body)body · Instance[]required
Request body is a JSON array of Instance: [{...}, ...]. Fields below are the full per-item schema (including nested).
- idbody · stringoptional
id
- servicebody · stringoptional
service
- namespacebody · stringoptional
namespace
- hostbody · stringoptional
host
- portbody · uint32optional
port
- protocolbody · stringoptional
protocol
- versionbody · stringoptional
version
- prioritybody · uint32optional
priority
- weightbody · uint32optional
weight
- enable_health_checkbody · booloptional
enable_health_check
- health_checkbody · HealthCheckoptional
health_check
- typebody · enum(HealthCheckType)optional
type enum: UNKNOWN | HEARTBEAT | TCP | HTTP
- heartbeatbody · HeartbeatHealthCheckoptional
heartbeat
- ttlbody · uint32optional
ttl
- tcpbody · TcpHealthCheckoptional
tcp
- intervalbody · uint32optional
interval
- httpbody · HttpHealthCheckoptional
http
- intervalbody · uint32optional
interval
- pathbody · stringoptional
path
- healthybody · booloptional
healthy
- isolatebody · booloptional
isolate
- locationbody · Locationoptional
location
- regionbody · stringoptional
region
- zonebody · stringoptional
zone
- campusbody · stringoptional
campus
- metadatabody · map<string,string>optional
metadata
Response fields
- codebody · uint32required
Business code; success is usually 200000.
- infobody · stringoptional
Info message.
- instancebody · Instanceoptional
Instance entity fields (batch APIs nest under responses[]).
- idbody · stringoptional
id
- servicebody · stringoptional
service
- namespacebody · stringoptional
namespace
- hostbody · stringoptional
host
- portbody · uint32optional
port
- protocolbody · stringoptional
protocol
- versionbody · stringoptional
version
- prioritybody · uint32optional
priority
- weightbody · uint32optional
weight
- enable_health_checkbody · booloptional
enable_health_check
- health_checkbody · HealthCheckoptional
health_check
- typebody · enum(HealthCheckType)optional
type enum: UNKNOWN | HEARTBEAT | TCP | HTTP
- heartbeatbody · HeartbeatHealthCheckoptional
heartbeat
- ttlbody · uint32optional
ttl
- tcpbody · TcpHealthCheckoptional
tcp
- intervalbody · uint32optional
interval
- httpbody · HttpHealthCheckoptional
http
- intervalbody · uint32optional
interval
- pathbody · stringoptional
path
- healthybody · booloptional
healthy
- isolatebody · booloptional
isolate
- locationbody · Locationoptional
location
- regionbody · stringoptional
region
- zonebody · stringoptional
zone
- campusbody · stringoptional
campus
- metadatabody · map<string,string>optional
metadata
- ctimebody · stringoptional
ctime
- mtimebody · stringoptional
mtime
- revisionbody · stringoptional
revision
curl -sS -X POST 'http://127.0.0.1:8090/naming/v1/instances/delete' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[{"id":"<instance-id>"}]'{
"code": 200000,
"info": "execute success",
"amount": 1
}/naming/v1/instances/labelsAuth requiredList instance labels
Aggregate instance labels for a service.
Parameters
- Authorizationheader · stringrequired
Token from login.
- servicequery · stringrequired
Service name.
- namespacequery · stringrequired
Namespace.
curl -sS 'http://127.0.0.1:8090/naming/v1/instances/labels?namespace=default&service=payment' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success",
"amount": 1
}/naming/v1/instances/countAuth requiredInstances count
Instances count.
Parameters
- Authorizationheader · stringrequired
Token from login.
curl -sS -X GET 'http://127.0.0.1:8090/naming/v1/instances/count' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success"
}