All Products
Search
Document Center

PolarDB:TransformDBClusterPayType

Last Updated:Mar 21, 2024

Changes the billing method of a PolarDB cluster.

Operation description

Note
  • PolarDB clusters support the subscription and pay-as-you-go billing methods. You can change the billing method from subscription to pay-as-you-go or from pay-as-you-go to subscription based on your business requirements. For more information, see Change the billing method from subscription to pay-as-you-go and Change the billing method from pay-as-you-go to subscription.
  • You cannot change the billing method from pay-as-you-go to subscription if your account balance is insufficient.
  • If you change the billing method from subscription to pay-as-you-go, the system automatically refunds the balance of the prepaid subscription fees.
  • Debugging

    OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

    Authorization information

    The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

    • Operation: the value that you can use in the Action element to specify the operation on a resource.
    • Access level: the access level of each operation. The levels are read, write, and list.
    • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
      • The required resource types are displayed in bold characters.
      • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
    • Condition Key: the condition key that is defined by the cloud service.
    • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
    OperationAccess levelResource typeCondition keyAssociated operation
    polardb:TransformDBClusterPayTypeWrite
    • DBCluster
      acs:polardb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}
      none
    none

    Request parameters

    ParameterTypeRequiredDescriptionExample
    DBClusterIdstringYes

    The cluster ID.

    pc-bp10gr51qasnl****
    PayTypestringYes

    The billing method of the cluster. Valid values:

    • Postpaid: pay-as-you-go.
    • Prepaid: subscription.
    Prepaid
    RegionIdstringYes

    The ID of the region.

    cn-hangzhou
    UsedTimestringNo

    The subscription duration of the cluster. Valid values:

    • If the Period parameter is set to Year, the UsedTime parameter can be set to 1, 2, or 3.
    • If the Period parameter is set to Month, the UsedTime parameter can be set to 1, 2, 3, 4, 5, 6, 7, 8, or 9.
    Note This parameter is required if you set the PayType parameter to Prepaid.
    1
    PeriodstringNo

    The renewal cycle of the cluster. Valid values:

    • Year
    • Month
    Note This parameter is required if you set the PayType parameter to Prepaid.
    Month
    ResourceGroupIdstringNo

    The ID of the resource group.

    rg-acfm3f4un32****
    ClientTokenstringNo

    The client token that is used to ensure the idempotence of the request. You can use the client to generate the value. Make sure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

    6000170000591aed949d0f5********************

    Response parameters

    ParameterTypeDescriptionExample
    object

    Schema of Response

    RequestIdstring

    The request ID.

    5E71541A-6007-4DCC-A38A-F872C31FEB45
    ChargeTypestring

    The billing method of the cluster. Valid values:

    • Postpaid: pay-as-you-go.
    • Prepaid: subscription.
    Prepaid
    DBClusterIdstring

    The cluster ID.

    pc-bp10gr51qasnl****
    ExpiredTimestring

    The time when the cluster expires.

    Note This parameter is returned if you set the PayType parameter to Prepaid.
    2020-04-20T10:00:00Z
    OrderIdstring

    The ID of the order.

    20515760028****

    Examples

    Sample success responses

    JSONformat

    {
      "RequestId": "5E71541A-6007-4DCC-A38A-F872C31FEB45",
      "ChargeType": "Prepaid",
      "DBClusterId": "pc-bp10gr51qasnl****",
      "ExpiredTime": "2020-04-20T10:00:00Z",
      "OrderId": "20515760028****"
    }

    Error codes

    HTTP status codeError codeError messageDescription
    400InvalidOrderCharge.NotSupportThe specified order charge does not support in PolarDB.-
    400InvalidOrderTask.NotSupportThe Current ClusterId exist Order Task in PolarDB.-
    400InvalidPaymentMethod.IncompleteNo payment method is specified for your account. We recommend that you add a payment method.The valid payment method of vouchers is not specified for your account. Add a valid payment method.
    403OperationDenied.LockModeThe operation is not permitted when the instance is locked.This operation is not supported while the cluster is in the locked state.
    404InvalidDBCluster.NotFoundThe specified DBClusterId is not found.The specified cluster ID does not exist.

    For a list of error codes, visit the Service error codes.

    Change history

    Change timeSummary of changesOperation
    2023-09-12The Error code has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      Error Codes 400 change
      Error Codes 403 change
      Error Codes 404 change
    2021-05-21The Error code has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      Error Codes 400 change
      delete Error Codes: 404
      Added Error Codes: 403
    2021-05-21The Error code has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      delete Error Codes: 404
      Added Error Codes: 400
    2021-05-14Add Operationsee changesets