

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

# PutAccountPreferences
<a name="API_PutAccountPreferences"></a>

使用此操作可設定目前 AWS 區域 區域中的帳戶偏好，以便為新 EFS 檔案系統使用長至 17 個字元 (63 位元) 或短至 8 個字元 (32 位元) 的資源 ID，並掛載目標資源。您所做的任何變更都不會影響所有現有資源 ID。當 EFS 轉移至長資源 ID 時，您可以在加入期間設定 ID 偏好。如需詳細資訊，請參閱[管理 Amazon EFS 資源 ID](https://docs.aws.amazon.com/efs/latest/ug/manage-efs-resource-ids.html)。

**注意**  
從 2021 年 10 月開始，如果您嘗試將帳戶偏好設定為使用簡短的 8 字元格式資源 ID，將會收到錯誤訊息。如果您收到錯誤，且必須為檔案系統和掛載目標資源使用簡短 IDs請聯絡 AWS 支援。

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

```
PUT /2015-02-01/account-preferences HTTP/1.1
Content-type: application/json

{
   "ResourceIdType": "string"
}
```

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

請求不會使用任何 URI 參數。

## 請求主體
<a name="API_PutAccountPreferences_RequestBody"></a>

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

 ** [ResourceIdType](#API_PutAccountPreferences_RequestSyntax) **   <a name="efs-PutAccountPreferences-request-ResourceIdType"></a>
指定要為使用者的 設定的 EFS 資源 ID 偏好設定 AWS 帳戶，以目前 `LONG_ID`(17 個字元） AWS 區域或 `SHORT_ID`(8 個字元） 表示。  
從 2021 年 10 月開始，將帳戶偏好設定為 `SHORT_ID` 時，您將收到錯誤信息。如果您收到錯誤，且必須為檔案系統和掛載目標資源使用簡短 IDs請聯絡 AWS 支援。
類型：字串  
有效值:`LONG_ID | SHORT_ID`   
必要：是

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

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

{
   "ResourceIdPreference": { 
      "ResourceIdType": "string",
      "Resources": [ "string" ]
   }
}
```

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

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

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

 ** [ResourceIdPreference](#API_PutAccountPreferences_ResponseSyntax) **   <a name="efs-PutAccountPreferences-response-ResourceIdPreference"></a>
描述目前 AWS 帳戶中使用者 的資源類型及其 ID 偏好設定 AWS 區域。  
類型：[ResourceIdPreference](API_ResourceIdPreference.md) 物件

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

 ** BadRequest **   
如果請求格式錯誤或包含錯誤，例如無效的參數值或缺少必要參數，則傳回。    
 ** ErrorCode **   
錯誤代碼是一個字串，專門用於識別錯誤狀況。偵測及依類型處理錯誤的程式必須讀取及了解此代碼。  
 ** Message **   
錯誤訊息包含錯誤狀況的一般英文描述，目標對象是人。一般簡單的程式在發生其無法處理的錯誤狀況時，會直接對最終使用者顯示訊息。複雜一些的程式因為錯誤處理更加周密，而且經過適當的國際化，所以很可能會忽略錯誤訊息。
HTTP 狀態碼：400

 ** InternalServerError **   
如果伺服器端發生錯誤，則傳回。    
 ** ErrorCode **   
錯誤代碼是一個字串，專門用於識別錯誤狀況。偵測及依類型處理錯誤的程式必須讀取及了解此代碼。  
 ** Message **   
錯誤訊息包含錯誤狀況的一般英文描述，目標對象是人。一般簡單的程式在發生其無法處理的錯誤狀況時，會直接對最終使用者顯示訊息。複雜一些的程式因為錯誤處理更加周密，而且經過適當的國際化，所以很可能會忽略錯誤訊息。
HTTP 狀態碼：500

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

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