Updated on 2024-11-26 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 5.0 instances.

URI

PUT /v1.0/{project_id}/instances/status

Table 1 describes the parameter.
Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Project ID. For details on how to obtain the value of this parameter, see Obtaining a Project ID.

Request

Request parameters

Table 2 describes the request parameters.
Table 2 Parameter description

Parameter

Type

Mandatory

Description

action

String

Yes

Action performed on DCS instances. Options: restart, and flush.

NOTE:

Only DCS Redis 4.0 and 5.0 instances can be flushed.

instances

Array

Yes

List of DCS instance IDs.

Example request

  • Request URL:
    PUT https://{dcs_endpoint}/v1.0/{project_id}/instances/status
  • Example:
    {
        "action": "restart",
        "instances": [
            "2e803f66-fbb0-47ad-b6cb-fb87f5bed4ef"
        ]
    }

Response

Response parameters

Table 3 describes the response parameter.
Table 3 Parameter description

Parameter

Type

Description

results

Array

Indicates the result of instance modification.

Table 4 results parameter description

Parameter

Type

Description

instance

String

DCS instance ID.

result

String

Instance modification result. Options: success or failed

Example response
{
    "results": [
        {
            "result": "success",
            "instance": "2e803f66-fbb0-47ad-b6cb-fb87f5bed4ef"
        }
    ]
}

Status Code

Table 5 describes the status code of successful operations. For details about other status codes, see Table 1.

Table 5 Status code

Status Code

Description

200

Successfully restarted DCS instance or cleared DCS instance data.