Updated on 2025-08-22 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

  • URI example

    https://dds.ap-southeast-1.myhuaweicloud.com/v3/056538411200d4cd2f79c003c7606412/configurations

Table 1 Request parameters

Name

Type

IN

Mandatory

Description

X-Auth-Token

string

header

Yes

Definition

User token obtained from IAM. For details, see Authentication.

Constraints

N/A

Range

N/A

Default Value

N/A

project_id

string

path

Yes

Definition

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

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

  • Parameter description
    Table 2 Request body parameters

    Parameter

    Type

    Mandatory

    Description

    name

    String

    Yes

    Definition

    Parameter template name.

    Constraints

    The template name can contain 1 to 64 characters. Only letters (case-sensitive), digits, hyphens (-), underscores (_), and periods (.) are allowed.

    Range

    N/A

    Default Value

    N/A

    description

    String

    Yes

    Definition

    Parameter template description.

    Constraints

    The description can consist of up to 256 characters. It cannot contain carriage returns or any of the following special characters: >!<"&'=

    Range

    N/A

    Default Value

    The value is left blank by default.

    parameter_values

    Map<String,String>

    Yes

    Definition

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

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    datastore

    Object

    Yes

    Definition

    Database object. For details, see Table 3.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    Table 3 Data structure description of the datastore field

    Name

    Type

    Mandatory

    Description

    node_type

    String

    Yes

    Definition

    Node type of parameter template node_type.

    Constraints

    N/A

    Range
    • 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.

    Default Value

    N/A

    version

    String

    Yes

    Definition

    Database version.

    Constraints

    N/A

    Range

    The value can be 5.0, 4.4, 4.2, 4.0, and 3.4.

    Default Value

    N/A

Example Request

Creating a parameter template in which name is set to myparameter, node_type is set to shard, version is set to 3.4, and the maximum number of connections is set to 10
{ 
  "name" : "myparameter", 
  "description" : "parameter1", 
  "datastore" : { 
    "node_type" : "shard", 
    "version" : "3.4" 
  }, 
  "parameter_values" : { 
    "max_connections" : "10" 
  } 
}

Response Parameters

  • Parameter description
    Table 4 Response body parameters

    Name

    Type

    Description

    configuration

    ParamGroupInfoResult object

    Definition

    The parameter template list.

    Range

    N/A

    Table 5 configuration field data structure description

    Name

    Type

    Description

    id

    String

    Definition

    Parameter template ID

    Range

    N/A

    name

    String

    Definition

    Parameter template name

    Range

    N/A

    description

    String

    Definition

    Parameter template description.

    Range

    N/A

    datastore_version

    String

    Definition

    Database version.

    Range

    N/A

    datastore_name

    String

    Definition

    Database type.

    Range

    N/A

    created

    String

    Definition

    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.

    Range

    N/A

    updated

    String

    Definition

    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.

    Range

    N/A

  • Response example
    {
      "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"
      }
    }

SDK

Click Document Database Service DDS SDK to download the SDK or view the SDK document. To learn how to install and authenticate an SDK, read the Usage section.

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.