集群作请求
集群作请求
Redis 企业软件 |
---|
方法 | 路径 | 描述 |
---|---|---|
获取 | /v1/cluster/actions |
获取所有作的状态 |
获取 | /v1/cluster/actions/{action} |
获取特定作的状态 |
发布 | /v1/cluster/actions/{action} |
启动集群范围的作 |
删除 | /v1/cluster/actions/{action} |
取消作或删除作状态 |
获取所有集群作
GET /v1/cluster/actions
获取所有当前正在执行、已排队或已完成的集群作的状态。
所需权限
权限名称 |
---|
view_status_of_cluster_action |
请求
HTTP 请求示例
GET /v1/cluster/actions
响应
返回作对象的 JSON 数组。
示例 JSON 正文
{
"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 /v1/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 /v1/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 the node_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.
On this page