Updated on 2025-11-17 GMT+08:00

Modifying Instance Specifications

Function

This API is used to modify specifications of a DCS instance in the Running state.

URI

POST /v2/{project_id}/instances/{instance_id}/resize

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

instance_id

Yes

String

Definition:

Instance ID. It can be viewed on the instance details page on the DCS console.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

spec_code

Yes

String

Definition:

Flavor after the modification. The query method is as follows:

Constraints:

N/A

Range:

N/A

Default Value:

N/A

new_capacity

Yes

Integer

Definition

New memory size of the DCS instance, in GB.

Constraints

For a single-node or master/standby DCS Redis 4.0 or later instance, the value can be 0.125, 0.25, 0.5, 1, 2, 4, 8, 16, 32, or 64. For a cluster DCS Redis 4.0 or later instance, the value can be 4, 8, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, or 1024.

For a single-node or master/standby DCS Memcached instance, the value can be 2, 4, 8, 16, 32, or 64.

Currently, the specifications of a Proxy Cluster DCS Redis 3.0 instance cannot be reduced. In addition to integers, 0.125, 0.25, and 0.5 are also supported.

Range

N/A

Default Value

N/A

bss_param

No

BssParamEntity object

Definition

This parameter does not need to be set for pay-per-use instances.

reserved_ip

No

Array of strings

Definition:

IP addresses to retain. Mandatory during cluster scale-in. If this parameter is not set, the system randomly deletes unnecessary shards.

change_type

No

String

Definition

Modification type. Mandatory when the number of replicas of a DCS Redis instance is modified.

Constraints

N/A

Range

  • createReplication: adding replicas

  • deleteReplication: deleting replicas

  • addSharding: adding shards

  • instanceType: changing the instance type.

Default Value

N/A

available_zones

No

Array of strings

Definition:

Code of the AZ where each replica is in. This parameter is mandatory when you add replicas to a DCS Redis instance. Before specifying an AZ, ensure that there are available resources in it. This parameter is mandatory when you delete replicas from a cluster instance.

For details, see Querying AZs.

node_list

No

Array of strings

Definition:

ID of the replica to delete. This parameter is mandatory when you delete replicas of a master/standby or read/write splitting DCS Redis instance. Currently, only one replica can be deleted at a time.

For details, see Querying Details of Shards and Replicas.

execute_immediately

No

Boolean

Definition:

Whether to apply the change immediately.

Constraints:

N/A

Range:

  • true: Yes

  • false: No. Apply the change in the maintenance time window.

Default Value:

true.

enable_ipv6

No

Boolean

Parameter description:

Whether IPv6 is enabled.

Constraints:

N/A

Value range:

true: Yes

false: No

Default value:

false

spec_param

No

SpecParam object

Definition:

Linear specification definition parameter.

Constraints:

N/A

Table 3 BssParamEntity

Parameter

Mandatory

Type

Description

is_auto_pay

No

String

Definition

This parameter is reserved.

Constraints

N/A

Range

-true: Fees are automatically deducted from the account balance.

  • false: The order must be paid manually. This is the default value.

Default Value

false

Table 4 SpecParam

Parameter

Mandatory

Type

Description

sharding_count

No

Integer

Parameter description:

Number of instance shards.

Constraints:

N/A

Value range:

1–128

Default value:

N/A

replica_count

No

Integer

Definition:

Number of instance replicas.

Constraints:

N/A

Range:

1–10

Default Value:

N/A

cache_mode

No

String

Definition

DCS instance type.

Constraints

N/A

Range

  • single: single-node

  • ha: master/standby

  • cluster: Redis Cluster

  • proxy: Proxy Cluster

Default Value

N/A

Response Parameters

Status code: 204

DCS instance specifications modified successfully.

None

Example Requests

  • Changing to a master/standby instance with 3 replicas and 1 GB

    POST https://{dcs_endpoint}/v2/{project_id}/instances/{instance_id}/resize
    
    {
      "spec_code" : "redis.ha.xu1.large.r3.1",
      "new_capacity" : 1,
      "change_type" : "createReplication",
      "available_zones" : [ "e7afd64502d64fe3bfb60c2c82ec0ec6", "d90ff6d692954373bf53be49cf3900cb" ],
      "execute_immediately" : true
    }
  • Changing to a Redis Cluster instance with 2 replicas and 8 GB

    {
      "spec_code" : "redis.cluster.xu1.large.r2.8",
      "new_capacity" : 8,
      "reserved_ip" : [ "192.168.0.125" ],
      "change_type" : "deleteReplication",
      "execute_immediately" : true
    }

Example Responses

None

Status Codes

Status Code

Description

204

DCS instance specifications modified successfully.

Error Codes

See Error Codes.