

# 查看 Storage Lens 组详细信息
<a name="storage-lens-groups-view"></a>

以下示例演示如何查看 Amazon S3 Storage Lens 存储统计管理工具组配置详细信息。您可以使用 Amazon S3 控制台、Amazon Command Line Interface (Amazon CLI) 和 适用于 Java 的 Amazon SDK 查看这些详细信息。

## 使用 S3 控制台
<a name="view-storage-lens-group-console"></a>



**查看 Storage Lens 组配置详细信息**

1. 登录到 Amazon Web Services 管理控制台，然后通过以下网址打开 Amazon S3 控制台：[https://console.aws.amazon.com/s3/](https://console.amazonaws.cn/s3/)。

1. 在左侧导航窗格中，选择 **Storage Lens 组**。

1. 在 **Storage Lens 组**下，选择您感兴趣的 Storage Lens 组旁的选项按钮。

1. 请选择**查看详细信息**。现在，您可以查看 Storage Lens 组的详细信息。

## 使用 Amazon CLI
<a name="view-storage-lens-group-cli"></a>

以下 Amazon CLI 示例将返回 Storage Lens 组的配置详细信息。要使用此示例命令，请将 `{{user input placeholders}}` 替换为您自己的信息。

```
aws s3control get-storage-lens-group --account-id {{111122223333}} \ 
--region {{us-east-1}} --name {{marketing-department}}
```

## 使用适用于 Java 的 Amazon SDK
<a name="view-storage-lens-group-sdk-java"></a>

以下 适用于 Java 的 Amazon SDK 示例将返回账户 `{{111122223333}}` 中名为 `{{Marketing-Department}}` 的 Storage Lens 组的配置详细信息。要使用此示例，请将 `{{user input placeholders}}` 替换为您自己的信息。

```
package aws.example.s3control;

import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3control.S3ControlClient;
import software.amazon.awssdk.services.s3control.model.GetStorageLensGroupRequest;
import software.amazon.awssdk.services.s3control.model.GetStorageLensGroupResponse;

public class GetStorageLensGroup {
    public static void main(String[] args) {
        String storageLensGroupName = "{{Marketing-Department}}";
        String accountId = "{{111122223333}}";

        try {
            GetStorageLensGroupRequest getRequest = GetStorageLensGroupRequest.builder()
                    .name({{storageLensGroupName}})
                    .accountId({{accountId}}).build();
            S3ControlClient s3ControlClient = S3ControlClient.builder()
                    .region(Region.{{US_WEST_2}})
                    .credentialsProvider(ProfileCredentialsProvider.create())
                    .build();
            GetStorageLensGroupResponse response = s3ControlClient.getStorageLensGroup(getRequest);
            System.out.println(response);
        } catch (AmazonServiceException e) {
            // The call was transmitted successfully, but Amazon S3 couldn't process
            // it and returned an error response.
            e.printStackTrace();
        } catch (SdkClientException e) {
            // Amazon S3 couldn't be contacted for a response, or the client
            // couldn't parse the response from Amazon S3.
            e.printStackTrace();
        }
    }
}
```