Reviewed-by: Bobkova, Natalia <natalia.bobkova@t-systems.com> Co-authored-by: chenjunjie <chenjunjie@huawei.com> Co-committed-by: chenjunjie <chenjunjie@huawei.com>
18 KiB
Restarting DCS Instances or Clearing DCS Instance Data
Function
This API is used to restart a running DCS instance.
This API can also be used to clear data of DCS Redis 4.0 and later instances. Cleared data cannot be restored. Exercise caution.
URI
PUT /v2/{project_id}/instances/status
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
instances |
No |
Array of strings |
List of instance IDs. |
action |
No |
String |
Operation on the instance: restart: force restart soft_restart: restart only the instance process flush: clear data NOTE:
Only DCS Redis 4.0 and later instances can be flushed. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
|---|---|---|
results |
Array of BatchOpsResult objects |
Result of deleting, restarting, or clearing data of an instance. |
Parameter |
Type |
Description |
|---|---|---|
result |
String |
Instance deletion result. Options: success and failed. |
instance |
String |
DCS instance ID. |
Status code: 400
Parameter |
Type |
Description |
|---|---|---|
error_msg |
String |
Error message. |
error_code |
String |
Error code. |
error_ext_msg |
String |
Extended error information. This parameter is not used currently and is set to null. |
Status code: 500
Parameter |
Type |
Description |
|---|---|---|
error_msg |
String |
Error message. |
error_code |
String |
Error code. |
error_ext_msg |
String |
Extended error information. This parameter is not used currently and is set to null. |
Example Requests
Force restarting a DCS instance
PUT https://{dcs_endpoint}/v2/{project_id}/instances/status
{
"instances" : [ "2e803f66-fbb0-47ad-b6cb-fb87f5bed4ef" ],
"action" : "restart"
}
Example Responses
Status code: 200
DCS instances restarted successfully or the instance data cleared successfully.
{
"results" : [ {
"instance" : "e3a7019c-8824-4c1a-8289-5300f19b9f64",
"result" : "success"
} ]
}
Status Codes
Status Code |
Description |
|---|---|
200 |
DCS instances restarted successfully or the instance data cleared successfully. |
400 |
Invalid request. |
500 |
Internal service error. |
Error Codes
See Error Codes.