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

Setting the Percentage of Faulty Nodes to Be Taken Over

Function

This API is used to set 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

PUT /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.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

disaster_recovery_settings

No

Array of SwitchoverRatio objects

Faulty nodes to be taken over

Table 4 SwitchoverRatio

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Instance ID

switchover_ratio

No

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%.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

successed_instance_ids

Array of strings

Instances for which the percentage of faulty nodes to be taken over is successfully set

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code

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

Setting the percentage of faulty nodes to be taken over in case of a failover

PUT https://{endpoint}/v3/0549b4a43100d4f32f51c01c2fe4acdb/instances/disaster-recovery/settings 
 
{ 
  "disaster_recovery_settings" : [ { 
    "instance_id" : "d74162b942604190b991d1c39772a66ain06", 
    "switchover_ratio" : 50 
  }, { 
    "instance_id" : "e74162b942604190b991d1c39772a66ain06", 
    "switchover_ratio" : 100 
  } ] 
}

Example Response

Status code: 200

Success.

{ 
  "successed_instance_ids" : [ "d74162b942604190b991d1c39772a66ain06", "e74162b942604190b991d1c39772a66ain06" ] 
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.