Queries the parameters and default values of ApsaraDB for Redis instances with a specified architecture and major version.

After you call this operation to query the parameters and default values, you can also call the ModifyInstanceConfig operation to modify the parameters of an ApsaraDB for Redis instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer automatically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeParameterTemplates

The operation that you want to perform. Set the value to DescribeParameterTemplates.

CharacterType String Yes logic

The architecture of the instance. For more information, see Architectures. Valid values:

  • logic: the cluster or read/write splitting instances.
  • normal: the master-replica instances.
Engine String Yes Redis

The database type of the instance. Set the value to Redis.

EngineVersion String Yes 5.0

The major version of the instance. Valid values: 2.8, 4.0, and 5.0.

RegionId String No cn-hangzhou

The ID of the region where the instance is deployed. You can call the DescribeRegions operation to query IDs of available regions.

Response parameters

Parameter Type Example Description
Engine String redis

The database type of the instance. Set the value to Redis.

EngineVersion String 5.0

The major version of the ApsaraDB for Redis instance.

ParameterCount String 24

The number of parameters.

Parameters Array of TemplateRecord

The details of the parameters.

TemplateRecord
CheckingCode String [yes|no]

The valid values of the parameter.

ForceModify Boolean true

Indicates whether the parameter can be modified. Valid values:

  • true: The parameter can be modified.
  • false: The parameter cannot be modified.
ForceRestart Boolean false

Indicates whether a restart is required after the parameter is modified. Valid values:

  • true: A restart is required for modifications to take effect.
  • false: The modification immediately takes effect without restart.
ParameterDescription String Enable append-only file (AOF) persistence.

The description of the parameter.

ParameterName String appendonly

The name of the parameter. For more information about parameters and configurations, see Parameter overview and configuration guide.

ParameterValue String yes

The default value of the parameter.

RequestId String 9DA28D8E-514D-4F12-ADED-70A9C818****

The ID of the request.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/?Action=DescribeParameterTemplates
&CharacterType=logic
&Engine=Redis
&EngineVersion=5.0
&<Common request parameters>

Sample success responses

XML format

