刪除 Storage Lens 群組 - Amazon Simple Storage Service

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

刪除 Storage Lens 群組

下列範例示範如何使用 Amazon S3 主控台、AWS Command Line Interface (AWS CLI) 和 AWS SDK for Java 刪除 Amazon S3 Storage Lens 群組。

刪除 Storage Lens 群組
  1. 登入 AWS Management Console,並開啟位於 https://console.aws.amazon.com/s3/ 的 Amazon S3 主控台。

  2. 在左側導覽窗格中,選擇 Storage Lens 群組

  3. Storage Lens 群組底下,選擇您要刪除的 Storage Lens 群組旁的按鈕選項。

  4. 選擇 Delete (刪除)。刪除 Storage Lens 群組對話方塊隨即顯示。

  5. 再次選擇刪除,可永久刪除 Storage Lens 群組。

    注意

    Storage Lens 群組一旦刪除,就無法還原。

下列 AWS CLI 範例會刪除名為 marketing-department 的 Storage Lens 群組。若要使用此範例命令,請以您自己的資訊取代 user input placeholders

aws s3control delete-storage-lens-group --account-id 111122223333 \ --region us-east-1 --name marketing-department

下列 AWS SDK for Java 範例會刪除帳戶 111122223333 中名為 Marketing-Department 的 Storage Lens 群組。若要使用此範例,請以您自己的資訊取代 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.DeleteStorageLensGroupRequest; public class DeleteStorageLensGroup { public static void main(String[] args) { String storageLensGroupName = "Marketing-Department"; String accountId = "111122223333"; try { DeleteStorageLensGroupRequest deleteStorageLensGroupRequest = DeleteStorageLensGroupRequest.builder() .name(storageLensGroupName) .accountId(accountId).build(); S3ControlClient s3ControlClient = S3ControlClient.builder() .region(Region.US_WEST_2) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); s3ControlClient.deleteStorageLensGroup(deleteStorageLensGroupRequest); } 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(); } } }