Updated on 2024-11-06 GMT+08:00

Obtaining Deletable Replicas

Function

This API is used to obtain replicas that can be deleted.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/instances/{instance_id}/deletable-replication

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Instance ID.

project_id

Yes

String

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

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

check_result

Boolean

Whether a replica group is available for deletion.

available_zone

String

IDs of available AZs.

replication_list

Array of ReplicationInfo objects

List of nodes that can be retained.

Table 3 ReplicationInfo

Parameter

Type

Description

replication_id

String

Replica ID.

node_id

String

Node ID.

replication_ip

String

Replica IP address and port.

group_id

String

Shard ID.

group_name

String

Shard name.

available_zone

String

AZ ID.

Status code: 400

Table 4 Response body parameters

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

Table 5 Response body parameters

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

GET https://{dcs_endpoint}/v2/{project_id}/instances/{instance_id}/deletable-replication

Example Responses

Status code: 200

Deleteable replicas obtained.

{
  "check_result" : true,
  "available_zone" : "9f1c5806706d4c1fb0eb72f0a9b18c77",
  "replication_list" : [ {
    "replication_id" : "435a6322-0c64-4d0e-8bc2-8adefa2eca26",
    "node_id" : "8abf6e1e7fd3e695017fd4046bb9006b",
    "replication_ip" : "192.168.73.139:6379",
    "group_id" : "cbf8deba-d69f-41b8-8556-83337d32ad40",
    "group_name" : "group-2",
    "available_zone" : "9f1c5806706d4c1fb0eb72f0a9b18c77"
  }, {
    "replication_id" : "193683cf-f693-4a6a-950a-20f615ed6c47",
    "node_id" : "8abf6e1e7fd3e695017fd4046bb8006a",
    "replication_ip" : "192.168.67.86:6379",
    "group_id" : "7a153688-d31d-4541-b635-191885c71e93",
    "group_name" : "group-1",
    "available_zone" : "9f1c5806706d4c1fb0eb72f0a9b18c77"
  }, {
    "replication_id" : "ae38792f-60b7-4c8c-b1dc-175f2151f85f",
    "node_id" : "8abf6e1e7fd3e695017fd4046bb40069",
    "replication_ip" : "192.168.66.157:6379",
    "group_id" : "4f26a524-1525-4975-82fa-b2291091f9e7",
    "group_name" : "group-0",
    "available_zone" : "9f1c5806706d4c1fb0eb72f0a9b18c77"
  } ]
}

Status code: 400

Invalid request.

{
  "error_code" : 111400800,
  "error_msg" : "Only native cluster supported."
}

Status code: 500

Internal service error.

{
  "error_code" : 111500024,
  "error_msg" : "Query instance error."
}

Status Codes

Status Code

Description

200

Deleteable replicas obtained.

400

Invalid request.

500

Internal service error.

Error Codes

See Error Codes.