<DescribeParameterTemplatesResponse>
      <ParameterCount>24</ParameterCount>
      <EngineVersion>5.0</EngineVersion>
      <Parameters>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[yes|no]</CheckingCode>
                  <ParameterValue>no</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>#no_loose_check-whitelist-always</ParameterName>
                  <ParameterDescription>check whitelist always</ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>. *</CheckingCode>
                  <ParameterValue></ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>#no_loose_disabled-commands</ParameterName>
                  <ParameterDescription>You can disable some dangerous commands, for example "keys,flushdb,flushall", the commands must be in [flushall,flushdb,keys,hgetall,eval,evalsha,script]. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[yes|no]</CheckingCode>
                  <ParameterValue>no</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>#no_loose_sentinel-enabled</ParameterName>
                  <ParameterDescription>Be compatible with sentinel mode. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[yes|no]</CheckingCode>
                  <ParameterValue>yes</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>appendonly</ParameterName>
                  <ParameterDescription>Enable AOF persistence.</ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>\d+\s+\d+\s+\d+</CheckingCode>
                  <ParameterValue>33554432 8388608 60</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>client-output-buffer-limit pubsub</ParameterName>
                  <ParameterDescription>The output buffer limits of publisher and subscriber clients.</ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[yes|no]</CheckingCode>
                  <ParameterValue>yes</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>dynamic-hz</ParameterName>
                  <ParameterDescription>Whether to enable a dynamic hz value.</ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[0-999999999999999]</CheckingCode>
                  <ParameterValue>512</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>hash-max-ziplist-entries</ParameterName>
                  <ParameterDescription>If hash fields are less than this value and hash value sizes are less than hash-max-ziplist-value, the ziplist will be used. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[0-999999999999999]</CheckingCode>
                  <ParameterValue>64</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>hash-max-ziplist-value</ParameterName>
                  <ParameterDescription>If hash value sizes are than less this value and hash fields are less than hash-max-ziplist-entries, the ziplist will be used. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[1-500]</CheckingCode>
                  <ParameterValue>10</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>hz</ParameterName>
                  <ParameterDescription>The frequency at which Redis background tasks are performed, for example, tasks to evict expired keys. Valid values: 1 to 500. The default value is 10, which specifies that each task is performed 10 times per second. A higher value results in higher CPU consumption but allows the system to delete expired keys and terminate time-out connections more frequently. We recommend that you specify a value less than or equal to 100.</ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[yes|no]</CheckingCode>
                  <ParameterValue>no</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>lazyfree-lazy-eviction</ParameterName>
                  <ParameterDescription>lazyfree switch on eviction. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[yes|no]</CheckingCode>
                  <ParameterValue>yes</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>lazyfree-lazy-expire</ParameterName>
                  <ParameterDescription>lazyfree switch on expire. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[yes|no]</CheckingCode>
                  <ParameterValue>yes</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>lazyfree-lazy-server-del</ParameterName>
                  <ParameterDescription>lazyfree switch on server implicit deletion. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[0-65535]</CheckingCode>
                  <ParameterValue>0</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>list-compress-depth</ParameterName>
                  <ParameterDescription>The number of entries on the list that are not compressed at both ends. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[-5-99999999]</CheckingCode>
                  <ParameterValue>-2</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>list-max-ziplist-size</ParameterName>
                  <ParameterDescription>Threadhold of ziplist size on quicklist. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[volatile-lru|allkeys-lru|volatile-random|allkeys-random|volatile-ttl|volatile-lfu|allkeys-lfu|noeviction]</CheckingCode>
                  <ParameterValue>volatile-lru</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>maxmemory-policy</ParameterName>
                  <ParameterDescription>To config how Redis will select what to remove when maxmemory is reached. There are eight behaviors that can be chose : volatile-lru,allkeys-lru,volatile-lfu,allkeys-lfu,volatile-random,allkeys-random,volatile-ttl,noeviction</ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>. *</CheckingCode>
                  <ParameterValue></ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>notify-keyspace-events</ParameterName>
                  <ParameterDescription>keyspace-event notification feature. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[0-999999999999999]</CheckingCode>
                  <ParameterValue>512</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>set-max-intset-entries</ParameterName>
                  <ParameterDescription>Sets have a special encoding in just one case: when a set is composed of just strings that happen to be integers in radix 10 in the range of 64 bit signed integers. The following configuration setting sets the limit in the size of the set in order to use this special memory saving encoding. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[10000-10000000]</CheckingCode>
                  <ParameterValue>20000</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>slowlog-log-slower-than</ParameterName>
                  <ParameterDescription>The time is expressed in microseconds, so 1000000 is equivalent to one second. The default setting for this is 20000 (20ms) and the lower bound of this setting is 10000 (10ms).  </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[100-10000]</CheckingCode>
                  <ParameterValue>1024</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>slowlog-max-len</ParameterName>
                  <ParameterDescription>The max slowlog count. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[0-999999999999999]</CheckingCode>
                  <ParameterValue>4096</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>stream-node-max-bytes</ParameterName>
                  <ParameterDescription>The maximum amount of memory in bytes that each macro node in a stream can consume. Valid values: 0 to 999999999999999. Default value: 4096. Unit: bytes. A value of 0 specifies that the amount of consumed memory is not limited.</ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[0-999999999999999]</CheckingCode>
                  <ParameterValue>100</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>stream-node-max-entries</ParameterName>
                  <ParameterDescription>The maximum number of entries stored on each macro node in a stream. Valid values: 0 to 999999999999999. Default value: 100. A value of 0 specifies that the number of entries on each node is not limited.</ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[0-100000]</CheckingCode>
                  <ParameterValue>0</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>timeout</ParameterName>
                  <ParameterDescription>Close the connection after a client is idle for N seconds (0 to disable)</ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[0-999999999999999]</CheckingCode>
                  <ParameterValue>128</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>zset-max-ziplist-entries</ParameterName>
                  <ParameterDescription>Similarly to hashes and lists, sorted sets are also specially encoded in order to save a lot of space. </ParameterDescription>
            </TemplateRecord>
            <TemplateRecord>
                  <ForceModify>1</ForceModify>
                  <CheckingCode>[0-999999999999999]</CheckingCode>
                  <ParameterValue>64</ParameterValue>
                  <ForceRestart>false</ForceRestart>
                  <ParameterName>zset-max-ziplist-value</ParameterName>
                  <ParameterDescription>Similarly to hashes and lists, sorted sets are also specially encoded in order to save a lot of space. </ParameterDescription>
            </TemplateRecord>
      </Parameters>
      <RequestId>9DA28D8E-514D-4F12-ADED-70A9C818F0A0</RequestId>
      <Engine>redis</Engine>
