How to use the minio.buildARN function in minio

To help you get started, we’ve selected a few minio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github minio / minio-js / examples / set-bucket-notification.js View on Github external
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
 // dummy values, please replace them with original values.


var Minio = require('minio')

var s3Client = new Minio.Client({
  endPoint: 'localhost',
  port: 9000,
  useSSL: false,
  accessKey: 'YOUR-ACCESSKEYID',
  secretKey: 'YOUR-SECRETACCESSKEY'
})

var config = new Minio.NotificationConfig()
var arn = Minio.buildARN('minio', 'sqs', '', 1, 'webhook')
var queue = new Minio.QueueConfig(arn)

queue.addFilterSuffix('.jpg')
queue.addFilterPrefix('myphotos/')
queue.addEvent(Minio.ObjectCreatedAll)

config.add(queue)

s3Client.setBucketNotification('my-bucketname', config, function(e) {
  if (e) {
    return console.log(e)
  }
  console.log("Success")
})

minio

S3 Compatible Cloud Storage client

Apache-2.0
Latest version published 28 days ago

Package Health Score

89 / 100
Full package analysis