列出 Amazon S3 Storage Lens 存储统计管理工具控制面板
列出 S3 Storage Lens 存储统计管理工具控制面板
登录到Amazon Web Services Management Console,然后通过以下网址打开 Amazon S3 控制台:https://console.aws.amazon.com/s3/
。 -
在左侧导航窗格中,导航到 Storage Lens 存储统计管理工具。
-
选择控制面板。现在,您可以在 Amazon Web Services 账户中查看控制面板。
以下示例命令列出了 Amazon Web Services 账户中的 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(); } } }