Cluster actions requests
Cluster action requests
Method | Path | Description |
---|---|---|
GET | /v1/cluster/actions |
Get the status of all actions |
GET | /v1/cluster/actions/{action} |
Get the status of a specific action |
POST | /v1/cluster/actions/{action} |
Initiate a cluster-wide action |
DELETE | /v1/cluster/actions/{action} |
Cancel action or remove action status |
Get all cluster actions
GET /v1/cluster/actions
Get the status of all currently executing, queued, or completed cluster actions.
Required permissions
Permission name |
---|
view_status_of_cluster_action |
Request
Example HTTP request
GET /cluster/actions
Response
Returns a JSON array of action objects.
Example JSON body
{
"actions": [
{
"name": "action_name",
"status": "queued",
"progress": 0.0
}
]
}
Status codes
Code | Description |
---|---|
200 OK | No error, response provides info about an ongoing action. |
404 Not Found | Action does not exist (i.e. not currently running and no available status of last run). |
Get cluster action
GET /v1/cluster/actions/{action}
Get the status of a currently executing, queued, or completed cluster action.
Required permissions
Permission name |
---|
view_status_of_cluster_action |
Request
Example HTTP request
GET /cluster/actions/action_name
URL parameters
Field | Type | Description |
---|---|---|
action | string | The action to check. |
Response
Returns an action object.
Example JSON body
{
"name": "action_name",
"status": "queued",
"progress": 0.0
}
Status codes
Code | Description |
---|---|
200 OK | No error, response provides info about an ongoing action. |
404 Not Found | Action does not exist (i.e. not currently running and no available status of last run). |
Initiate cluster-wide action
POST /v1/cluster/actions/{action}
Initiate a cluster-wide action.
The API allows only a single instance of any action type to be
invoked at the same time, and violations of this requirement will
result in a 409 CONFLICT
response.
The caller is expected to query and process the results of the previously executed instance of the same action, which will be removed as soon as the new one is submitted.
Required permissions
Permission name |
---|
start_cluster_action |
Request
Example HTTP request
POST /cluster/actions/action_name
URL parameters
Field | Type | Description |
---|---|---|
action | string | The name of the action required. |
Supported cluster actions:
-
change_master
: Promotes a specified node to become the primary node of the cluster, which coordinates cluster-wide operations. Include thenode_uid
of the node you want to promote in the request body.POST /v1/cluster/actions/change_master { "node_uid": "2" }
Response
The body content may provide additional action details. Currently, it is not used.
Status codes
Code | Description |
---|---|
200 OK | No error, action was initiated. |
400 Bad Request | Bad action or content provided. |
409 Conflict | A conflicting action is already in progress. |
Cancel action
DELETE /v1/cluster/actions/{action}
Cancel a queued or executing cluster action, or remove the status of a previously executed and completed action.
Required permissions
Permission name |
---|
cancel_cluster_action |
Request
Example HTTP request
DELETE /v1/cluster/actions/action_name
URL parameters
Field | Type | Description |
---|---|---|
action | string | The name of the action to cancel, currently no actions are supported. |
Response
Returns a status code.
Status codes
Code | Description |
---|---|
200 OK | Action will be cancelled when possible. |
404 Not Found | Action unknown or not currently running. |