</DescribeParameterTemplatesResponse>

JSON format

{
    "ParameterCount": "24",
    "EngineVersion": "5.0",
    "Parameters": {
        "TemplateRecord": [
            {
                "ForceModify": 1,
                "CheckingCode": "[yes|no]",
                "ParameterValue": "no",
                "ForceRestart": false,
                "ParameterName": "#no_loose_check-whitelist-always",
                "ParameterDescription": "check whitelist always"
            },
            {
                "ForceModify": 1,
                "CheckingCode": ". *",
                "ParameterValue": "",
                "ForceRestart": false,
                "ParameterName": "#no_loose_disabled-commands",
                "ParameterDescription": "You can disable some dangerous commands, for example \"keys,flushdb,flushall\", the commands must be in [flushall,flushdb,keys,hgetall,eval,evalsha,script]."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[yes|no]",
                "ParameterValue": "no",
                "ForceRestart": false,
                "ParameterName": "#no_loose_sentinel-enabled",
                "ParameterDescription": "Be compatible with sentinel mode."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[yes|no]",
                "ParameterValue": "yes",
                "ForceRestart": false,
                "ParameterName": "appendonly",
                "ParameterDescription": "Enable AOF persistence."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "\\d+\\s+\\d+\\s+\\d+",
                "ParameterValue": "33554432 8388608 60",
                "ForceRestart": false,
                "ParameterName": "client-output-buffer-limit pubsub",
                "ParameterDescription": "The output buffer limits of publisher and subscriber clients."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[yes|no]",
                "ParameterValue": "yes",
                "ForceRestart": false,
                "ParameterName": "dynamic-hz",
                "ParameterDescription": "Whether to enable a dynamic hz value."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[0-999999999999999]",
                "ParameterValue": "512",
                "ForceRestart": false,
                "ParameterName": "hash-max-ziplist-entries",
                "ParameterDescription": "If hash fields are less than this value and hash value sizes are less than hash-max-ziplist-value, the ziplist will be used."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[0-999999999999999]",
                "ParameterValue": "64",
                "ForceRestart": false,
                "ParameterName": "hash-max-ziplist-value",
                "ParameterDescription": "If hash value sizes are than less this value and hash fields are less than hash-max-ziplist-entries, the ziplist will be used."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[1-500]",
                "ParameterValue": "10",
                "ForceRestart": false,
                "ParameterName": "hz",
                "ParameterDescription": "The frequency at which Redis background tasks are performed, for example, tasks to evict expired keys. Valid values: 1 to 500. The default value is 10, which specifies that each task is performed 10 times per second. A higher value results in higher CPU consumption but allows the system to delete expired keys and terminate time-out connections more frequently. We recommend that you specify a value less than or equal to 100."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[yes|no]",
                "ParameterValue": "no",
                "ForceRestart": false,
                "ParameterName": "lazyfree-lazy-eviction",
                "ParameterDescription": "lazyfree switch on eviction."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[yes|no]",
                "ParameterValue": "yes",
                "ForceRestart": false,
                "ParameterName": "lazyfree-lazy-expire",
                "ParameterDescription": "lazyfree switch on expire."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[yes|no]",
                "ParameterValue": "yes",
                "ForceRestart": false,
                "ParameterName": "lazyfree-lazy-server-del",
                "ParameterDescription": "lazyfree switch on server implicit deletion."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[0-65535]",
                "ParameterValue": "0",
                "ForceRestart": false,
                "ParameterName": "list-compress-depth",
                "ParameterDescription": "The number of entries on the list that are not compressed at both ends."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[-5-99999999]",
                "ParameterValue": "-2",
                "ForceRestart": false,
                "ParameterName": "list-max-ziplist-size",
                "ParameterDescription": "Threadhold of ziplist size on quicklist."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[volatile-lru|allkeys-lru|volatile-random|allkeys-random|volatile-ttl|volatile-lfu|allkeys-lfu|noeviction]",
                "ParameterValue": "volatile-lru",
                "ForceRestart": false,
                "ParameterName": "maxmemory-policy",
                "ParameterDescription": "To config how Redis will select what to remove when maxmemory is reached. There are eight behaviors that can be chose : volatile-lru,allkeys-lru,volatile-lfu,allkeys-lfu,volatile-random,allkeys-random,volatile-ttl,noeviction"
            },
            {
                "ForceModify": 1,
                "CheckingCode": ". *",
                "ParameterValue": "",
                "ForceRestart": false,
                "ParameterName": "notify-keyspace-events",
                "ParameterDescription": "keyspace-event notification feature."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[0-999999999999999]",
                "ParameterValue": "512",
                "ForceRestart": false,
                "ParameterName": "set-max-intset-entries",
                "ParameterDescription": "Sets have a special encoding in just one case: when a set is composed of just strings that happen to be integers in radix 10 in the range of 64 bit signed integers. The following configuration setting sets the limit in the size of the set in order to use this special memory saving encoding."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[10000-10000000]",
                "ParameterValue": "20000",
                "ForceRestart": false,
                "ParameterName": "slowlog-log-slower-than",
                "ParameterDescription": "The time is expressed in microseconds, so 1000000 is equivalent to one second. The default setting for this is 20000 (20ms) and the lower bound of this setting is 10000 (10ms).  "
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[100-10000]",
                "ParameterValue": "1024",
                "ForceRestart": false,
                "ParameterName": "slowlog-max-len",
                "ParameterDescription": "The max slowlog count."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[0-999999999999999]",
                "ParameterValue": "4096",
                "ForceRestart": false,
                "ParameterName": "stream-node-max-bytes",
                "ParameterDescription": "The maximum amount of memory in bytes that each macro node in a stream can consume. Valid values: 0 to 999999999999999. Default value: 4096. Unit: bytes. A value of 0 specifies that the amount of consumed memory is not limited."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[0-999999999999999]",
                "ParameterValue": "100",
                "ForceRestart": false,
                "ParameterName": "stream-node-max-entries",
                "ParameterDescription": "The maximum number of entries stored on each macro node in a stream. Valid values: 0 to 999999999999999. Default value: 100. A value of 0 specifies that the number of entries on each node is not limited."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[0-100000]",
                "ParameterValue": "0",
                "ForceRestart": false,
                "ParameterName": "timeout",
                "ParameterDescription": "Close the connection after a client is idle for N seconds (0 to disable)"
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[0-999999999999999]",
                "ParameterValue": "128",
                "ForceRestart": false,
                "ParameterName": "zset-max-ziplist-entries",
                "ParameterDescription": "Similarly to hashes and lists, sorted sets are also specially encoded in order to save a lot of space."
            },
            {
                "ForceModify": 1,
                "CheckingCode": "[0-999999999999999]",
                "ParameterValue": "64",
                "ForceRestart": false,
                "ParameterName": "zset-max-ziplist-value",
                "ParameterDescription": "Similarly to hashes and lists, sorted sets are also specially encoded in order to save a lot of space."
            }
        ]
    },
    "RequestId": "9DA28D8E-514D-4F12-ADED-70A9C818F0A0",
    "Engine": "redis"
}

Error codes

HttpCode Error code Error message Description
400 InvalidParameters.Format Specified parameters is not valid. The error message returned because the specified parameters are invalid.

For a list of error codes, visit the API Error Center.