Updated on 2025-12-29 GMT+08:00

Restarting DCS Instances or Clearing DCS Instance Data

Function

This API is used to restart a running DCS instance.

Data clearance operations cannot be undone on DCS Redis 4.0 and later instances.

URI

PUT /v2/{project_id}/instances/status

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition:

Project ID. For details, see Obtaining a Project ID.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

instances

No

Array of strings

Definition

List of instance IDs. It can be viewed on the instance details page on the DCS console. The return value of response parameter instance_id can be obtained by calling the API for Listing All Instances.

action

No

String

Definition:

Operation on the instance.

Constraints:

Only DCS Redis 4.0 and later instances can be flushed.

Range:

  • restart: force restart

  • soft_restart: restart only the instance process

  • flush: clear data

Default Value:

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

results

Array of BatchOpsResult objects

Definition:

Result of deleting, restarting, or clearing data of an instance.

Table 4 BatchOpsResult

Parameter

Type

Description

result

String

Definition

Operation result.

Range

success: The instance is deleted, restarted, or cleared.

failed: The instance fails to be deleted, restarted, or cleared.

instance

String

Definition:

DCS instance ID.

Range:

N/A

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error message.

Value range:

N/A.

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A.

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error message.

Value range:

N/A.

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A.

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

Definition:

DCS instance restarted successfully or the instance data cleared successfully.

{
  "results" : [ {
    "instance" : "e3a7019c-8824-4c1a-8289-5300f19b9f64",
    "result" : "success"
  } ]
}

Status Codes

Status Code

Description

200

Definition:

DCS instance restarted successfully or the instance data cleared successfully.

400

Invalid request.

500

Internal service error.

Error Codes

See Error Codes.