Querying Configuration Parameters (V2)

Function

This API is used to query the configuration parameters of a DCS instance.

URI

GET /v2/{project_id}/instances/{instance_id}/configs

Table 1
Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Project ID.

instance_id

String

Yes

ID of the instance to be queried

Request

Request parameters

None

Example request

GET https://{dcs_endpoint}/v1.0/{project_id}/instances/{instance_id}/configs

Response

Response parameters

Table 2 describes the response parameters.
Table 2 Parameter description

Parameter

Type

Description

status

String

Current status of a DCS instance.

instance_id

String

Instance ID.

redis_config

Array

Array of configuration items of the DCS instance. For details, see Table 3.

config_status

String

DCS instance status that is being modified or has been modified. Options:

  • UPDATING
  • FAILURE
  • SUCCESS

config_time

String

Time at which the DCS instance is operated on. For example, 2017-03-31T12:24:46.297Z.

Table 3 redis_config parameter description

Parameter

Type

Description

description

String

Configuration item description.

param_id

Integer

Configuration parameter ID. For the possible values, see the Parameter ID column in Table 4.

param_name

String

Configuration parameter name. For the possible values, see the Parameter Name column in Table 4.

param_value

String

Configuration parameter value.

default_value

String

Default value of the configuration parameter. For the possible values, see the Default Value column in Table 4.

value_type

String

Type of the configuration parameter value. For the possible values, see the Value Type column in Table 4.

value_range

String

Range of the configuration parameter value. For the possible values, see the Value Range column in Table 4.

Table 4 describes the configuration parameters of a DCS instance.

Table 4 Configuration parameters of a DCS instance

Parameter ID

Parameter Name

Applicable Engine

Type

Description

Value Range

Default Value

1

timeout

Redis and Memcached

Interger

Connection between the client and server (DCS instance) will be closed if the client is idle for the timeout period (measured in seconds). A timeout period of 0 seconds indicates that the timeout function is disabled.

0 to 7200. Unit: second.

0

2

maxmemory-policy

Redis and Memcached

Enum

How Redis will select what to remove when maxmemory is reached.

For more information about this parameter, see https://redis.io/topics/lru-cache.

volatile-lru

allkeys-lru

volatile-random

allkeys-random

volatile-ttl

noeviction

noeviction

3

hash-max-ziplist-entries

Redis

Interger

When the number of entries in hashes is less than the value of this parameter, hashes are encoded using ziplist to save memory.

1–10,000

512

4

hash-max-ziplist-value

Redis

Interger

When the biggest entry in hashes does not exceed the length threshold indicated by this parameter, hashes are encoded using ziplist to save memory.

1–10,000

64

5

list-max-ziplist-entries

Redis

Interger

When the number of entries in lists is less than the value of this parameter, lists are encoded using ziplist to save memory.

1–10,000

512

6

list-max-ziplist-value

Redis

Interger

When the biggest entry in lists does not exceed the length threshold indicated by this parameter, lists are encoded using ziplist to save memory.

1–10,000

64

7

set-max-intset-entries

Redis

Interger

When a set is composed entirely of strings and the number of integers does not exceed the length threshold indicated by this parameter, the set is encoded using intset to save memory.

1–10,000

512

8

zset-max-ziplist-entries

Redis

Interger

When the number of entries in sorted sets is less than the value of this parameter, sorted sets are encoded using a memory efficient data structure.

1–10,000

128

9

zset-max-ziplist-value

Redis

Interger

When the biggest entry in sorted sets does not exceed the length threshold indicated by this parameter, sorted sets are encoded using ziplist to save memory.

1–10,000

64

10

latency-monitor-threshold

Redis

Interger

Threshold time in latency monitoring.

If this parameter is set to 0, latency monitoring is disabled. If this parameter is set to a value greater than 0, all events blocking the server for a time greater than the configured value will be logged.

By running the LATENCY command, you can perform operations related to latency monitoring, such as obtaining statistical data, and configuring and enabling latency monitoring. For more information about the latency-monitor-threshold, visit https://redis.io/topics/latency-monitor.

0 to 86,400,000. Unit: ms.

0

12

reserved-memory

Redis

Interger

This parameter is configurable only for master/standby instances.

The reserved memory is allocated to the VM where the instance is located. This ensures that the DCS instance background process has sufficient memory when performing tasks such as persistence and master/standby synchronization.

The size of the reserved memory can be adjusted, but must be in the value range described in the next column. NOTE: For more information about maximum available memory of each instance type, see DCS Service Overview.

0% to 50% of maximum memory space initially available to the instance and below the current free memory space. Unit: MB.

0

13

notify-keyspace-events

Redis

String

Keyspace event notification. If this parameter is configured, the Redis Sub/Pub feature will allow clients to receive an event when a Redis data set is modified.

If the parameter value is an empty character string or null, the default value Ex is used.

If the parameter value is a string of multiple characters, keyspace event notification is enabled and each character identifies a class of keyspace events for which Redis will send notifications.

K: Keyspace events, published with the __keyspace@__ prefix

E: Keyevent events, published with the __keyevent@__ prefix

g: Generic commands (non-type specific) such as DEL, EXPIRE, and RENAME

$: String commands

l: List commands

s: Set commands

h: Hash commands

z: Sorted set commands

x: Expired events (events generated every time a key expires)

e: Evicted events (events generated when a key is evicted for maxmemory)

For more information, see the following note.

Ex

More about the notify-keyspace-events parameter:

  • Allowed characters are K, E, KE, A, g, l, s, h, z, x, e, and $. The parameter value must contain either K or E.
  • A is an alias for g$lshzxe and cannot be used together with any of the characters in g$lshzxe.
  • For example, the value Kl means that Redis will notify Pub/Sub clients about keyspace events and list commands. The value AKE means Redis will notify Pub/Sub clients about all events.

Example response

{ 
  "config_time" : "", 
  "instance_id" : "c08fdc6e-5c25-4185-ab57-c0a5529b727f", 
  "redis_config" : [ { 
    "param_value" : "512", 
    "value_type" : "string", 
    "value_range" : "1-10000", 
    "description" : "Hashes are encoded using a memory efficient data structure when they have a small number of entries", 
    "default_value" : "Interger", 
    "param_name" : "hash-max-ziplist-entries", 
    "param_id" : 0 
  } ], 
  "config_status" : "UPDATING", 
  "status" : "RUNNING" 
}

Status Code

Table 5 Status codes

Status Code

Description

200

Instance configurations queried successfully.

400

Invalid request.

500

Failed to complete the request because of an internal service error.

Error Code

For details, see Error Codes.