

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

# DescribeLedger
<a name="API_DescribeLedger"></a>

返回有关分类账的信息，包括分类账状态、权限模式、静态加密设置以及创建时间。

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

```
GET /ledgers/name HTTP/1.1
```

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

请求使用以下 URI 参数。

 ** [name](#API_DescribeLedger_RequestSyntax) **   <a name="qldb-DescribeLedger-request-uri-Name"></a>
您要描述的分类帐的名称。  
长度限制：长度下限为 1。最大长度为 32。  
模式：`(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$`  
必需：是

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

该请求没有请求正文。

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

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

{
   "Arn": "string",
   "CreationDateTime": number,
   "DeletionProtection": boolean,
   "EncryptionDescription": { 
      "EncryptionStatus": "string",
      "InaccessibleKmsKeyDateTime": number,
      "KmsKeyArn": "string"
   },
   "Name": "string",
   "PermissionsMode": "string",
   "State": "string"
}
```

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

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

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

 ** [Arn](#API_DescribeLedger_ResponseSyntax) **   <a name="qldb-DescribeLedger-response-Arn"></a>
分类账的 Amazon 资源名称（ARN）。  
类型：字符串  
长度约束：最小长度为 20。长度上限为 1600。

 ** [CreationDateTime](#API_DescribeLedger_ResponseSyntax) **   <a name="qldb-DescribeLedger-response-CreationDateTime"></a>
创建分类账时，日期和时间采用世界标准纪元时间格式）。（纪元时间格式为自 1970 年 1 月 1 日午夜 12:00:00 UTC 以来的秒数。）  
类型：时间戳

 ** [DeletionProtection](#API_DescribeLedger_ResponseSyntax) **   <a name="qldb-DescribeLedger-response-DeletionProtection"></a>
指定是否保护分类账不被任何用户删除。如果创建分类账期间未定义，则默认情况下启用该功能（`true`）。  
如果启用了删除保护，您必须先禁用它，然后才能删除分类账。您可以通过调用 `UpdateLedger` 操作将此参数设置为 `false` 来禁用该功能。  
类型：布尔值

 ** [EncryptionDescription](#API_DescribeLedger_ResponseSyntax) **   <a name="qldb-DescribeLedger-response-EncryptionDescription"></a>
有关分类账中静态数据加密的信息。这包括当前状态、 AWS KMS 密钥以及何时无法访问密钥（如果出现错误）。如果未定义此参数，则账本使用 AWS 拥有的 KMS 密钥进行加密。  
类型：[LedgerEncryptionDescription](API_LedgerEncryptionDescription.md) 对象

 ** [Name](#API_DescribeLedger_ResponseSyntax) **   <a name="qldb-DescribeLedger-response-Name"></a>
分类账的名称。  
类型：字符串  
长度限制：长度下限为 1。最大长度为 32。  
模式：`(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$`

 ** [PermissionsMode](#API_DescribeLedger_ResponseSyntax) **   <a name="qldb-DescribeLedger-response-PermissionsMode"></a>
分类账的权限模式。  
类型：字符串  
有效值：`ALLOW_ALL | STANDARD`

 ** [State](#API_DescribeLedger_ResponseSyntax) **   <a name="qldb-DescribeLedger-response-State"></a>
分类账的当前状态。  
类型：字符串  
有效值：`CREATING | ACTIVE | DELETING | DELETED`

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

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

 ** InvalidParameterException **   
请求中的一项或多项参数无效。  
HTTP 状态代码：400

 ** ResourceNotFoundException **   
指定的资源不存在。  
HTTP 状态代码：404

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

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