IBM COS SDK for JavaScript V2 - v1.0.0
    Preparing search index...

    Class GetBucketNotificationConfigurationCommand

    This operation is not supported for directory buckets.

    Returns the notification configuration of a bucket.

    If notifications are not enabled on the bucket, the action returns an empty NotificationConfiguration element.

    By default, you must be the bucket owner to read the notification configuration of a bucket. However, the bucket owner can use a bucket policy to grant permission to other users to read this configuration with the s3:GetBucketNotification permission.

    When you use this API operation with an access point, provide the alias of the access point in place of the bucket name.

    When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code InvalidAccessPointAliasError is returned. For more information about InvalidAccessPointAliasError, see List of Error Codes.

    For more information about setting and reading the notification configuration on a bucket, see Setting Up Notification of Bucket Events. For more information about bucket policies, see Using Bucket Policies.

    The following action is related to GetBucketNotification:

    You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.

    Use a bare-bones client and the command you need to make an API call.

    import { S3Client, GetBucketNotificationConfigurationCommand } from "ibm-cos-sdk-v2"; // ES Modules import
    // const { S3Client, GetBucketNotificationConfigurationCommand } = require("ibm-cos-sdk-v2"); // CommonJS import
    // import type { S3ClientConfig } from "ibm-cos-sdk-v2";
    const config = {}; // type is S3ClientConfig
    const client = new S3Client(config);
    const input = { // GetBucketNotificationConfigurationRequest
    Bucket: "STRING_VALUE", // required
    ExpectedBucketOwner: "STRING_VALUE",
    };
    const command = new GetBucketNotificationConfigurationCommand(input);
    const response = await client.send(command);
    // { // NotificationConfiguration
    // TopicConfigurations: [ // TopicConfigurationList
    // { // TopicConfiguration
    // Id: "STRING_VALUE",
    // TopicArn: "STRING_VALUE", // required
    // Events: [ // EventList // required
    // "s3:ReducedRedundancyLostObject" || "s3:ObjectCreated:*" || "s3:ObjectCreated:Put" || "s3:ObjectCreated:Post" || "s3:ObjectCreated:Copy" || "s3:ObjectCreated:CompleteMultipartUpload" || "s3:ObjectRemoved:*" || "s3:ObjectRemoved:Delete" || "s3:ObjectRemoved:DeleteMarkerCreated" || "s3:ObjectRestore:*" || "s3:ObjectRestore:Post" || "s3:ObjectRestore:Completed" || "s3:Replication:*" || "s3:Replication:OperationFailedReplication" || "s3:Replication:OperationNotTracked" || "s3:Replication:OperationMissedThreshold" || "s3:Replication:OperationReplicatedAfterThreshold" || "s3:ObjectRestore:Delete" || "s3:LifecycleTransition" || "s3:IntelligentTiering" || "s3:ObjectAcl:Put" || "s3:LifecycleExpiration:*" || "s3:LifecycleExpiration:Delete" || "s3:LifecycleExpiration:DeleteMarkerCreated" || "s3:ObjectTagging:*" || "s3:ObjectTagging:Put" || "s3:ObjectTagging:Delete",
    // ],
    // Filter: { // NotificationConfigurationFilter
    // Key: { // S3KeyFilter
    // FilterRules: [ // FilterRuleList
    // { // FilterRule
    // Name: "prefix" || "suffix",
    // Value: "STRING_VALUE",
    // },
    // ],
    // },
    // },
    // },
    // ],
    // QueueConfigurations: [ // QueueConfigurationList
    // { // QueueConfiguration
    // Id: "STRING_VALUE",
    // QueueArn: "STRING_VALUE", // required
    // Events: [ // required
    // "s3:ReducedRedundancyLostObject" || "s3:ObjectCreated:*" || "s3:ObjectCreated:Put" || "s3:ObjectCreated:Post" || "s3:ObjectCreated:Copy" || "s3:ObjectCreated:CompleteMultipartUpload" || "s3:ObjectRemoved:*" || "s3:ObjectRemoved:Delete" || "s3:ObjectRemoved:DeleteMarkerCreated" || "s3:ObjectRestore:*" || "s3:ObjectRestore:Post" || "s3:ObjectRestore:Completed" || "s3:Replication:*" || "s3:Replication:OperationFailedReplication" || "s3:Replication:OperationNotTracked" || "s3:Replication:OperationMissedThreshold" || "s3:Replication:OperationReplicatedAfterThreshold" || "s3:ObjectRestore:Delete" || "s3:LifecycleTransition" || "s3:IntelligentTiering" || "s3:ObjectAcl:Put" || "s3:LifecycleExpiration:*" || "s3:LifecycleExpiration:Delete" || "s3:LifecycleExpiration:DeleteMarkerCreated" || "s3:ObjectTagging:*" || "s3:ObjectTagging:Put" || "s3:ObjectTagging:Delete",
    // ],
    // Filter: {
    // Key: {
    // FilterRules: [
    // {
    // Name: "prefix" || "suffix",
    // Value: "STRING_VALUE",
    // },
    // ],
    // },
    // },
    // },
    // ],
    // LambdaFunctionConfigurations: [ // LambdaFunctionConfigurationList
    // { // LambdaFunctionConfiguration
    // Id: "STRING_VALUE",
    // LambdaFunctionArn: "STRING_VALUE", // required
    // Events: [ // required
    // "s3:ReducedRedundancyLostObject" || "s3:ObjectCreated:*" || "s3:ObjectCreated:Put" || "s3:ObjectCreated:Post" || "s3:ObjectCreated:Copy" || "s3:ObjectCreated:CompleteMultipartUpload" || "s3:ObjectRemoved:*" || "s3:ObjectRemoved:Delete" || "s3:ObjectRemoved:DeleteMarkerCreated" || "s3:ObjectRestore:*" || "s3:ObjectRestore:Post" || "s3:ObjectRestore:Completed" || "s3:Replication:*" || "s3:Replication:OperationFailedReplication" || "s3:Replication:OperationNotTracked" || "s3:Replication:OperationMissedThreshold" || "s3:Replication:OperationReplicatedAfterThreshold" || "s3:ObjectRestore:Delete" || "s3:LifecycleTransition" || "s3:IntelligentTiering" || "s3:ObjectAcl:Put" || "s3:LifecycleExpiration:*" || "s3:LifecycleExpiration:Delete" || "s3:LifecycleExpiration:DeleteMarkerCreated" || "s3:ObjectTagging:*" || "s3:ObjectTagging:Put" || "s3:ObjectTagging:Delete",
    // ],
    // Filter: {
    // Key: {
    // FilterRules: [
    // {
    // Name: "prefix" || "suffix",
    // Value: "STRING_VALUE",
    // },
    // ],
    // },
    // },
    // },
    // ],
    // EventBridgeConfiguration: {},
    // };

    GetBucketNotificationConfigurationCommandInput

    S3ServiceException

    Base exception class for all service exceptions from S3 service.

    Hierarchy

    Index

    Constructors

    Constructors

    • Returns GetBucketNotificationConfigurationCommand

    • Parameters

      Returns GetBucketNotificationConfigurationCommand