Lattice Hub Docs
HTTP OpenAPI

Admin APIs

Ops APIs for connections, leaders, logs, instance cleanup, and more.

Ops APIs for connections, leaders, logs, instance cleanup, and more.

Default Base URL: http://127.0.0.1:8090. Management APIs require Authorization (token from login).

Admin APIs

Ops APIs: connections, leaders, logs, cleanup, etc.

GET/admin/v1/apiserver/connAuth required

List APIServer connections

List APIServer connections.

  • Authorizationheader · stringrequired

    Token from login.

  • protocolquery · stringoptional

    protocol

  • hostquery · stringoptional

    host

Request
curl -sS -X GET 'http://127.0.0.1:8090/admin/v1/apiserver/conn' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success"
}
GET/admin/v1/apiserver/conn/statsAuth required

Connection stats

Connection stats.

  • Authorizationheader · stringrequired

    Token from login.

  • protocolquery · stringoptional

    protocol

  • hostquery · stringoptional

    host

  • amountquery · integeroptional

    amount

Request
curl -sS -X GET 'http://127.0.0.1:8090/admin/v1/apiserver/conn/stats' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success"
}
POST/admin/v1/apiserver/conn/closeAuth required

Close connections

Close connections.

  • Authorizationheader · stringrequired

    Token from login.

  • (body)body · ConnReq[]required

    JSON array of ConnReq; fields below are per-item.

  • protocolbody · stringoptional

    协议。

  • hostbody · stringoptional

    主机。

  • portbody · uint32optional

    端口。

  • codebody · uint32required

    Business code.

  • infobody · stringoptional

    Info.

  • ConnReqbody · ConnReqoptional

    Entity fields.

    • protocolbody · stringoptional

      协议。

    • hostbody · stringoptional

      主机。

    • portbody · uint32optional

      端口。

Request
curl -sS -X POST 'http://127.0.0.1:8090/admin/v1/apiserver/conn/close' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
Response example
{
  "code": 200000,
  "info": "execute success"
}
POST/admin/v1/memory/freeAuth required

Free OS memory

Free OS memory.

  • Authorizationheader · stringrequired

    Token from login.

Request
curl -sS -X POST 'http://127.0.0.1:8090/admin/v1/memory/free' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success"
}
POST/admin/v1/instance/cleanAuth required

Clean instance

Clean instance.

  • Authorizationheader · stringrequired

    Token from login.

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

  • infobody · stringoptional

    Info.

  • Instancebody · Instanceoptional

    Entity fields.

    • 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/admin/v1/instance/clean' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
Response example
{
  "code": 200000,
  "info": "execute success"
}
POST/admin/v1/instance/batchcleanAuth required

Batch clean instances

Batch clean instances.

  • Authorizationheader · stringrequired

    Token from login.

  • batch_sizebody · uint32required

    Batch size

Request
curl -sS -X POST 'http://127.0.0.1:8090/admin/v1/instance/batchclean' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
Response example
{
  "code": 200000,
  "info": "execute success"
}
GET/admin/v1/instance/heartbeatAuth required

Last heartbeat

Last heartbeat.

  • Authorizationheader · stringrequired

    Token from login.

  • idquery · stringoptional

    id

  • servicequery · stringoptional

    service

  • namespacequery · stringoptional

    namespace

  • hostquery · stringoptional

    host

  • portquery · integeroptional

    port

  • vpv_idquery · stringoptional

    vpv_id

Request
curl -sS -X GET 'http://127.0.0.1:8090/admin/v1/instance/heartbeat' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success"
}
GET/admin/v1/log/outputlevelAuth required

Get log level

Get log level.

  • Authorizationheader · stringrequired

    Token from login.

Request
curl -sS -X GET 'http://127.0.0.1:8090/admin/v1/log/outputlevel' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success"
}
PUT/admin/v1/log/outputlevelAuth required

Set log level

Set log level.

  • Authorizationheader · stringrequired

    Token from login.

  • scopebody · stringrequired

    Log scope

  • levelbody · stringrequired

    Level

