tencent cloud

APIs

ModifyServerlessStrategy

Baixar
Modo Foco
Tamanho da Fonte
Última atualização: 2026-10-22 10:45:37

1. API Description

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

Modify a serverless policy

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: ModifyServerlessStrategy.
Version Yes String Common Params. The value used for this API: 2019-01-07.
Region Yes String Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-bangkok, ap-beijing, ap-chengdu, ap-chongqing, ap-guangzhou, ap-hongkong, ap-jakarta, ap-nanjing, ap-seoul, ap-shanghai, ap-shenzhen-fsi, ap-singapore, ap-tokyo, eu-frankfurt, na-ashburn, na-siliconvalley, sa-saopaulo.
ClusterId Yes String

serverless cluster id

AutoPause No String

Whether the cluster auto pauses, optional range

  • yes
  • no
  • AutoPauseDelay No Integer

    Delay of Cluster Auto-Pause, in seconds. Optional range: [600,691200]. Default: 600

    AutoScaleUpDelay No Integer

    This parameter is temporarily unavailable.

    AutoScaleDownDelay No Integer

    This parameter is temporarily unavailable.

    MinCpu No Float

    Minimum cpu value. For the optional range, see the API response of DescribeServerlessInstanceSpecs.

    MaxCpu No Float

    Maximum value of cpu. For the optional range, see the API response of DescribeServerlessInstanceSpecs

    MinRoCpu No Float

    Minimum cpu value of the read-only instance. For the optional range, see the API response of DescribeServerlessInstanceSpecs

    MaxRoCpu No Float

    Read-only maximum value of cpu. For the optional range, see the API response of DescribeServerlessInstanceSpecs.

    MinRoCount No Integer

    Minimum number of read-only nodes

    MaxRoCount No Integer

    Maximum number of read-only nodes

    AutoArchive No String

    Whether archive is enabled, optional range

  • yes
  • no
  • Default value: yes

    UpgradeType No String

    Upgrade type. Default value: upgradeImmediate. Available values: upgradeImmediate: complete the modification immediately; upgradeInMaintain: complete the modification during the maintenance window

    SecurityGroupIdsForNewRo.N No Array of String

    List of security groups that the newly-added read-only instances need to bind to. This only binds security groups to read-only instances newly generated during this adjustment of policies, and existing instances are not bound.

    3. Output Parameters

    Parameter Name Type Description
    TaskId Integer

    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 Modifying a serverless Policy

    Modify a serverless policy

    Input Example

    POST / HTTP/1.1
    Host: cynosdb.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifyServerlessStrategy
    <Common request parameters>
    
    {
        "AutoPause": "no",
        "AutoScaleUpDelay": 200,
        "AutoPauseDelay": 100,
        "MinCpu": 0.25,
        "MaxCpu": 2,
        "ClusterId": "cynosdbmysql-8vcxoq75",
        "AutoScaleDownDelay": 300
    }

    Output Example

    {
        "Response": {
            "TaskId": 171221,
            "RequestId": "c3da7958-23e8-11eb-8e52-525400b7dd5a"
        }
    }

    Example2 Modifying a serverless Policy

    Adjust the primary node

    Input Example

    POST / HTTP/1.1
    Host: cynosdb.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifyServerlessStrategy
    <Common request parameters>
    
    {
        "ClusterId": "cynosdbmysql-92oecwyv",
        "MinCpu": 2,
        "MaxCpu": 2
    }

    Output Example

    {
        "Response": {
            "TaskId": 172231,
            "RequestId": "a7ef1e81-e306-45fd-ab3d-37a6ae7ecf96"
        }
    }

    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 Database access failed. Try again later. If the issue persists, contact customer service.
    FailedOperation.OperationFailedError Operation failed. Try again later. If the issue persists, contact customer service.
    FailedOperation.ServerlessSetStrategyError Policy modification failed.
    InternalError.DbOperationFailed Query database failed.
    InternalError.SystemError Internal system error.
    InternalError.UnknownError Unknown internal error.
    InvalidParameterValue.ClusterNotFound Cluster not found.
    InvalidParameterValue.DbModeNotServerlessError ClusterType must be serverless.
    InvalidParameterValue.InvalidParameterValueError Parameter value is invalid.
    InvalidParameterValue.ParamError Parameter error.
    OperationDenied.ClusterStatusDeniedError Operation not allowed in the current status of the cluster.
    ResourceNotFound.ClusterNotFoundError The cluster does not exist.
    UnauthorizedOperation.PermissionDenied CAM authentication failed.

    Ajuda e Suporte

    Esta página foi útil?

    comentários