Updated on 2026-01-08 GMT+08:00

Creating a Parameter Template

Description

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

Restrictions

  • This API applies only to DDS Community Edition.
  • The name of the custom parameter template is case-sensitive and must be different from the name of an existing or a default parameter template.
  • The value of parameter_values in the parameter template must be within the default value range of the specified database version. For details about the range of parameter values, see Editing a Parameter Template in Document Database Service User Guide.

URI

  • URI format

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

Table 1 Path parameters

Name

Type

IN

Mandatory

Description

project_id

string

path

Yes

Project ID of a tenant in a region. To obtain the project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Type

IN

Mandatory

Description

X-Auth-Token

string

header

Yes

User token

Table 3 Request body parameters

Parameter

Type

Mandatory

Description

name

String

Yes

Parameter template name.

Value range: a string of 1 to 64 characters, which can contain only letters, digits, hyphens (-), underscores (_), and periods (.).

description

String

Yes

Parameter template description. This parameter is left blank by default.

The description must consist of a maximum of 256 characters and cannot contain the carriage return character or the following special characters: >!<"&'=

parameter_values

Map<String,String>

Yes

Mapping between parameter names and parameter values. You can customize parameter values based on the parameters in the default parameter template.

datastore

Object

Yes

Database object.

For details, see Table 4.

Table 4 Data structure description of the datastore field

Parameter

Type

Mandatory

Description

node_type

String

Yes

Node type of parameter template. Valid value:
  • mongos: the mongos node type.
  • shard: the shard node type.
  • config: the config node type.
  • replica: the replica set type.
  • readonly: the read replica type of a replica set instance.
  • shard_readonly: the read replica type of a cluster instance.
  • single the single node type.

version

String

Yes

Database version. Versions 4.4, 4.2, 4.0, and 3.4 are supported. The value can be 4.4, 4.2, 4.0, or 3.4.

  • Request example
    { 
      "name" : "myparameter", 
      "description" : "parameter1", 
      "datastore" : { 
        "node_type" : "shard", 
        "version" : "3.4" 
      }, 
      "parameter_values" : { 
        "max_connections" : "10" 
      } 
    }

Response Parameters

Table 5 configuration field data structure description

Parameter

Type

Description

id

String

Parameter template ID

name

String

Parameter template name

description

String

Parameter template description.

datastore_version

String

Database version.

datastore_name

String

Database type.

created

String

Creation time in the "yyyy-MM-ddTHH:mm:ssZ" format.

T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset.

updated

String

Update time in the "yyyy-MM-ddTHH:mm:ssZ" format.

T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset.

  • Example response
    {
      "configuration": {
        "id": "7b4e07852bd54016906e89461b3182cdpr02",
        "name": "myparameter",
        "description": "parameter1",
        "datastore_version": "3.4",
        "datastore_name": "mongodb",
        "created": "2018-09-19T02:54:21",
        "updated": "2018-09-19T02:54:21"
      }
    }

Status Code

For details, see Status Code.

Error Code

For details, see Error Code.