Files
doc-exports/docs/geminidb/api-ref/nosql_06_0003.html
wangdengke2 8d0926f0e5 geminidb_api
Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: wangdengke2 <wangdengke2@huawei.com>
Co-committed-by: wangdengke2 <wangdengke2@huawei.com>
2025-09-04 07:22:35 +00:00

20 KiB

Creating a Parameter Template

Function

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

Constraints

This API can be used for GeminiDB Cassandra instances.

The new parameter template cannot have the same name as any existing parameter template.

For configuration item values, you can enter system-defined parameters that allow for modification.

URI

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

Table 1 URI parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

MIME type of the request body. application/json is recommended.

X-Auth-Token

Yes

String

User token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

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

description

No

String

Parameter template description. It can contain a maximum of 256 characters except the following special characters: >!<"&'= The value is left blank by default.

values

No

Map<String,String>

Parameter values defined by users based on a default parameter template. Keep the parameter values unchanged by default.

datastore

Yes

ConfigurationDatastoreOption object

Database object.

Table 4 ConfigurationDatastoreOption

Parameter

Mandatory

Type

Description

type

Yes

String

Database type. The value can be:

cassandra: GeminiDB Cassandra instance

version

Yes

String

Database version. The value can be:

3.11, indicating that GeminiDB Cassandra 3.11 is supported.

Response Parameters

Status code: 200

Table 5 Response body parameter

Parameter

Type

Description

configuration

ConfigurationResult object

Parameter template information.

Table 6 ConfigurationResult

Parameter

Type

Description

id

String

Parameter template ID.

name

String

Parameter template name.

datastore_version_name

String

Database version name.

datastore_name

String

Database name.

description

String

Parameter template description

created

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.

updated

String

Update 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.

Example Request

  • URI example
    POST https://{Endpoint}/v3/375d8d8fad1f43039e23d3b6c0f60a19/configurations
  • Creating a parameter template for GeminiDB Cassandra instances
    {
      "name" : "configuration_test",
      "description" : "configuration_test",
      "values" : {
        "max_connections" : "10",
        "autocommit" : "OFF"
      },
      "datastore" : {
        "type" : "cassandra",
        "version" : "3.11"
      }
    }

Example Response

Status code: 200

Success

{
  "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 Codes

See Status Codes.

Error Codes

See Error Codes.