

如需與 Amazon Timestream for LiveAnalytics 類似的功能，請考慮使用 Amazon Timestream for InfluxDB。它提供簡化的資料擷取和單一位數毫秒查詢回應時間，以進行即時分析。[在這裡](https://docs.aws.amazon.com//timestream/latest/developerguide/timestream-for-influxdb.html)進一步了解。

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

# UpdateTable
<a name="API_UpdateTable"></a>

修改 Timestream 資料表的記憶體存放區和磁性存放區的保留期間。請注意，保留期間的變更會立即生效。例如，如果記憶體存放區的保留期間最初設定為 2 小時，然後變更為 24 小時，則記憶體存放區將能夠保留 24 小時的資料，但在進行此變更的 22 小時後將填入 24 小時的資料。Timestream 不會從磁性存放區擷取資料來填入記憶體存放區。

有關詳細資訊，請參閱[程式碼範例](https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.update-table.html)。

## 請求語法
<a name="API_UpdateTable_RequestSyntax"></a>

```
{
   "DatabaseName": "string",
   "MagneticStoreWriteProperties": { 
      "EnableMagneticStoreWrites": boolean,
      "MagneticStoreRejectedDataLocation": { 
         "S3Configuration": { 
            "BucketName": "string",
            "EncryptionOption": "string",
            "KmsKeyId": "string",
            "ObjectKeyPrefix": "string"
         }
      }
   },
   "RetentionProperties": { 
      "MagneticStoreRetentionPeriodInDays": number,
      "MemoryStoreRetentionPeriodInHours": number
   },
   "Schema": { 
      "CompositePartitionKey": [ 
         { 
            "EnforcementInRecord": "string",
            "Name": "string",
            "Type": "string"
         }
      ]
   },
   "TableName": "string"
}
```

## 請求參數
<a name="API_UpdateTable_RequestParameters"></a>

如需所有動作的一般參數資訊，請參閱《[Common Parameters](CommonParameters.md)》。

請求接受採用 JSON 格式的下列資料。

 ** [DatabaseName](#API_UpdateTable_RequestSyntax) **   <a name="timestream-UpdateTable-request-DatabaseName"></a>
Timestream 資料庫的名稱。  
類型：字串  
長度限制：長度下限為 3。長度上限為 256。  
必要：是

 ** [MagneticStoreWriteProperties](#API_UpdateTable_RequestSyntax) **   <a name="timestream-UpdateTable-request-MagneticStoreWriteProperties"></a>
包含啟用磁性存放區寫入時要在表格上設定的屬性。  
類型：[MagneticStoreWriteProperties](API_MagneticStoreWriteProperties.md) 物件  
必要：否

 ** [RetentionProperties](#API_UpdateTable_RequestSyntax) **   <a name="timestream-UpdateTable-request-RetentionProperties"></a>
記憶體存放區和磁性存放區的保留期間。  
類型：[RetentionProperties](API_RetentionProperties.md) 物件  
必要：否

 ** [Schema](#API_UpdateTable_RequestSyntax) **   <a name="timestream-UpdateTable-request-Schema"></a>
 資料表的結構描述。  
類型：[Schema](API_Schema.md) 物件  
必要：否

 ** [TableName](#API_UpdateTable_RequestSyntax) **   <a name="timestream-UpdateTable-request-TableName"></a>
Timestream 資料表的名稱。  
類型：字串  
長度限制：長度下限為 3。長度上限為 256。  
必要：是

## 回應語法
<a name="API_UpdateTable_ResponseSyntax"></a>

```
{
   "Table": { 
      "Arn": "string",
      "CreationTime": number,
      "DatabaseName": "string",
      "LastUpdatedTime": number,
      "MagneticStoreWriteProperties": { 
         "EnableMagneticStoreWrites": boolean,
         "MagneticStoreRejectedDataLocation": { 
            "S3Configuration": { 
               "BucketName": "string",
               "EncryptionOption": "string",
               "KmsKeyId": "string",
               "ObjectKeyPrefix": "string"
            }
         }
      },
      "RetentionProperties": { 
         "MagneticStoreRetentionPeriodInDays": number,
         "MemoryStoreRetentionPeriodInHours": number
      },
      "Schema": { 
         "CompositePartitionKey": [ 
            { 
               "EnforcementInRecord": "string",
               "Name": "string",
               "Type": "string"
            }
         ]
      },
      "TableName": "string",
      "TableStatus": "string"
   }
}
```

## 回應元素
<a name="API_UpdateTable_ResponseElements"></a>

如果動作成功，則服務傳回 HTTP 200 回應。

服務會傳回下列 JSON 格式的資料。

 ** [Table](#API_UpdateTable_ResponseSyntax) **   <a name="timestream-UpdateTable-response-Table"></a>
更新的 Timestream 資料表。  
類型：[Table](API_Table.md) 物件

## 錯誤
<a name="API_UpdateTable_Errors"></a>

如需所有動作常見錯誤的資訊，請參閱[常見錯誤](CommonErrors.md)。

 ** AccessDeniedException **   
您無權執行此動作。  
HTTP 狀態碼：400

 ** InternalServerException **   
 由於內部伺服器錯誤，Timestream 無法完整處理此請求。  
HTTP 狀態碼：500

 ** InvalidEndpointException **   
請求的端點無效。  
HTTP 狀態碼：400

 ** ResourceNotFoundException **   
操作嘗試存取不存在的資源。資源可能未正確指定，或其狀態可能不是 ACTIVE。  
HTTP 狀態碼：400

 ** ThrottlingException **   
 使用者提出的請求太多，而且超過服務配額。請求受到調節。  
HTTP 狀態碼：400

 ** ValidationException **   
 無效或格式不正確的請求。  
HTTP 狀態碼：400

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

如需在其中一種語言特定 AWS SDKs中使用此 API 的詳細資訊，請參閱下列內容：
+  [AWS 命令列界面 V2](https://docs.aws.amazon.com/goto/cli2/timestream-write-2018-11-01/UpdateTable) 
+  [AWS 適用於 .NET V4 的 SDK](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-write-2018-11-01/UpdateTable) 
+  [AWS 適用於 C\$1\$1 的 SDK](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-write-2018-11-01/UpdateTable) 
+  [AWS 適用於 Go 的 SDK v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-write-2018-11-01/UpdateTable) 
+  [AWS 適用於 Java V2 的 SDK](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-write-2018-11-01/UpdateTable) 
+  [AWS 適用於 JavaScript V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-write-2018-11-01/UpdateTable) 
+  [AWS 適用於 Kotlin 的 SDK](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-write-2018-11-01/UpdateTable) 
+  [AWS 適用於 PHP V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-write-2018-11-01/UpdateTable) 
+  [AWS 適用於 Python 的 SDK](https://docs.aws.amazon.com/goto/boto3/timestream-write-2018-11-01/UpdateTable) 
+  [AWS 適用於 Ruby V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-write-2018-11-01/UpdateTable) 