檢視 Amazon S3 Storage Lens 儀表板組態詳細資訊 - Amazon Simple Storage Service

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

檢視 Amazon S3 Storage Lens 儀表板組態詳細資訊

您可以從 Amazon S3 主控台 AWS CLI和適用於 Java 的 SDK 檢視 Amazon S3 Storage Lens 儀表板。

檢視 S3 Storage Lens 儀表板組態詳細資訊
  1. 登入 AWS Management Console ,並在 https://console.aws.amazon.com/s3/:// 開啟 Amazon S3 主控台。

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

  3. 選擇儀表板

  4. 儀表板清單選擇您要檢視的儀表板。您現在可以檢視 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(); } } }