

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

# UpdateCluster
<a name="API_elastic_UpdateCluster"></a>

修改一个弹性集群。这包括更新管理员用户名/密码、升级 API 版本，以及设置备份时段和维护时段

## 请求语法
<a name="API_elastic_UpdateCluster_RequestSyntax"></a>

```
PUT /cluster/clusterArn HTTP/1.1
Content-type: application/json

{
   "adminUserPassword": "string",
   "authType": "string",
   "backupRetentionPeriod": number,
   "clientToken": "string",
   "preferredBackupWindow": "string",
   "preferredMaintenanceWindow": "string",
   "shardCapacity": number,
   "shardCount": number,
   "shardInstanceCount": number,
   "subnetIds": [ "string" ],
   "vpcSecurityGroupIds": [ "string" ]
}
```

## URI 请求参数
<a name="API_elastic_UpdateCluster_RequestParameters"></a>

请求使用以下 URI 参数。

 ** [clusterArn](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-uri-clusterArn"></a>
弹性集群的 ARN 标识符。  
是否必需：是

## 请求体
<a name="API_elastic_UpdateCluster_RequestBody"></a>

请求接受采用 JSON 格式的以下数据。

 ** [adminUserPassword](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-adminUserPassword"></a>
与弹性集群管理员关联的密码。此密码可以包含除正斜杠 (/)、双引号 (") 或 @ 符号之外的任何可打印的 ASCII 字符。  
 *约束*：必须包含 8 到 100 个字符。  
类型：字符串  
必需：否

 ** [authType](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-authType"></a>
用于确定从何处获取用于访问弹性集群的密码的身份验证类型。有效的类型为 `PLAIN_TEXT` 或 `SECRET_ARN`。  
类型：字符串  
有效值：`PLAIN_TEXT | SECRET_ARN`  
必需：否

 ** [backupRetentionPeriod](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-backupRetentionPeriod"></a>
自动快照的保留天数。  
类型：整数  
必需：否

 ** [clientToken](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-clientToken"></a>
弹性集群的客户端令牌。  
类型：字符串  
必需：否

 ** [preferredBackupWindow](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-preferredBackupWindow"></a>
在启用自动备份的情况下每日执行自动备份的时间范围，如 `backupRetentionPeriod` 所规定。  
类型：字符串  
必需：否

 ** [preferredMaintenanceWindow](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-preferredMaintenanceWindow"></a>
可进行系统维护的每周时间范围（采用通用协调时间（UTC））。  
 *Format*: `ddd:hh24:mi-ddd:hh24:mi`   
 *默认*：从每个 8 小时的时间段中随机选择一个 30 分钟的窗口 AWS 区域，发生在一周中的随机某一天。  
 *有效日*：Mon、Tue、Wed、Thu、Fri、Sat、Sun  
 *约束*：至少为 30 分钟的时段。  
类型：字符串  
必需：否

 ** [shardCapacity](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-shardCapacity"></a>
CPUs 分配给每个弹性集群分片的 v 数。最大值为 64。允许值为 2、4、8、16、32、64。  
类型：整数  
必需：否

 ** [shardCount](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-shardCount"></a>
分配给弹性集群的分片数目。最大值为 32。  
类型：整数  
必需：否

 ** [shardInstanceCount](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-shardInstanceCount"></a>
适用于弹性集群中所有分片的副本实例的数量。`shardInstanceCount` 值为 1 表示有一个写入器实例，其他任何实例都是可用于读取和提高可用性的副本。  
类型：整数  
必需：否

 ** [subnetIds](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-subnetIds"></a>
弹性集群的 Amazon EC2 子网 IDs 。  
类型：字符串数组  
必需：否

 ** [vpcSecurityGroupIds](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-vpcSecurityGroupIds"></a>
要与弹性集群关联的 EC2 VPC 安全组的列表。  
类型：字符串数组  
必需：否

## 响应语法
<a name="API_elastic_UpdateCluster_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "cluster": { 
      "adminUserName": "string",
      "authType": "string",
      "backupRetentionPeriod": number,
      "clusterArn": "string",
      "clusterEndpoint": "string",
      "clusterName": "string",
      "createTime": "string",
      "kmsKeyId": "string",
      "preferredBackupWindow": "string",
      "preferredMaintenanceWindow": "string",
      "shardCapacity": number,
      "shardCount": number,
      "shardInstanceCount": number,
      "shards": [ 
         { 
            "createTime": "string",
            "shardId": "string",
            "status": "string"
         }
      ],
      "status": "string",
      "subnetIds": [ "string" ],
      "vpcSecurityGroupIds": [ "string" ]
   }
}
```

## 响应元素
<a name="API_elastic_UpdateCluster_ResponseElements"></a>

如果此操作成功，则该服务将会发送回 HTTP 200 响应。

服务以 JSON 格式返回以下数据。

 ** [cluster](#API_elastic_UpdateCluster_ResponseSyntax) **   <a name="documentdb-elastic_UpdateCluster-response-cluster"></a>
返回有关已更新弹性集群的信息。  
类型：[Cluster](API_elastic_Cluster.md) 对象

## 错误
<a name="API_elastic_UpdateCluster_Errors"></a>

有关所有操作的常见错误的信息，请参阅[常见错误](CommonErrors.md)。

 ** AccessDeniedException **   
没有足够权限执行某操作时出现的异常。    
 ** message **   
一条解释访问被拒绝原因的错误消息。
HTTP 状态代码：403

 ** ConflictException **   
存在访问冲突。    
 ** resourceId **   
存在访问冲突的资源的 ID。  
 ** resourceType **   
存在访问冲突的资源的类型。
HTTP 状态代码：409

 ** InternalServerException **   
出现内部服务器错误。  
HTTP 状态代码：500

 ** ResourceNotFoundException **   
不能定位指定的资源。    
 ** message **   
一条描述失败的错误消息。  
 ** resourceId **   
找不到的资源的 ID。  
 ** resourceType **   
找不到的资源的类型。
HTTP 状态代码：404

 ** ThrottlingException **   
ThrottlingException 当由于请求限制而导致请求被拒绝时，将抛出。    
 ** retryAfterSeconds **   
重试操作之前等待的秒数。
HTTP 状态代码：429

 ** ValidationException **   
定义验证异常的结构。    
 ** fieldList **   
发生验证异常的字段列表。  
 ** message **   
一条描述验证异常的错误消息。  
 ** reason **   
发生验证异常的原因（`unknownOperation`、`cannotParse`、`fieldValidationFailed` 或 `other` 之一）。
HTTP 状态代码：400

## 另请参阅
<a name="API_elastic_UpdateCluster_SeeAlso"></a>

有关以特定语言之一使用此 API 的更多信息 AWS SDKs，请参阅以下内容：
+  [AWS 命令行界面 V2](https://docs.aws.amazon.com/goto/cli2/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS 适用于.NET 的 SDK V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS 适用于 C\$1\$1 的 SDK](https://docs.aws.amazon.com/goto/SdkForCpp/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS 适用于 Go v2 的 SDK](https://docs.aws.amazon.com/goto/SdkForGoV2/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS 适用于 Java 的 SDK V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS JavaScript V3 版软件开发工具包](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS 适用于 Kotlin 的 SDK](https://docs.aws.amazon.com/goto/SdkForKotlin/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS 适用于 PHP 的 SDK V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS Python 软件开发工具包](https://docs.aws.amazon.com/goto/boto3/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS 适用于 Ruby V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForRubyV3/docdb-elastic-2022-11-28/UpdateCluster) 