Updated on 2023-12-13 GMT+08:00

Viewing Parameter Templates

Function

This API is used to query parameter templates of a tenant, and allows you to specify query criteria.

URI

GET /v2/{project_id}/config-templates

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

name

No

String

Parameter template name. Fuzzy search is supported.

type

Yes

String

Template type. Options:

  • sys: default template

  • user: custom template

Enumeration values:

  • sys

  • user

engine

No

String

Cache engine: Redis or Memcached.

engine_version

No

String

Cache version.

If the cache engine is Redis, the value can be 3.0/4.0/5.0/6.0.

If the cache engine is Memcached, this parameter is optional and can be left blank.

cache_mode

No

String

DCS instance type. Options:

  • single: single-node

  • ha: master/standby

  • cluster: Redis Cluster

  • proxy: Proxy Cluster

offset

No

Integer

Offset, which is the position where the query starts. The value must be greater than or equal to 0.

limit

No

Integer

Number of records displayed on each page. The minimum value is 1. The maximum value is 1000*. If this parameter is not specified, 10 records are displayed on each page by default.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

template_num

Integer

Number of templates.

templates

Array of ConfigTemplatesListInfo objects

Template details array.

Table 4 ConfigTemplatesListInfo

Parameter

Type

Description

template_id

String

Template ID.

cache_mode

String

DCS instance type. Options:

  • single: single-node

  • ha: master/standby

  • cluster: Redis Cluster

  • proxy: Proxy Cluster

description

String

Template description.

engine

String

Cache engine: Redis or Memcached.

engine_version

String

Cache version.

If the cache engine is Redis, the value can be 3.0, 4.0, 5.0, or 6.0.

If the cache engine is Memcached, this parameter is optional and can be left blank.

name

String

Template name.

product_type

String

Product edition. The value can be:

  • generic: standard edition

  • enterprise: professional edition

Enumeration values:

  • generic

  • enterprise

storage_type

String

Storage type.

Enumeration values:

  • DRAM

  • SSD

type

String

Template type. Options:

  • sys: default template

  • user: custom template

Enumeration values:

  • sys

  • user

created_at

String

Time when the template is created. This parameter is valid only in custom parameter templates. The format is 2023-05-10T11:09:35.802Z.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_msg

String

Error information.

Maximum: 1024

error_code

String

Error code.

Maximum: 9

error_ext_msg

String

Extended error information. This parameter is not used currently and is set to null.

Maximum: 1024

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_msg

String

Error information.

Maximum: 1024

error_code

String

Error code.

Maximum: 9

error_ext_msg

String

Extended error information. This parameter is not used currently and is set to null.

Maximum: 1024

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_msg

String

Error information.

Maximum: 1024

error_code

String

Error code.

Maximum: 9

error_ext_msg

String

Extended error information. This parameter is not used currently and is set to null.

Maximum: 1024

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_msg

String

Error information.

Maximum: 1024

error_code

String

Error code.

Maximum: 9

error_ext_msg

String

Extended error information. This parameter is not used currently and is set to null.

Maximum: 1024

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_msg

String

Error information.

Maximum: 1024

error_code

String

Error code.

Maximum: 9

error_ext_msg

String

Extended error information. This parameter is not used currently and is set to null.

Maximum: 1024

Example Requests

GET https://{dcs_endpoint}/v2/{project_id}/config-templates?type=sys&engine=Redis&engine_version=5.0&cache_mode=ha&offset=0&limit=10

Example Responses

Status code: 200

Parameter templates listed.

{
  "template_num" : 1,
  "templates" : [ {
    "template_id" : "6",
    "cache_mode" : "single",
    "description" : null,
    "engine" : "Redis",
    "engine_version" : "4.0",
    "name" : "Default-Redis-4.0-single-generic-DRAM",
    "product_type" : "generic",
    "storage_type" : "DRAM",
    "type" : "sys"
  } ]
}

Status code: 400

Invalid request.

{
  "error_code" : "111400063",
  "error_msg" : "Invalid {0} parameter in the request."
}

Status Codes

Status Code

Description

200

Parameter templates listed.

400

Invalid request.

401

Invalid authentication information.

403

Request rejected.

404

The requested resource could not be found.

500

Internal service error.

Error Codes

See Error Codes.