Updated on 2024-07-12 GMT+08:00

Creating a Parameter Template

Function

This API is used to create a parameter template. Before calling this API:

URI

POST https://{Endpoint}/v3/{project_id}/configurations

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

For details about how to obtain the project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Parameter description

Name

Mandatory

Type

Description

name

Yes

String

Name of the parameter template, which must be unique. The template name can contain up to 64 characters. It can contain only letters (case-sensitive), digits, hyphens (-), underscores (_), and periods (.).

description

No

String

Parameter template description. This parameter is left blank by default. Up to 256 characters are displayed. Carriage return characters or special characters (>!<"&'=) are not allowed.

parameter_values

No

Map<String,String>

Mapping between parameter names and parameter values. You can specify parameter values based on a default parameter template.

datastore

Yes

object

DB engine information. To obtain the value, see Querying DB Engine Versions. For details, see Table 3.

Table 3 datastore parameter description

Name

Mandatory

Type

Description

engine_version

Yes

String

DB engine version.

instance_mode

Yes

String

Deployment model.

Value:

  • ha: primary/standby deployment
  • ha:readonly: read replicas of primary/standby deployment
  • independent: distributed independent deployment

Response Parameters

Table 4 Parameter description

Parameter

Type

Description

id

String

Parameter template ID.

name

String

Parameter template name.

created_at

String

Creation time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between calendar and hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the offset is shown as +0800.

Example Request

  • Creating a parameter template for GaussDB 2.3 primary/standby instances
    POST https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/configurations
    {
        "name": "paramTemplate",
        "description": "",
        "parameter_values": {
            "audit_system_object": "12294"
        },
        "datastore": {
            "engine_version": "2.3",
            "instance_mode": "ha"
        }
    }
  • Creating a parameter template with multiple user-defined parameters for GaussDB 2.3 distributed instances in the independent deployment
    POST https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/configurations
    {
        "name": "paramTemplate",
        "description": "",
        "parameter_values": {
            "audit_system_object": "12294",
            "dn:effective_cache_size": "262143",
            "checkpoint_segments": "2048"
        },
        "datastore": {
            "engine_version": "2.3",
            "instance_mode": "independent"
        }
    }

Example Response

Parameter template created.
{ 
  "id" : "137eeaf0cc884ca4adffa9ebd101c115pr14", 
  "name" : "paramTemplate-del", 
  "created_at" : "2022-08-09T03:06:52+0800" 
}

Status Code

Error Code

For details, see Error Codes.