

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 按名称列出 ElastiCache 参数组
<a name="ParameterGroups.ListingGroups"></a>

您可以使用 ElastiCache 控制台、AWS CLI 或 ElastiCache API 列出参数组。

## 按名称列出参数组（控制台）
<a name="ParameterGroups.ListingGroups.CON"></a>

以下过程介绍了如何使用 ElastiCache 控制台查看参数组列表。

**使用 ElastiCache 控制台列出参数组**

1. 登录 AWS 管理控制台 并打开 ElastiCache 控制台 ([https://console.aws.amazon.com/elasticache/](https://console.aws.amazon.com/elasticache/))。

1. 要查看所有可用的参数组列表，请在导航窗格左侧选择**Parameter Groups**。

## 按名称列出 ElastiCache 参数组（AWS CLI）
<a name="ParameterGroups.ListingGroups.CLI"></a>

要使用 AWS CLI 生成参数组的列表，请使用命令 `describe-cache-parameter-groups`。如果提供了参数组的名称，将只会列出该参数组。如果未提供参数组的名称，将列出最多 `--max-records` 个参数组。在任一情况下，都会列出参数组的名称、系列和描述。

**Example**  
以下示例代码列出了参数组 *myMem14*。  
对于 Linux、macOS 或 Unix：  

```
aws elasticache describe-cache-parameter-groups \
    --cache-parameter-group-name myMem14
```
对于 Windows：  

```
aws elasticache describe-cache-parameter-groups ^
    --cache-parameter-group-name myMem14
```
该命令的输出内容将类似如下所示，列出参数组的名称、系列和描述。  

```
{
    "CacheParameterGroups": [
	    {
	        "CacheParameterGroupName": "myMem14", 
	        "CacheParameterGroupFamily": "memcached1.4", 
	        "Description": "My first parameter group"
	    }
    ]
}
```

**Example**  
以下示例代码列出了参数组 *myRed28*。  
对于 Linux、macOS 或 Unix：  

```
aws elasticache describe-cache-parameter-groups \
    --cache-parameter-group-name myRed28
```
对于 Windows：  

```
aws elasticache describe-cache-parameter-groups ^
    --cache-parameter-group-name myRed28
```
该命令的输出内容将类似如下所示，列出参数组的名称、系列和描述。  

```
{
    "CacheParameterGroups": [
	    {
	        "CacheParameterGroupName": "myRed28", 
	        "CacheParameterGroupFamily": "redis2.8", 
	        "Description": "My first parameter group"
	    }
    ]
}
```

**Example**  
以下示例代码列出了在 Redis OSS 引擎 5.0.6 和更高版本上运行的参数组 *myRed56*。如果参数组是 [使用全球数据存储跨AWS区域复制](Redis-Global-Datastore.md) 的一部分，则在输出中返回的 `IsGlobal` 属性值将为 `Yes`。  
对于 Linux、macOS 或 Unix：  

```
aws elasticache describe-cache-parameter-groups \
    --cache-parameter-group-name myRed56
```
对于 Windows：  

```
aws elasticache describe-cache-parameter-groups ^
    --cache-parameter-group-name myRed56
```
该命令的输出内容将类似如下所示，列出参数组的名称、系列和描述，以及是否属于全局数据存储。  

```
{
    "CacheParameterGroups": [
	    {
	        "CacheParameterGroupName": "myRed56", 
	        "CacheParameterGroupFamily": "redis5.0", 	        
	        "Description": "My first parameter group",
	        "IsGlobal": "yes"	        
	    }
    ]
}
```

**Example**  
以下示例代码列出最多 10 个参数组。  

```
aws elasticache describe-cache-parameter-groups --max-records 10
```
该命令的 JSON 输出将类似如下所示，列出每个参数组的名称、系列和描述，如果是 redis5.6，还会列出该参数组是否属于全局数据存储 (isGlobal)。  

```
{
    "CacheParameterGroups": [
        {
            "CacheParameterGroupName": "custom-redis32", 
            "CacheParameterGroupFamily": "redis3.2", 
            "Description": "custom parameter group with reserved-memory > 0"
        }, 
        {
            "CacheParameterGroupName": "default.memcached1.4", 
            "CacheParameterGroupFamily": "memcached1.4", 
            "Description": "Default parameter group for memcached1.4"
        }, 
        {
            "CacheParameterGroupName": "default.redis2.6", 
            "CacheParameterGroupFamily": "redis2.6", 
            "Description": "Default parameter group for redis2.6"
        }, 
        {
            "CacheParameterGroupName": "default.redis2.8", 
            "CacheParameterGroupFamily": "redis2.8", 
            "Description": "Default parameter group for redis2.8"
        }, 
        {
            "CacheParameterGroupName": "default.redis3.2", 
            "CacheParameterGroupFamily": "redis3.2", 
            "Description": "Default parameter group for redis3.2"
        }, 
        {
            "CacheParameterGroupName": "default.redis3.2.cluster.on", 
            "CacheParameterGroupFamily": "redis3.2", 
            "Description": "Customized default parameter group for redis3.2 with cluster mode on"
        },
        {
            "CacheParameterGroupName": "default.redis5.6.cluster.on", 
            "CacheParameterGroupFamily": "redis5.0", 
            "Description": "Customized default parameter group for redis5.6 with cluster mode on",
            "isGlobal": "yes"
        },
    ]
}
```

有关更多信息，请参阅 [https://docs.aws.amazon.com/cli/latest/reference/elasticache/describe-cache-parameter-groups.html](https://docs.aws.amazon.com/cli/latest/reference/elasticache/describe-cache-parameter-groups.html)。

## 按名称列出 ElastiCache 参数组（ElastiCache API）
<a name="ParameterGroups.ListingGroups.API"></a>

要使用 ElastiCache API 生成参数组的列表，请使用 `DescribeCacheParameterGroups` 操作。如果提供了参数组的名称，将只会列出该参数组。如果未提供参数组的名称，将列出最多 `MaxRecords` 个参数组。在任一情况下，都会列出参数组的名称、系列和描述。

**Example**  
以下示例代码列出了参数组 *myMem14*。  

```
https://elasticache.us-west-2.amazonaws.com/
   ?Action=DescribeCacheParameterGroups
   &CacheParameterGroupName=myMem14
   &SignatureVersion=4
   &SignatureMethod=HmacSHA256
   &Timestamp=20150202T192317Z
   &Version=2015-02-02
   &X-Amz-Credential=<credential>
```
来自此操作的响应应类似如下所示，列出每个参数组的名称、系列和描述。  

```
<DescribeCacheParameterGroupsResponse xmlns="http://elasticache.amazonaws.com/doc/2013-06-15/">
  <DescribeCacheParameterGroupsResult>
    <CacheParameterGroups>
      <CacheParameterGroup>
        <CacheParameterGroupName>myMem14</CacheParameterGroupName>
        <CacheParameterGroupFamily>memcached1.4</CacheParameterGroupFamily>
        <Description>My custom Memcached 1.4 parameter group</Description>
      </CacheParameterGroup>
    </CacheParameterGroups>
  </DescribeCacheParameterGroupsResult>
  <ResponseMetadata>
    <RequestId>3540cc3d-af48-11e0-97f9-279771c4477e</RequestId>
  </ResponseMetadata>
</DescribeCacheParameterGroupsResponse>
```

**Example**  
以下示例代码列出最多 10 个参数组。  

```
https://elasticache.us-west-2.amazonaws.com/
   ?Action=DescribeCacheParameterGroups
   &MaxRecords=10
   &SignatureVersion=4
   &SignatureMethod=HmacSHA256
   &Timestamp=20150202T192317Z
   &Version=2015-02-02
   &X-Amz-Credential=<credential>
```
此操作所得到的响应将类似如下所示，列出每个参数组的名称、系列和描述，如果是 redis5.6，还会列出该参数组是否属于全局数据存储 (isGlobal)。  

```
<DescribeCacheParameterGroupsResponse xmlns="http://elasticache.amazonaws.com/doc/2013-06-15/">
  <DescribeCacheParameterGroupsResult>
    <CacheParameterGroups>
      <CacheParameterGroup>
        <CacheParameterGroupName>myRedis28</CacheParameterGroupName>
        <CacheParameterGroupFamily>redis2.8</CacheParameterGroupFamily>
        <Description>My custom Redis 2.8 parameter group</Description>
      </CacheParameterGroup>
      <CacheParameterGroup>
        <CacheParameterGroupName>myMem14</CacheParameterGroupName>
        <CacheParameterGroupFamily>memcached1.4</CacheParameterGroupFamily>
        <Description>My custom Memcached 1.4 parameter group</Description>
      </CacheParameterGroup>
       <CacheParameterGroup>
        <CacheParameterGroupName>myRedis56</CacheParameterGroupName>
        <CacheParameterGroupFamily>redis5.0</CacheParameterGroupFamily>
        <Description>My custom redis 5.6 parameter group</Description>
        <isGlobal>yes</isGlobal>
      </CacheParameterGroup>
    </CacheParameterGroups>
  </DescribeCacheParameterGroupsResult>
  <ResponseMetadata>
    <RequestId>3540cc3d-af48-11e0-97f9-279771c4477e</RequestId>
  </ResponseMetadata>
</DescribeCacheParameterGroupsResponse>
```

**Example**  
以下示例代码列出了参数组 *myRed28*。  

```
https://elasticache.us-west-2.amazonaws.com/
   ?Action=DescribeCacheParameterGroups
   &CacheParameterGroupName=myRed28
   &SignatureVersion=4
   &SignatureMethod=HmacSHA256
   &Timestamp=20150202T192317Z
   &Version=2015-02-02
   &X-Amz-Credential=<credential>
```
来自此操作的响应将类似如下所示，列出名称、系列和描述。  

```
<DescribeCacheParameterGroupsResponse xmlns="http://elasticache.amazonaws.com/doc/2013-06-15/">
  <DescribeCacheParameterGroupsResult>
    <CacheParameterGroups>
      <CacheParameterGroup>
        <CacheParameterGroupName>myRed28</CacheParameterGroupName>
        <CacheParameterGroupFamily>redis2.8</CacheParameterGroupFamily>
        <Description>My custom Redis 2.8 parameter group</Description>
      </CacheParameterGroup>
    </CacheParameterGroups>
  </DescribeCacheParameterGroupsResult>
  <ResponseMetadata>
    <RequestId>3540cc3d-af48-11e0-97f9-279771c4477e</RequestId>
  </ResponseMetadata>
</DescribeCacheParameterGroupsResponse>
```

**Example**  
以下示例代码列出了参数组 *myRed56*。  

```
https://elasticache.us-west-2.amazonaws.com/
   ?Action=DescribeCacheParameterGroups
   &CacheParameterGroupName=myRed56
   &SignatureVersion=4
   &SignatureMethod=HmacSHA256
   &Timestamp=20150202T192317Z
   &Version=2015-02-02
   &X-Amz-Credential=<credential>
```
此操作所得到的响应将类似如下所示，列出名称、系列、描述，以及该参数组是否属于全局数据存储 (isGlobal)。  

```
<DescribeCacheParameterGroupsResponse xmlns="http://elasticache.amazonaws.com/doc/2013-06-15/">
  <DescribeCacheParameterGroupsResult>
    <CacheParameterGroups>
      <CacheParameterGroup>
        <CacheParameterGroupName>myRed56</CacheParameterGroupName>
        <CacheParameterGroupFamily>redis5.0</CacheParameterGroupFamily>
        <Description>My custom Redis 5.6 parameter group</Description>
        <isGlobal>yes</isGlobal>
      </CacheParameterGroup>
    </CacheParameterGroups>
  </DescribeCacheParameterGroupsResult>
  <ResponseMetadata>
    <RequestId>3540cc3d-af48-11e0-97f9-279771c4477e</RequestId>
  </ResponseMetadata>
</DescribeCacheParameterGroupsResponse>
```

有关更多信息，请参阅 [https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_DescribeCacheParameterGroups.html](https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_DescribeCacheParameterGroups.html)。