列出 Amazon S3 Storage Lens 儀表板 - Amazon Simple Storage Service

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

列出 Amazon S3 Storage Lens 儀表板

列出 S3 Storage Lens 儀表板
  1. 登入 AWS Management Console 並開啟位於 https://https://console.aws.amazon.com/s3/ 的 Amazon S3 主控台。

  2. 在左側導覽窗格中,導覽至 Storage Lens

  3. 選擇儀表板。您現在可以在 中檢視儀表板 AWS 帳戶。

下列範例命令會列出 中的 S3 Storage Lens 儀表板 AWS 帳戶。若要使用這些範例,請以您自己的資訊取代 user input placeholders

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

下列範例會列出不含下一個權杖的 Amazon 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(); } } }