qluster rest api API Description
Version: 0.1.0
Endpoints
/is-leader
Method: GET
Description: returns 200 if this node is the cluster leader
Responses:
200— this node is the cluster leader412—417—500—530—531—
/map
Method: GET
Description: returns the cluster map and settings
Responses:
200— ok412—500—531—
/info
Method: GET
Description: returns the cluster information needed to start a previously added node
Responses:
200— ok412—500—531—
/config
Method: GET
Description: get cluster configuration
Responses:
200— ok412—500—531— Method:POSTDescription: update cluster configuration- Content type:
application/json- Schema:
objectResponses:
- Schema:
200— ok410—412—417—420—500—530—531—
/db-config
Method: GET
Description: get database configuration
Responses:
200— ok412—500—531—
/leader
Method: GET
Description: get leader addresses
Responses:
200— ok412—500—530—531— Method:POSTDescription: change leader Parameters:node(query, mandatory) — new leader ID Responses:200— ok412—500—530—531—
/node
Method: POST
Description: add a new node to the cluster (all new nodes initially become listeners)
Parameters:
ip(query, mandatory) — IP address of the listener noderole(query, mandatory) — node role Responses:200— ok410—412—417—420—500—530—531—
/node/{node}
Method: PATCH
Description: Upgrade the listener to a proper node
Parameters:
node(path, mandatory) — node IDdb-port(query, mandatory) — database portapi-port(query, mandatory) — rest api port Responses:200— ok410—412—417—420—500—530—531— Method:DELETEDescription: remove a node from a cluster Parameters:node(path, mandatory) — node ID Responses:200— ok410—412—417—420—500—530—531—
/node-down/{node}
Method: POST
Description: qhb has problems, now it can't participate in votings and be a replica of qcp
Parameters:
node(path, mandatory) — node ID Responses:200— ok410—412—417—420—500—530—531—
/sql/readonly
Method: GET
Description: get hashes of queries that don't write anything to the database
Responses:
200— ok412—500—531—
/rpc
Method: GET
Description: human-readable cluster and rpc events
Responses:
200— ok500—
/events
Method: GET
Description: cluster events
Responses:
200— ok500—
Components
Schemas
NodeId
node ID
- Type:
integer
Term
logical cluster time
- Type:
integer
LogIndex
lsn of the cluster logs
- Type:
integer
Port
- Type:
integer
Duration
time interval in human-readable format
- Type:
string
Config
cluster settings
- Type:
objectFields: node-timeout(object): If within this time the node does not find a leader, it initiates a pre-electionpre-voting-timeout(object): During this time, the pre-voting must be completedleader-voting-timeout(object): If within this time the voting does not produce a leader, then the transition to the pre-voting stage occursheartbeat-interval(object): Frequency with which the leader should send a heartbeatreplication-factor(integer): the number of nodes to which a log is replicated before it can be committed (0 - weak replication, enough for the log to end up on the leader)quorum-replication(boolean): if enabled, the value n/2 + 1 is inserted into replication_factorreplication-retry-interval(object): the time interval after which the log should be replicated again if no response has been receivedautoremove-enabled(boolean): if enabled, the leader will remove nodes from the cluster that are not visible to half of the clusterautoremove-minimum(integer): for autoremove to work, the number of cluster nodes must be greater than this value.
NodeRole
- Type:
string
Node
cluster node information
- Type:
objectFields: id(object): node IDip(string): IPv4/IPv6 host addressdb-port(object): port on which postgres is runningapi-port(object): port on which rest api is runningrole(object): node role in the cluster
ClusterMap
cluster map
- Type:
objectFields: leader(object): cluster leadernodes(object): all cluster nodes
ClusterLog
- Type:
objectFields: index(object): log lsnterm(object): logical cluster timepayload(object):
ClusterInfo
- Type:
objectFields: term(object): logical cluster timeapplied-index(object): cluster lsn applied to a state machineconfig(object): cluster settingslogs(array): cluster logs
ReadonlyStatements
- Type:
array