tencent cloud

Tencent Cloud Distributed Cache (Redis OSS-Compatible)

ChangeReplicaToMaster

Download
Modo Foco
Tamanho da Fonte
Última atualização: 2026-08-14 16:53:20

1. API Description

Domain name for API request: redis.intl.tencentcloudapi.com.

This API is used to promote a replica node group to a master node group or a replica node to a master node for an instance.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ChangeReplicaToMaster.
Version Yes String Common Params. The value used for this API: 2018-04-12.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
InstanceId Yes String

Specifies the instance ID. Example: crs-xjhsdj****. Log in to the Redis console and copy the instance ID from the instance list.

GroupId No Integer

Replica node group ID. Use the interface DescribeInstanceZoneInfo to obtain the id information of the multi-AZ replica node group. For a single AZ, no need to configure this parameter.

Emergency No Boolean

Emergency mode.

Enumeration values:

  • false: Standard mode (Recommended for security)
  • true: Speed mode: (High-risk acceleration) Skip verification, speed up primary node promotion. High-level operation, highly likely to cause a single primary node in abnormal situations.

Default value: false

3. Output Parameters

Parameter Name Type Description
TaskId Integer

Asynchronous task ID.

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Example

Input Example

POST / HTTP/1.1
Host: redis.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ChangeReplicaToMaster
<Common request parameters>

{
    "InstanceId": "crs-j7oyys27",
    "GroupId": 378132,
    "Emergency": false
}

Output Example

{
    "Response": {
        "TaskId": 2031393158,
        "RequestId": "93c2ebae-0295-4fdf-ba44-fc88badae439"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AuthFailure CAM signature/authentication error.
AuthFailure.InvalidAuthorization Invalid authorization.
FailedOperation.SystemError Internal system error, which is irrelevant to the business.
FailedOperation.UnSupportError The instance does not support this API.
InvalidParameter.IllegalParameterError Invalid parameter.
InvalidParameter.InvalidParameter Invalid service parameter.
InvalidParameter.PermissionDenied The API has no CAM permissions.
InvalidParameterValue Incorrect parameter value.
ResourceNotFound.InstanceNotExists No Redis instance is found by the serialId.
ResourceUnavailable.InstanceStatusError Operation unsupported: the instance is exceptional.

Ajuda e Suporte

Esta página foi útil?

comentários