Request
curl -sS -X PUT 'http://127.0.0.1:8090/admin/v1/log/outputlevel' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
Response example
{
  "code": 200000,
  "info": "execute success"
}
GET/admin/v1/leadersAuth required

List leader elections

List leader elections.

  • Authorizationheader · stringrequired

    Token from login.

Request
curl -sS -X GET 'http://127.0.0.1:8090/admin/v1/leaders' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success"
}
POST/admin/v1/leaders/releaseAuth required

Release leader election

Release leader election.

  • Authorizationheader · stringrequired

    Token from login.

  • electKeybody · stringrequired

    Election key

Request
curl -sS -X POST 'http://127.0.0.1:8090/admin/v1/leaders/release' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
Response example
{
  "code": 200000,
  "info": "execute success"
}
GET/admin/v1/cmdb/infoAuth required

CMDB info

CMDB info.

  • Authorizationheader · stringrequired

    Token from login.

Request
curl -sS -X GET 'http://127.0.0.1:8090/admin/v1/cmdb/info' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success"
}
GET/admin/v1/report/clientsAuth required

Reported clients

Reported clients.

  • Authorizationheader · stringrequired

    Token from login.

Request
curl -sS -X GET 'http://127.0.0.1:8090/admin/v1/report/clients' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success"
}
POST/admin/v1/pprof/enableAuth required

Enable/disable pprof

Enable/disable pprof.

  • Authorizationheader · stringrequired

    Token from login.

  • enablebody · boolrequired

    Enable

Request
curl -sS -X POST 'http://127.0.0.1:8090/admin/v1/pprof/enable' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
Response example
{
  "code": 200000,
  "info": "execute success"
}
GET/admin/v1/server/functionsAuth required

Server functions

Server functions.

  • Authorizationheader · stringrequired

    Token from login.

Request
curl -sS -X GET 'http://127.0.0.1:8090/admin/v1/server/functions' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success"
}
GET/admin/v1/system/configurationAuth required

System configuration

System configuration.

  • Authorizationheader · stringrequired

    Token from login.

Request
curl -sS -X GET 'http://127.0.0.1:8090/admin/v1/system/configuration' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success"
}
GET/admin/v1/mainuser/existAuth required

Has main user

Has main user.

  • Authorizationheader · stringrequired

    Token from login.

Request
curl -sS -X GET 'http://127.0.0.1:8090/admin/v1/mainuser/exist' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success"
}
POST/admin/v1/mainuser/createAuth required

Init main user

Init main user.

  • Authorizationheader · stringrequired

    Token from login.

  • idbody · stringoptional

    id

  • namebody · stringoptional

    name

  • passwordbody · stringoptional

    password

  • ownerbody · stringoptional

    owner

  • sourcebody · stringoptional

    source

  • auth_tokenbody · stringoptional

    auth_token

  • token_enablebody · booloptional

    token_enable

  • commentbody · stringoptional

    comment

  • user_typebody · stringoptional

    user_type

  • mobilebody · stringoptional

    mobile

  • emailbody · stringoptional

    email

  • metadatabody · map<string,string>optional

    metadata

  • codebody · uint32required

    Business code.

  • infobody · stringoptional

    Info.

  • Userbody · Useroptional

    Entity fields.

    • idbody · stringoptional

      id

    • namebody · stringoptional

      name

    • passwordbody · stringoptional

      password

    • ownerbody · stringoptional

      owner

    • sourcebody · stringoptional

      source

    • auth_tokenbody · stringoptional

      auth_token

    • token_enablebody · booloptional

      token_enable

    • commentbody · stringoptional

      comment

    • ctimebody · stringoptional

      ctime

    • mtimebody · stringoptional

      mtime

    • user_typebody · stringoptional

      user_type

    • mobilebody · stringoptional

      mobile

    • emailbody · stringoptional

      email

    • metadatabody · map<string,string>optional

      metadata

Request
curl -sS -X POST 'http://127.0.0.1:8090/admin/v1/mainuser/create' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
Response example
{
  "code": 200000,
  "info": "execute success"
}

On this page