View a markdown version of this page

Gunakan DeleteBucketTaggingdengan CLI - AWS Contoh Kode SDK

Ada lebih banyak contoh AWS SDK yang tersedia di repo Contoh SDK AWS Doc. GitHub

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Gunakan DeleteBucketTaggingdengan CLI

Contoh kode berikut menunjukkan cara menggunakanDeleteBucketTagging.

CLI
AWS CLI

Perintah berikut menghapus konfigurasi penandaan dari bucket bernama: amzn-s3-demo-bucket

aws s3api delete-bucket-tagging --bucket amzn-s3-demo-bucket
PowerShell
Alat untuk PowerShell V4

Contoh 1: Perintah ini menghapus semua tag yang terkait dengan bucket S3 yang diberikan.

Remove-S3BucketTagging -BucketName 'amzn-s3-demo-bucket'

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-S3BucketTagging (DeleteBucketTagging)" on target "amzn-s3-demo-bucket". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
  • Untuk detail API, lihat DeleteBucketTaggingdi Referensi AWS Tools for PowerShell Cmdlet (V4).

Alat untuk PowerShell V5

Contoh 1: Perintah ini menghapus semua tag yang terkait dengan bucket S3 yang diberikan.

Remove-S3BucketTagging -BucketName 'amzn-s3-demo-bucket'

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-S3BucketTagging (DeleteBucketTagging)" on target "amzn-s3-demo-bucket". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
  • Untuk detail API, lihat DeleteBucketTaggingdi Referensi AWS Tools for PowerShell Cmdlet (V5).