列出 Amazon S3 Storage Lens 存储统计管理工具控制面板 - Amazon Simple Storage Service

列出 Amazon S3 Storage Lens 存储统计管理工具控制面板

列出 S3 Storage Lens 存储统计管理工具控制面板
  1. 登录到 AWS Management Console,然后通过以下网址打开 Amazon S3 控制台:https://console.aws.amazon.com/s3/

  2. 在左侧导航窗格中,导航到 Storage Lens 存储统计管理工具

  3. 选择控制面板。现在,您可以在 AWS 账户中查看控制面板。

以下示例命令列出了 AWS 账户中的 S3 Storage Lens 存储统计管理工具控制面板。要使用这些示例,请将 user input placeholders 替换为您自己的信息。

aws s3control list-storage-lens-configurations --account-id=222222222222 --region=us-east-1 --next-token=abcdefghij1234

以下示例列出了没有下一个令牌的 S3 Storage Lens 存储统计管理工具配置。要使用这些示例,请将 user input placeholders 替换为您自己的信息。

aws s3control list-storage-lens-configurations --account-id=222222222222 --region=us-east-1
例 – 列出 S3 Storage Lens 存储统计管理工具控制面板配置

以下示例显示了如何在适用于 Java 的 SDK 中列出 S3 Storage Lens 存储统计管理工具配置。要使用此示例,请将每个示例描述中的 user input placeholders 替换为 您自己的信息。

package aws.example.s3control; import com.amazonaws.AmazonServiceException; import com.amazonaws.SdkClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.services.s3control.AWSS3Control; import com.amazonaws.services.s3control.AWSS3ControlClient; import com.amazonaws.services.s3control.model.ListStorageLensConfigurationEntry; import com.amazonaws.services.s3control.model.ListStorageLensConfigurationsRequest; import java.util.List; import static com.amazonaws.regions.Regions.US_WEST_2; public class ListDashboard { public static void main(String[] args) { String sourceAccountId = "111122223333"; String nextToken = "nextToken"; try { AWSS3Control s3ControlClient = AWSS3ControlClient.builder() .withCredentials(new ProfileCredentialsProvider()) .withRegion(US_WEST_2) .build(); final List<ListStorageLensConfigurationEntry> configurations = s3ControlClient.listStorageLensConfigurations(new ListStorageLensConfigurationsRequest() .withAccountId(sourceAccountId) .withNextToken(nextToken) ).getStorageLensConfigurationList(); System.out.println(configurations.toString()); } 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(); } } }