Creating a Parameter Template

Function

This API is used to create a parameter template and configure the name, description, DB engine, and parameter values in the parameter template.

URI

  • URI format

    PATH: /v1.0/{project_id}/configurations

    Method: POST

  • Parameter description

    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID of a tenant in a region.

  • Restrictions

    • The name of the created parameter template is case-insensitive and must be different from the name of an existing or a default parameter template.

    • Currently, the DB engines MySQL and PostgreSQL support creating parameter templates.

    • The values of the created parameter template must be within the default value range of the specified database version. For details about the range of parameter values, see section "Editing Parameters in a Parameter Template" in the Relational Database Service User Guide.

Request

  • Parameter description

    Table 2 Parameter description

    Name

    Mandatory

    Type

    Description

    configuration

    Yes

    Dictionary data structure. For details, see Table 3.

    Specifies the parameter template object.

    Table 3 configuration field data structure description

    Name

    Mandatory

    Type

    Description

    name

    Yes

    String

    Specifies the parameter template name. It contains a maximum of 64 characters and can contain only uppercase letters, lowercase letters, digits, hyphens (-), underscores (_), and periods (.).

    description

    No

    String

    Specifies the parameter template description. It contains a maximum of 256 characters and does not support the following special characters: !<>='&"

    values

    Yes

    Dictionary data structure. For details, see Table 4.

    Specifies the parameter values defined by users based on the default parameter template.

    datastore

    Yes

    Dictionary data structure. For details, see Table 5.

    Specifies the database object.

    Table 4 values field data structure description

    Name

    Mandatory

    Type

    Description

    key

    No

    String

    Specifies the parameter name. For example, in "max_connections": "10", the key is max_connections.

    value

    No

    String

    Specifies the parameter value. For example, in "max_connections": "10", the value is 10.

    Table 5 datastore field data structure description

    Name

    Mandatory

    Type

    Description

    type

    Yes

    String

    Specifies the DB engine. Currently, MySQL and PostgreSQL are supported. The value is case-insensitive and can be mysql or postgresql.

    version

    Yes

    String

    Specifies the database version.

    • For MySQL, the value can be 5.6 and 5.7. The value 5.6 is supported by default.

    • For PostgreSQL, the value can be 11 and 16. The default value is 11.

  • Request example

    {
      "configuration": {
        "name": "configuration_test",
        "description": "configuration_test",
        "values": {
           "max_connections": "10",
           "autocommit": "OFF"
        },
        "datastore": {
          "type": "mysql",
          "version": "5.6"
        }
      }
    }
    

Normal Response

  • Parameter description

    Table 6 Parameter description

    Name

    Type

    Description

    configuration

    Dictionary data structure. For details, see Table 7.

    Indicates the parameter template information.

    Table 7 configuration field data structure description

    Name

    Type

    Description

    id

    String

    Indicates the parameter template ID.

    name

    String

    Indicates the parameter template name.

    datastore_version_id

    String

    Indicates the database version ID.

    datastore_version_name

    String

    Indicates the database version name.

    datastore_name

    String

    Indicates the database name.

    description

    String

    Indicates the parameter template description.

    instance_count

    Int

    Indicates the number of DB instances to which the parameter template applies.

    created

    String

    Indicates the parameter template creation time in the following format: yyyy-MM-ddTHH:mm:ss.

    updated

    String

    Indicates the parameter template updated time in the following format: yyyy-MM-ddTHH:mm:ss.

    values

    Dictionary data structure. For details, see Table 8.

    Indicates the parameter values defined by users based on the default parameter template. It is displayed only when you specify a custom parameter group. If you use a default parameter group, it is not returned.

    Table 8 values field data structure description

    Name

    Type

    Description

    key

    String

    Indicates the parameter name. For example, in "max_connections": "10", the key is max_connections.

    value

    String

    Indicates the parameter value. For example, in "max_connections": "10", the value is 10.

  • Response example

    {
      "configuration": {
        "id": "463b4b58-d0e8-4e2b-9560-5dea4552fde9",
        "name": "configuration_test",
        "datastore_version_id": "de90043f-7f29-4a3e-ba82-f8beb5678b46",
        "datastore_version_name": "5.6",
        "datastore_name": "mysql",
        "description": "configuration_test",
        "instance_count": 0,
        "created": "2017-04-09T08:27:56",
        "updated": "2017-04-09T08:27:56",
        "values": {
           "max_connections": "10",
           "autocommit": "OFF"
        }
      }
    }
    

Abnormal Response

For details, see Abnormal Request Results.