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.

Constraints

This API supports the following DB instances:

  • GaussDB(for Cassandra)
  • GaussDB(for Mongo) cluster 3.4 and replica set 4.0
  • GaussDB(for Influx)
  • The name of the created parameter template cannot be the same as that of the default or an existing parameter template.

URI

  • URI format

    POST /v3/{project_id}/configurations

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID of a tenant in a region.

Requests

  • Parameter description
    Table 2 Parameter 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 except the following special characters: >!<"&'= The value is left blank by default.

    values

    No

    Object

    Specifies the parameter values defined by users based on the default parameter template. By default, the parameter values cannot be changed.

    For details, see Table 3.

    datastore

    Yes

    Object

    Specifies the database objects.

    For details, see Table 4.

    Table 3 values field data structure description

    Name

    Mandatory

    Type

    Description

    key

    No

    String

    Specifies the parameter name. For example, for "max_connections":"10", max_connections indicates the key.

    • If the key is empty, the parameter value is not changed.
    • If the key is not empty, value cannot be left empty.

    value

    No

    String

    Specifies the parameter value. For example, for"max_connections":"10", 10 indicates the value.

    Table 4 datastore field data structure description

    Name

    Mandatory

    Type

    Description

    type

    Yes

    String

    Specifies the database type. GaussDB(for Cassandra) and GaussDB(for Mongo) instances are supported.

    • For GaussDB(for Cassandra), the value is "cassandra".
    • For GaussDB(for Mongo), the value is "mongodb".
    • For GaussDB (for Influx) instances, the value is "influxdb".

    version

    Yes

    String

    Specifies the database version.

    The value 3.11 indicates that GaussDB(for Cassandra) 3.11 is supported.

    The values 3.4 and 4.0 indicate that GaussDB(for MongoDB) 3.4 and 4.0 are supported.

    The values 1.7 indicate that GaussDB(for Influx) 1.7 is supported.

    mode

    No

    String

    Specifies the database deployment mode. This parameter is mandatory for GaussDB(for Mongo).

    • For GaussDB(for Mongo) 3.4, the value is "Sharding".
    • For GaussDB(for Mongo) 4.0, the value is "ReplicaSet".
  • Request header
    POST https://GaussDB_NoSQL_Endpoint/v3/{project_id}/configurations
  • Example request
    { 
        "name": "configuration_test", 
        "description": "configuration_test", 
        "values": { 
            "max_connections": "10", 
            "autocommit": "OFF" 
        }, 
        "datastore": { 
            "type": "cassandra", 
            "version": "3.11" 
        } 
    }

Responses

  • Parameter description
    Table 5 Parameter description

    Name

    Type

    Description

    configuration

    Object

    Indicates the parameter template information.

    For details, see Table 6.

    Table 6 configuration field data structure description

    Name

    Type

    Description

    id

    String

    Indicates the parameter template ID.

    name

    String

    Indicates the parameter template name.

    datastore_version_name

    String

    Indicates the database version name.

    datastore_name

    String

    Indicates the database name.

    description

    String

    Indicates the parameter template description.

    created

    String

    Indicates the creation time in the following format: yyyy-MM-ddTHH:mm:ssZ.

    T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800.

    updated

    String

    Indicates the update time in the following format: yyyy-MM-ddTHH:mm:ssZ.

    T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800.

  • Response example
    { 
        "configuration": { 
            "id": "463b4b58d0e84e2b95605dea4552fdpr06", 
            "name": "configuration_test", 
            "datastore_version_name": "3.11", 
            "datastore_name": "cassandra", 
            "description": "configuration_test", 
            "created": "2020-03-09T08:27:56+0800", 
            "updated": "2020-03-09T08:27:56+0800" 
        } 
    }

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.