Help Center/ GeminiDB/ API Reference/ APIs v3 (Recommended)/ Disaster Recovery/ Querying the Percentage of Faulty Nodes to Be Taken Over
Updated on 2024-12-02 GMT+08:00

Querying the Percentage of Faulty Nodes to Be Taken Over

Function

This API is used to query the percentage of faulty nodes to be taken over in case of a failover.

Constraints

This API can be used only on GeminiDB Cassandra instances.

URI

GET /v3/{project_id}/instances/disaster-recovery/settings

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

instance_id

No

String

Instance ID

offset

No

Integer

Index position. If offset is set to N, the resource query starts from the N+1 piece of data.

The value must be greater than or equal to 0. If this parameter is not transferred, the value is 0 by default.

limit

No

Integer

Maximum number of instances that can be queried.

The value ranges from 1 to 50. If this parameter is not transferred, 50 instances are queried by default.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

disaster_recovery_settings

Array of SwitchoverRatio objects

Faulty nodes to be taken over

total_count

Integer

Total number of records

Table 5 SwitchoverRatio

Parameter

Type

Description

instance_id

String

Instance ID

switchover_ratio

Integer

Percentage of faulty nodes to be taken over. The value ranges from 50 to 100. 10 nodes can be added each time. The default value is 100.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Error message

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

Example Request

  • Querying the percentage of faulty nodes to be taken over on 50 instances in case of a failover
    GET https://{endpoint}/v3/0549b4a43100d4f32f51c01c2fe4acdb/instances/disaster-recovery/settings
  • Querying the percentage of faulty nodes to be taken over in case of a failover
    GET https://{endpoint}/v3/0549b4a43100d4f32f51c01c2fe4acdb/instances/disaster-recovery/settings?offset=0&limit=50&instance_id=d74162b942604190b991d1c39772a66ain06&instance_id=e74162b942604190b991d1c39772a66ain06

Example Response

Status code: 200

Success.

{ 
  "total_count" : 2, 
  "disaster_recovery_settings" : [ { 
    "instance_id" : "d74162b942604190b991d1c39772a66ain06", 
    "switchover_ratio" : 50 
  }, { 
    "instance_id" : "e74162b942604190b991d1c39772a66ain06", 
    "switchover_ratio" : 100 
  } ] 
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.