查看 Amazon S3 Storage Lens 存储统计管理工具控制面板配置详细信息
可以从 Amazon S3 控制台、Amazon CLI 和适用于 Java 的 SDK 中查看 Amazon S3 Storage Lens 存储统计管理工具控制面板。
查看 S3 Storage Lens 存储统计管理工具控制面板配置详细信息
登录到Amazon Web Services Management Console,然后通过以下网址打开 Amazon S3 控制台:https://console.aws.amazon.com/s3/
。 -
在左侧导航窗格中,导航到 Storage Lens 存储统计管理工具。
选择控制面板。
-
从控制面板列表中,单击您要查看的控制面板。现在,您可以查看 Storage Lens 存储统计管理工具控制面板的详细信息。
以下示例检索 S3 Storage Lens 存储统计管理工具配置,以便您可以查看配置详细信息。要使用这些示例,请将
替换为您自己的信息。user input placeholders
aws s3control get-storage-lens-configuration --account-id=
222222222222
--config-id=your-configuration-id
--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.GetStorageLensConfigurationRequest; import com.amazonaws.services.s3control.model.GetStorageLensConfigurationResult; import com.amazonaws.services.s3control.model.StorageLensConfiguration; import static com.amazonaws.regions.Regions.
US_WEST_2
; public class GetDashboard { public static void main(String[] args) { String configurationId = "ConfigurationId
"; String sourceAccountId = "111122223333
"; try { AWSS3Control s3ControlClient = AWSS3ControlClient.builder() .withCredentials(new ProfileCredentialsProvider()) .withRegion(US_WEST_2
) .build(); final StorageLensConfiguration configuration = s3ControlClient.getStorageLensConfiguration(new GetStorageLensConfigurationRequest() .withAccountId(sourceAccountId) .withConfigId(configurationId) ).getStorageLensConfiguration(); System.out.println(configuration.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(); } } }