You need to enable JavaScript to run this app.
RDS for MySQL

RDS for MySQL

Copy page
Download PDF
Resource plan management
CreateResourcePackage
Copy page
Download PDF
CreateResourcePackage

Call the CreateResourcePackage interface to create a resource package.

Request type

Asynchronous request.

Request parameters

Name
Type
Required
Example
Description
PackageType
String
Yes
StoragePackage
The type of the resource package. Currently, only the value StoragePackage is supported, which means a storage package.
PackageSpec
String
Yes
100

Resource package specifications. If the value of PackageType is StoragePackage, the valid values for PackageSpec are as follows:

  • 100: 100 GiB.
  • 200: 200 GiB.
  • 300: 300 GiB.
  • 500: 500 GiB.
  • 1000: 1000 GiB.
  • 2000: 2000 GiB.
  • 5000: 5000 GiB.
  • 10000: 10000 GiB.
EffectiveTimeType
String
Yes
Specified

Effective time type. Values:

  • Immediate: Take effect immediately.
  • Specified: Take effect at a specified time.
EffectiveTime
String
No
2025-08-30T09:00:00Z

When the effective time of the specified resource package is set to "Specified Time", that is, when the value of EffectiveTimeType is Specified, it needs to be passed in.

tip

If the specified effective time is earlier than the current time, the whole - hour time before the current time will be taken as the effective time of the resource package.

ChargeInfo
Object
Yes
Please refer to the request example.
The purchase duration of the resource package.
ChargeType
String
Yes
PostPaid

Payment type. Value:

  • PostPaid: Pay-as-you-go (postpaid).
  • PrePaid: Annual or monthly subscription (prepaid).
AutoRenew
Boolean
No
true

Whether to automatically renew upon expiration in the prepaid scenario. Value range:

  • true: Automatically renew upon expiration.
  • false: Do not automatically renew upon expiration.

tip

  • When the value of ChargeType is PrePaid, this parameter is required.
  • When the value of ChargeType is PostPaid, this parameter does not need to be passed in.
PeriodUnit
String
No
Month

The purchase cycle in the prepaid scenario. Value range:

  • Month: The purchase cycle is monthly.
  • Year: The purchase cycle is yearly.

tip

  • When the value of ChargeType is PrePaid, this parameter is required.
  • When the value of ChargeType is PostPaid, this parameter does not need to be passed in.
Period
Integer
No
1

The purchase duration in the prepaid scenario. The value range of this parameter depends on the value of PeriodUnit:

  • When the value of PeriodUnit is Month, the value of Period is 1~9.
  • When the value of PeriodUnit is Year, the value of Period is 1~3.

tip

  • When the value of ChargeType is PrePaid, this parameter is required.
  • When the value of ChargeType is PostPaid, this parameter does not need to be passed in.
Number
Integer
No
1

The number of instances purchased. The value range is 1~50. The default value is 1.

tip

  • In the RestoreToNewInstance and RestoreToCrossRegionInstance interfaces, only the value 1 is supported for this field.

  • It is not supported to specify names for instances separately when creating instances in batches. When creating instances in batches:

    • If the instance name is specified in the InstanceName parameter, the serial number will be added after the specified instance name to name the batch-created instances.
    • If the instance name is not specified in the InstanceName parameter, the instance ID will be used to name the instance.

Response parameters

Name
Type
Example
Description
OrderId
String
Order2002000011757122272
Configuration order number

Sample request

POST /?Action=CreateResourcePackage&Version=2022-01-01 HTTP/1.1
Content-Type: application/json
Host: rds-mysql.cn-beijing.volcengineapi.com
X-Date: 20211202T101010Z
Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_mysql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****
{
    "PackageType": "StoragePackage",
    "PackageSpec": "100",
    "EffectiveTimeType": "Specified",
    "EffectiveTime": "2025-09-30T09:00:00Z",
    "ChargeInfo": {
        "Number": 1,
        "Period": 1,
        "PeriodUnit": "Month"
    }
}

Sample response

{
    "ResponseMetadata": {
        "RequestId": "2025092223045219098175CFF5A8A0299E-ddbddb",
        "Action": "CreateResourcePackage",
        "Version": "2022-01-01",
        "Service": "rds_mysql",
        "Region": "cn-beijing"
    },
    "Result": {
        "OrderId": "Order2002000011757122272"
    }
}

Error codes

For more details, refer to Error codes.

Last updated: 2025.12.08 15:47:13