Admin API
The Admin API provides a simple way to view cluster information, including metasrv health detection, metasrv leader query, database metadata query, and datanode heartbeat detection.
The Admin API is an HTTP service that provides a set of RESTful APIs that can be called through HTTP requests. The Admin API is simple, user-friendly and safe. Available APIs:
- /health
- /leader
- /heartbeat
- /maintenance
All these APIs are under the parent resource /admin
.
In the following sections, we assume that your metasrv instance is running on localhost port 3002.
/health HTTP endpoint
The /health
endpoint accepts GET HTTP requests and you can use this endpoint to check the health of your metasrv instance.
Definition
curl -X GET http://localhost:3002/admin/health
Examples
Request
curl -X GET http://localhost:3002/admin/health
Response
OK
/leader HTTP endpoint
The /leader
endpoint accepts GET HTTP requests and you can use this endpoint to query the leader's addr of your metasrv instance.
Definition
curl -X GET http://localhost:3002/admin/leader
Examples
Request
curl -X GET http://localhost:3002/admin/leader