Ada lebih banyak contoh AWS SDK yang tersedia di repo Contoh SDK AWS Doc
Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Gunakan GetBucketNotification dengan CLI
Contoh kode berikut menunjukkan cara menggunakanGetBucketNotification.
- CLI
-
- AWS CLI
-
Perintah berikut mengambil konfigurasi notifikasi untuk bucket bernama
amzn-s3-demo-bucket:aws s3api get-bucket-notification --bucketamzn-s3-demo-bucketOutput:
{ "TopicConfiguration": { "Topic": "arn:aws:sns:us-west-2:123456789012:my-notification-topic", "Id": "YmQzMmEwM2EjZWVlI0NGItNzVtZjI1MC00ZjgyLWZDBiZWNl", "Event": "s3:ObjectCreated:*", "Events": [ "s3:ObjectCreated:*" ] } }-
Untuk detail API, lihat GetBucketNotification
di Referensi AWS CLI Perintah.
-
- PowerShell
-
- Alat untuk PowerShell V4
-
Contoh 1: Contoh ini mengambil konfigurasi notifikasi dari bucket yang diberikan
Get-S3BucketNotification -BucketName amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurationsOutput:
Id Topic -- ----- mimo arn:aws:sns:eu-west-1:123456789012:topic-1-
Untuk detail API, lihat GetBucketNotificationdi Referensi Alat AWS untuk PowerShell Cmdlet (V4).
-
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini mengambil konfigurasi notifikasi dari bucket yang diberikan
Get-S3BucketNotification -BucketName amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurationsOutput:
Id Topic -- ----- mimo arn:aws:sns:eu-west-1:123456789012:topic-1-
Untuk detail API, lihat GetBucketNotificationdi Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-