

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

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

修改彈性叢集。這包括更新 admin-username/password、升級 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 字元，但斜線 (/)、雙引號 (") 或 "at" 符號 (@) 則除外。  
 *限制條件*：必須包含 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) 表示。  
 *格式*：`ddd:hh24:mi-ddd:hh24:mi`  
 *預設*：從每個 8 小時的時段中隨機選取的 30 分鐘時段 AWS 區域，發生在一週中的隨機一天。  
 *有效天數*：週一、週二、週三、週四、週五、週六、週日  
 *限制條件*：必須至少是 30 分鐘的時段。  
類型：字串  
必要：否

 ** [shardCapacity](#API_elastic_UpdateCluster_RequestSyntax) **   <a name="documentdb-elastic_UpdateCluster-request-shardCapacity"></a>
指派給每個彈性叢集碎片vCPUs 數目。上限為 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`、`fieldValidationFailed`、 `cannotParse`或 之一`other`)。
HTTP 狀態碼：400

## 另請參閱
<a name="API_elastic_UpdateCluster_SeeAlso"></a>

如需在其中一種語言特定 AWS SDKs中使用此 API 的詳細資訊，請參閱下列內容：
+  [AWS 命令列界面 V2](https://docs.aws.amazon.com/goto/cli2/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS 適用於 .NET V4 的 SDK](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 的 SDK v2](https://docs.aws.amazon.com/goto/SdkForGoV2/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS 適用於 Java V2 的 SDK](https://docs.aws.amazon.com/goto/SdkForJavaV2/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS 適用於 JavaScript V3 的 SDK](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 V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForPHPV3/docdb-elastic-2022-11-28/UpdateCluster) 
+  [AWS 適用於 Python 的 SDK](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) 