Rebuild the cluster from an older Raft format
POST
/cluster/rebuild
const url = 'https://sylve.lan:8181/api/cluster/rebuild';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"candidate":true,"joinKey":true,"lastIndex":1,"lastTerm":1,"nodeId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://sylve.lan:8181/api/cluster/rebuild \ --header 'Content-Type: application/json' \ --data '{ "candidate": true, "joinKey": true, "lastIndex": 1, "lastTerm": 1, "nodeId": "example" }'Answers another member upgrading from an older Raft format: how up to date this node is, its vote, and, from the founder, a join key. The message and the answer carry a MAC, with the old cluster key, of the TLS session.
Request Body
Section titled “Request Body”The member’s message
Media typeapplication/json
object
candidate
boolean
joinKey
boolean
lastIndex
integer
lastTerm
integer
nodeId
string
Examplegenerated
{ "candidate": true, "joinKey": true, "lastIndex": 1, "lastTerm": 1, "nodeId": "example"}Responses
Section titled “Responses”Answer
Media typeapplication/json
object
data
object
founded
boolean
joinKey
string
lastIndex
integer
lastTerm
integer
nodeId
string
vote
string
error
string
message
string
status
string
Examplegenerated
{ "data": { "founded": true, "joinKey": "example", "lastIndex": 1, "lastTerm": 1, "nodeId": "example", "vote": "example" }, "error": "example", "message": "example", "status": "example"}Bad Request
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}No valid MAC
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}Not a member of the old cluster
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}No rebuild running
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}