Creates a parameter template.

You can use parameter templates to manage multiple parameters at a time and apply existing parameters to a PolarDB cluster. For more information, see Use a parameter template.

Note Only ApsaraDB PolarDB MySQL-compatible edition clusters support this feature.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No CreateParameterGroup

The operation that you want to perform. Set the value to CreateParameterGroup.

RegionId String Yes cn-hangzhou

The ID of the region to which the parameter template belongs.

Note You can call the DescribeRegions operation to query the IDs of available regions.
DBType String Yes MySQL

The type of the database engine. Only MySQL is supported.

DBVersion String Yes 8.0

The version number of the database engine. Valid values:

  • 5.6
  • 5.7
  • 8.0
ParameterGroupName String Yes test_group

The name of the parameter template. The name must meet the following requirements:

  • It can contain letters, digits, and underscores (_). It must start with a letter and cannot contain Chinese characters.
  • It must be 8 to 64 characters in length.
ParameterGroupDesc String No test_group

The description of the parameter template. It must be 0 to 200 characters in length.

Parameters String Yes {"wait_timeout":"86400","innodb_old_blocks_time":"1000"}

The JSON string that consists of parameters and values. The parameter values are strings. Example: {"wait_timeout":"86400","innodb_old_blocks_time":"1000"}.

Note You can call the DescribeParameterTemplates operation to query the details of all parameters in the cluster of a specified engine version, such as the parameter names and valid values.

Response parameters

Parameter Type Example Description
RequestId String 514D1D87-E243-4A5F-A87D-2785C3******

The ID of the request.

ParameterGroupId String pcpg-**************

The ID of the parameter template.

Examples

Sample requests

http(s)://polardb.aliyuncs.com/?Action=CreateParameterGroup
&DBType=MySQL
&DBVersion=8.0
&ParameterGroupName=test_group
&Parameters={"wait_timeout":"86400","innodb_old_blocks_time":"1000"}
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateParameterGroupResponse>
    <RequestId>514D1D87-E243-4A5F-A87D-2785C3******</RequestId>
    <ParameterGroupId>pcpg-**************</ParameterGroupId>
</CreateParameterGroupResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "514D1D87-E243-4A5F-A87D-2785C3******",
  "ParameterGroupId" : "pcpg-**************"
}

Error codes

For a list of error codes, visit the API Error Center.