tencent cloud

TencentDB for PostgreSQL

DescribeDBInstanceHAConfig

Download
Modo Foco
Tamanho da Fonte
Última atualização: 2026-05-21 10:43:54

1. API Description

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

This API (DescribeDBInstanceHConfig) is used to query instance HA configuration information. The HA configuration information includes:

  • This API is used to configure conditions for allowing a secondary node to switch over to a primary node.
  • .
  • This API is used to configure conditions for using synchronous or asynchronous replication in semi-sync instances.
  • .

    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: DescribeDBInstanceHAConfig.
    Version Yes String Common Params. The value used for this API: 2017-03-12.
    Region Yes String Common Params. For more information, please see the list of regions supported by the product.
    DBInstanceId Yes String Instance ID. can be obtained through the DescribeDBInstances api (https://www.tencentcloud.com/document/api/409/16773?from_cn_redirect=1).

    3. Output Parameters

    Parameter Name Type Description
    SyncMode String Primary-Standby sync mode.
  • Semi-Sync: semi-sync
  • .
  • Async: asynchronous
  • .
    MaxStandbyLatency Integer Specifies the maximum delayed data volume of the high-availability standby server. the backup node can switchover to the primary node when its latency data volume is less than or equal to this value and its delay time is less than or equal to MaxStandbyLag.
  • Unit: byte
  • .
  • Value range: [1073741824, 322122547200]
  • .
    MaxStandbyLag Integer Maximum delay time of the high-availability standby server. the secondary node can be switched to the primary node when the backup node latency is less than or equal to this value and the delayed data volume is less than or equal to MaxStandbyLatency.
  • Specifies the unit in seconds.
  • .
  • Parameter range: [5, 10].
  • .
    MaxSyncStandbyLatency Integer Maximum data sync lag for standby server. If data lag of the standby node and the delay time are both less than or equals to the values of MaxSyncStandbyLatency and MaxSyncStandbyLag respectively, the standby server adopts semi-sync replication; if not, it adopts async replication.
    This value is only valid for the instance with SyncMode set to Semi-sync.
    This field returns null for async instance
    and semi-sync (non-downgradable to async) instance.
    Note: This field may return null, indicating that no valid values can be obtained.
    MaxSyncStandbyLag Integer Maximum sync delay time for standby server. If the delay time for standby server and the data lag are both less than or equals to the values of MaxSyncStandbyLag and MaxSyncStandbyLatency respectively, the standby server adopts sync replication mode; if not, it adopts async replication.
    This value is only valid for the instance with SyncMode set to Semi-sync.
    This field will not return for async instance
    and semi-sync (non-downgradable to async) instance.
    Note: This field may return null, indicating that no valid values can be obtained.
    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 Querying the HA Configuration of an Async Instance

    This example shows you how to query the HA configuration of an instance based on its ID, which uses async replication.

    Input Example

    POST / HTTP/1.1
    Host: postgres.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeDBInstanceHAConfig
    <Common request parameters>
    
    {
        "DBInstanceId": "postgres-32d4mmv9"
    }
    

    Output Example

    {
        "Response": {
            "MaxStandbyLag": 10,
            "MaxStandbyLatency": 10737418240,
            "MaxSyncStandbyLag": null,
            "MaxSyncStandbyLatency": null,
            "RequestId": "730627a4-547d-422b-8aac-239041b12212",
            "SyncMode": "Async"
        }
    }
    

    Example2 Allowing Semi-Sync Instance to Degenerate Into Asynchronous, Querying HA Configuration

    This example shows you how to query HA configuration by instance ID, where the instance uses semi-synchronous replication and allows degradation to asynchronous replication.

    Input Example

    POST / HTTP/1.1
    Host: postgres.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeDBInstanceHAConfig
    <Common request parameters>
    
    {
        "DBInstanceId": "postgres-32d4mmv9"
    }
    

    Output Example

    {
        "Response": {
            "MaxStandbyLag": 10,
            "MaxStandbyLatency": 10737418240,
            "MaxSyncStandbyLag": 5,
            "MaxSyncStandbyLatency": 1073741824,
            "RequestId": "897783db-0451-479b-a205-b2b0e48d29a8",
            "SyncMode": "Semi-sync"
        }
    }
    

    Example3 Forbid Degenerating Into Asynchronous Semi-Sync Instance, Query HA Configuration

    This example shows you how to query HA configuration by instance ID. The instance uses semi-sync replication and cannot degrade to asynchronous replication.

    Input Example

    POST / HTTP/1.1
    Host: postgres.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeDBInstanceHAConfig
    <Common request parameters>
    
    {
        "DBInstanceId": "postgres-32d4mmv9"
    }
    

    Output Example

    {
        "Response": {
            "MaxStandbyLag": 10,
            "MaxStandbyLatency": 10737418240,
            "MaxSyncStandbyLag": null,
            "MaxSyncStandbyLatency": null,
            "RequestId": "a5399d5a-c77b-4c57-9a17-790e9c61ab33",
            "SyncMode": "Semi-sync"
        }
    }
    

    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
    FailedOperation.DatabaseAccessError Failed to access database management service. Please try again later. If the problem persists, please contact customer service.
    FailedOperation.DatabaseAffectedError Data operation failed. Please contact customer service.
    FailedOperation.FailedOperationError Operation failed. Please try again later.
    InvalidParameter.ParameterCheckError Failed to check the parameter.
    InvalidParameterValue.InvalidParameterValueError Incorrect parameter value
    OperationDenied.CamDeniedError This operation cannot be performed.
    OperationDenied.InstanceStatusLimitError This operation cannot be performed on an instance in this status.
    ResourceNotFound.InstanceNotFoundError The instance does not exist.

    Ajuda e Suporte

    Esta página foi útil?

    comentários