View a markdown version of this page

搭配使用 GetBucketNotification 與 CLI - Amazon Simple Storage Service

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

搭配使用 GetBucketNotification 與 CLI

下列程式碼範例示範如何使用 GetBucketNotification

CLI
AWS CLI

下列命令會擷取名為 amzn-s3-demo-bucket 之儲存貯體的通知組態:

aws s3api get-bucket-notification --bucket amzn-s3-demo-bucket

輸出:

{ "TopicConfiguration": { "Topic": "arn:aws:sns:us-west-2:123456789012:my-notification-topic", "Id": "YmQzMmEwM2EjZWVlI0NGItNzVtZjI1MC00ZjgyLWZDBiZWNl", "Event": "s3:ObjectCreated:*", "Events": [ "s3:ObjectCreated:*" ] } }
PowerShell
Tools for PowerShell V4

範例 1:此範例會擷取給定儲存貯體的通知組態

Get-S3BucketNotification -BucketName amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurations

輸出:

Id Topic -- ----- mimo arn:aws:sns:eu-west-1:123456789012:topic-1
  • 如需 API 詳細資訊,請參閱《AWS Tools for PowerShell Cmdlet 參考 (V4)》中的 GetBucketNotification

Tools for PowerShell V5

範例 1:此範例會擷取給定儲存貯體的通知組態

Get-S3BucketNotification -BucketName amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurations

輸出:

Id Topic -- ----- mimo arn:aws:sns:eu-west-1:123456789012:topic-1
  • 如需 API 詳細資訊,請參閱《AWS Tools for PowerShell Cmdlet 參考 (V5)》中的 GetBucketNotification

如需 AWS SDK 開發人員指南和程式碼範例的完整清單,請參閱 使用 AWS SDKs 使用 Amazon S3 進行開發。此主題也包含有關入門的資訊和舊版 SDK 的詳細資訊。