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 PolarDB for MySQL 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 Yes CreateParameterGroup

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

RegionId String Yes cn-hangzhou

The region ID of the parameter template.

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 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 end with an underscore.
  • 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 199 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.
ResourceGroupId String No rg-**********

The ID of the resource group.

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.

Note You can call the DescribeParameterGroups operation to query the details of all parameter templates of a specified region, such as the ID of a parameter template.

Examples

Sample requests

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

Sample 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

HTTP status code Error code Error message Description
400 InvalidRegionId.Malformed he specified parameter RegionId is not valid. The error message returned because the specified RegionId parameter is invalid.
400 InvalidDBVersion.Malformed The Specified DBVersion is not valid. The error message returned because the specified DBVersion parameter is invalid.
400 InvalidParameterGroupName.Malformed The Specified parameter ParameterGroupName is not valid. The error message returned because the specified ParameterGroupName parameter is invalid.
400 NumberExceed.parameterGroupDesc The ParameterGroupDesc parameter`s number is exceed. The error message returned because the maximum length of the ParameterGroupDesc parameter is reached.
400 InvalidEngine.Unsupported The specified Engine does not support this feature. The error message returned because the feature is not supported by the specified database engine.
400 ParamGroupsNameInvalid The Specified parameter ParameterGroupName is not valid. The error message returned because the specified ParameterGroupName parameter is invalid.
404 InvalidDBType.NotFound The Specified DBType does not found. The error message returned because the specified DBType parameter is invalid.

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