本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
檢視 Storage Lens 群組詳細資訊
下列範例示範如何檢視 Amazon S3 Storage Lens 群組組態詳細資訊。您可以使用 Amazon S3 主控台、 AWS Command Line Interface (AWS CLI) 和 來檢視這些詳細資訊 AWS SDK for Java。
檢視 Storage Lens 群組組態詳細資訊
登入 AWS Management Console ,並在 https://console.aws.amazon.com/s3/
:// 開啟 Amazon S3 主控台。 -
在左側導覽窗格中,選擇 Storage Lens 群組。
-
在 Storage Lens 群組底下,選擇您感興趣的 Storage Lens 群組旁的選項按鈕。
-
請選擇檢視詳細資料。您現在可以檢閱 Storage Lens 群組的詳細資訊。
下列 AWS CLI 範例會傳回 Storage Lens 群組的組態詳細資訊。若要使用此範例命令,請以您自己的資訊取代
。user input
placeholders
aws s3control get-storage-lens-group --account-id
111122223333
\ --regionus-east-1
--namemarketing-department
下列 AWS SDK for Java 範例會傳回帳戶
中名為 之 Storage Lens 群組的組態詳細資訊Marketing-Department
。若要使用此範例,請以您自己的資訊取代 111122223333
。user input placeholders
package aws.example.s3control; import com.amazonaws.AmazonServiceException; import com.amazonaws.SdkClientException; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3control.S3ControlClient; import software.amazon.awssdk.services.s3control.model.GetStorageLensGroupRequest; import software.amazon.awssdk.services.s3control.model.GetStorageLensGroupResponse; public class GetStorageLensGroup { public static void main(String[] args) { String storageLensGroupName = "
Marketing-Department
"; String accountId = "111122223333
"; try { GetStorageLensGroupRequest getRequest = GetStorageLensGroupRequest.builder() .name(storageLensGroupName
) .accountId(accountId
).build(); S3ControlClient s3ControlClient = S3ControlClient.builder() .region(Region.US_WEST_2
) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); GetStorageLensGroupResponse response = s3ControlClient.getStorageLensGroup(getRequest); System.out.println(response); } 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(); } } }