tencent cloud

APIs

ModifyServerlessStrategy

下载
聚焦模式
字号
最后更新时间: 2026-05-29 10:54:23

1. API Description

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

This API is used to modify the 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-pause feature is enabled. 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 invalid

    MinCpu No Float

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

    MaxCpu No Float

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

    MinRoCpu No Float

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

    MaxRoCpu No Float

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

    MinRoCount No Integer

    Minimum count of read-only nodes

    MaxRoCount No Integer

    Maximum number of read-only nodes

    AutoArchive No String

    Whether archiving is enabled. Optional range

  • yes
  • no
  • Default value: yes

    UpgradeType No String

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

    SecurityGroupIdsForNewRo.N No Array of String

    List of security groups to which newly-added read-only instances need to be bound. This only applies to binding security groups to read-only instances generated during the process of this adjustment of policies. 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 Modify 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 Update a serverless policy

    This example shows you how to 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 Failed to access the database. Please try again later. If the problem persists, please contact customer service.
    FailedOperation.OperationFailedError Operation failed. Try again later. If the problem persists, contact customer service.
    FailedOperation.ServerlessSetStrategyError Policy modification failed.
    InternalError.DbOperationFailed Failed to query the database.
    InternalError.SystemError Internal system error.
    InternalError.UnknownError Unknown internal error.
    InvalidParameterValue.ClusterNotFound No cluster found.
    InvalidParameterValue.DbModeNotServerlessError The cluster type must be serverless.
    InvalidParameterValue.InvalidParameterValueError Invalid parameter value.
    InvalidParameterValue.ParamError Incorrect parameter.
    OperationDenied.ClusterStatusDeniedError For the cluster in this status, the operation is not allowed.
    ResourceNotFound.ClusterNotFoundError The cluster does not exist.
    UnauthorizedOperation.PermissionDenied CAM authentication failed.

    帮助和支持

    本页内容是否解决了您的问题?

    填写满意度调查问卷,共创更好文档体验。

    文档反馈