Lattice Hub Docs
HTTP OpenAPIServices

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.

GET/naming/v1/instancesAuth required

List instances

Filter by service/host/etc. Enrich mislabels Path; all are query.

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

Request
curl -sS 'http://127.0.0.1:8090/naming/v1/instances?namespace=default&service=payment' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success",
  "instances": [{ "host": "10.0.0.8", "port": 8080, "healthy": true }]
}
POST/naming/v1/instancesAuth required

Create instances

Write bodies are usually protobuf message arrays; fields below are per-object (see specification).

  • 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

  • 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

Request
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}]'
Response example
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
PUT/naming/v1/instancesAuth required

Update instances

Update instances; body is an array.

  • 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

  • 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

Request
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}]'
Response example
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
POST/naming/v1/instances/deleteAuth required

Delete instances

Delete instances; body arrays with id or service/namespace/host/port.

  • 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

  • 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

Request
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>"}]'
Response example
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
GET/naming/v1/instances/labelsAuth required

List instance labels

Aggregate instance labels for a service.

  • Authorizationheader · stringrequired

    Token from login.

  • servicequery · stringrequired

    Service name.

  • namespacequery · stringrequired

    Namespace.

Request
curl -sS 'http://127.0.0.1:8090/naming/v1/instances/labels?namespace=default&service=payment' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
GET/naming/v1/instances/countAuth required

Instances count

Instances count.

  • Authorizationheader · stringrequired

    Token from login.

Request
curl -sS -X GET 'http://127.0.0.1:8090/naming/v1/instances/count' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success"
}

On this page