NodeRed Node for common MinIO operations, by Colin Payne.
This node utilises the MinIO JavaScript API (please see https://docs.min.io/docs/javascript-client-api-reference.html).
Please Note: This set of nodes (and associated support information) is a work in progress.
The Bucket Notification Operation setBucketNotification
is being worked on, and is not currently functioning correctly.
2021/01/29 - Version: 0.0.6
• getObject
now working; edits by @macanfa - thank you!
2020/05/06 - Version: 0.0.5
• getPartialObject
now working as expected, and README updated accordingly.
2020/04/29 - Version: 0.0.4
• listenBucketNotification
now extended to include defined Supported Event Types.
For each operation, parameters can either be set in the Edit Node dialogue, or passed in to the node via the node input. Parameters passed in will override any parameters set in the Edit Node dialogue.
The Operation in each case can be passed in to the node by setting the appropriate incoming value of msg.operation
Creates a new bucket.
Name | Parameter ( passed in as ) |
Description |
---|---|---|
Bucket | bucketName ( msg.bucketName ) |
Name of the bucket to be created |
Region | region ( msg.region ) |
Region where the bucket is to be created. (optional) |
Name | Description |
---|---|
Output | The node will output confirmation, in the form of a JS object, as to whether or not the bucket was created, e.g. {"makeBucket":true} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
List all buckets.
No parameters required.
Name | Description |
---|---|
Output | The node will output a JS object in the form {"listBuckets":[...]} containing an array of objects in the form {"name":"bucketname","creationDate": "yyyy-mm-ddThh:mm:ss.sssZ"} for each bucket. |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Checks if a bucket exists.
Name | Parameter ( passed in as ) |
Description |
---|---|---|
Bucket | bucketName ( msg.bucketName ) |
Name of the bucket to be checked. |
Name | Description |
---|---|
Output | The node will output confirmation, in the form of a JS object, as to whether or not the bucket exists, e.g. {"bucketExists":true} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Removes a bucket.
Name | Parameter ( passed in as ) |
Description |
---|---|---|
Bucket | bucketName ( msg.bucketName ) |
Name of the bucket to be removed. |
Name | Description |
---|---|
Output | The node will output confirmation, in the form of a JS object, as to whether or not the bucket has been removed, e.g. {"removeBucket":true} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Lists all objects in a bucket.
Name | Description |
---|---|
Output | The node will output a JS object in the form {"listObjects":[...]} containing an array of JS objects in the form {"name":"objectname", "lastModified": "yyyy-mm-ddThh:mm:ss.sssZ", "etag":"etagstring", "size":1234} for each object returned. |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Lists all objects in a bucket using S3 listing objects V2 API.
Name | Description |
---|---|
Output | The node will output a JS object in the form {"listObjectsV2":[...]} containing an array of JS objects in the form {"name":"objectname", "lastModified": "yyyy-mm-ddThh:mm:ss.sssZ", "etag":"etagstring", "size":1234} for each object returned. |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Lists all objects and their metadata in a bucket using S3 listing objects V2 API.
Name | Description |
---|---|
Output | The node will output a JS object in the form {"listObjectsV2WithMetadata":[...]} containing an array of JS objects in the form {"name":"objectname", "lastModified": "yyyy-mm-ddThh:mm:ss.sssZ", "etag":"etagstring", "size":1234, "metadata":{...} } for each object returned. |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Lists partially uploaded objects in a bucket.
Name | Description |
---|---|
Output | The node will output a JS object in the form {"listIncompleteUploads":[...]} containing an array of JS objects in the form {"key":"objectname", "uploadId": "uploadidstring", "size":1234} for each object returned. |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Downloads and saves the object as a file in the local filesystem.
Name | Description |
---|---|
Output | The node will output confirmation, in the form of a JS object, as to whether or not the object could be downloaded as a file, e.g. {"fGetObject":true} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Uploads contents from a file to objectName.
The maximum size of a single object is limited to 5TB. fPutObject transparently uploads objects larger than 64MiB in multiple parts. Uploaded data is carefully verified using MD5SUM signatures.
Name | Description |
---|---|
Output | The node will output a JS object, containing confirmation as to whether or not the file object was successfully uploaded, and, if successful, an etag value for the uploaded file object, e.g. {"fPutObject":true,"etag":"etagvaluestring"} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Downloads an object as a stream.
Name | Parameter ( passed in as ) |
Description |
---|---|---|
Bucket | bucketName ( msg.bucketName ) |
Name of the bucket. |
Object | objectName ( msg.objectName ) |
Name of the object. |
Name | Description |
---|---|
Output | The node will output a JS object. {"getObject":true,"objectData":[Buffer],"opjectSize":size-in-bytes} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Downloads the specified range bytes of an object as a stream.
Name | Description |
---|---|
Output | The node will output a JS object, containing confirmation as to whether or not thepartial object (chunk) was successfully downloaded, and, if successful, a buffer array for the downloaded partial object stream, e.g. { "getPartialObject": true, "chunk": [...] } |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Uploads an object from a stream/Buffer.
The maximum size of a single object is limited to 5TB. putObject transparently uploads objects larger than 64MiB in multiple parts. Uploaded data is carefully verified using MD5SUM signatures.
Name | Description |
---|---|
Output | The node will output confirmation, in the form of a JS object, as to whether or not the object PUT operation was successful, including (if appropriate) the etag reference of the object, , e.g. {"bucketExists":true, "etag":etagstring} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Copy a source object into a new object in the specified bucket.
Name | Description |
---|---|
Output | The node will output confirmation, in the form of a JS object, as to whether or not the object has been copied, e.g. {"copyObject":true} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Lists all objects in a bucket.
Name | Description |
---|---|
Output | The node will output a JS object in the form {"listObjects":[...]} containing an array of JS objects in the form {"name":"objectname", "lastModified": "yyyy-mm-ddThh:mm:ss.sssZ", "etag":"etagstring", "size":1234} for each object returned. |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Lists all objects in a bucket using S3 listing objects V2 API.
Name | Description |
---|---|
Output | The node will output a JS object in the form {"listObjectsV2":[...]} containing an array of JS objects in the form {"name":"objectname", "lastModified": "yyyy-mm-ddThh:mm:ss.sssZ", "etag":"etagstring", "size":1234} for each object returned. |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Removes all objects in a specified bucket matching an optional prefix value, or a defined list of object names.
Name | Description |
---|---|
Output | The node will output confirmation, in the form of a JS object, as to whether or not the list of objects have been removed, e.g. {"removeObjects":true} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Lists partially uploaded objects in a bucket.
Name | Description |
---|---|
Output | The node will output a JS object in the form {"listIncompleteUploads":[...]} containing an array of JS objects in the form {"key":"objectname", "uploadId": "uploadidstring", "size":1234} for each object returned. |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Generates a presigned URL for the provided HTTP method, 'httpMethod'.
Browsers/Mobile clients may point to this URL to directly download objects even if the bucket is private. This presigned URL can have an associated expiration time in seconds after which the URL is no longer valid. The default value is 7 days.
Name | Description |
---|---|
Output | If successful, the node will output a JS object, containing the generated presigned URL, e.g. { "presignedURL": presignedUrl } |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Generates a presigned URL for HTTP GET operations. Browsers/Mobile clients may point to this URL to directly download objects even if the bucket is private. This presigned URL can have an associated expiration time in seconds after which the URL is no longer valid. The default value is 7 days.
Name | Description |
---|---|
Output | If successful, the node will output a JS object, containing the generated presigned GET object URL, e.g. { "presignedURL": presignedUrl } |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Generates a presigned URL for HTTP PUT operations. Browsers/Mobile clients may point to this URL to upload objects directly to a bucket even if it is private. This presigned URL can have an associated expiration time in seconds after which the URL is no longer valid. The default value is 7 days.
Name | Description |
---|---|
Output | If successful, the node will output a JS object, containing the generated presigned PUT object URL, e.g. { "presignedURL": presignedUrl } |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Allows setting policy conditions to a presigned URL for POST operations. Policies such as bucket name to receive object uploads, key name prefixes, expiry policy may be set.
Name | Description |
---|---|
Output | If successful, the node will output a JS object, containing the details of the submitted policy, e.g. { "presignedPostPolicy": { "postURL": url, "formData": {...} } } |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
For each operation, paramenters can either be set in the Edit Node dialogue, or passed in to the node via the node input. Parameters passed in will override any parameters set in the Edit Node dialogue.
The bucket Operation can be passed in to the node by setting the appropriate incoming value of msg.operation
Creates a new bucket.
Name | Parameter ( passed in as ) |
Description |
---|---|---|
Bucket | bucketName ( msg.bucketName ) |
Name of the bucket to be created. |
Region | region ( msg.region ) |
Region where the bucket is to be created. (optional) |
Name | Description |
---|---|
Output | The node will output confirmation, in the form of a JS object, as to whether or not the bucket was created, e.g. {"makeBucket":true} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
List all buckets.
Name | Description |
---|---|
Output | The node will output a JS object in the form {"listBuckets":[...]} containing an array of objects in the form {"name":"bucketname","creationDate": "yyyy-mm-ddThh:mm:ss.sssZ"} for each bucket. |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Checks if a bucket exists.
Name | Parameter ( passed in as ) |
Description |
---|---|---|
Bucket | bucketName ( msg.bucketName ) |
Name of the bucket to be checked. |
Name | Description |
---|---|
Output | The node will output confirmation, in the form of a JS object, as to whether or not the bucket exists, e.g. {"bucketExists":true} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Removes a bucket.
Name | Parameter ( passed in as ) |
Description |
---|---|---|
Bucket | bucketName ( msg.bucketName ) |
Name of the bucket to be removed. |
Name | Description |
---|---|
Output | The node will output confirmation, in the form of a JS object, as to whether or not the bucket has been removed, e.g. {"removeBucket":true} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
For each operation, paramenters can either be set in the Edit Node dialogue, or passed in to the node via the node input. Parameters passed in will override any parameters set in the Edit Node dialogue.
The bucket Operation can be passed in to the node by setting the appropriate incoming value of msg.operation
Get the bucket policy associated with the specified bucket. If objectPrefix
is not empty, the bucket policy will be filtered based on object permissions
as well.
Name | Parameter ( passed in as ) |
Description |
---|---|---|
Bucket | bucketName ( msg.bucketName ) |
Name of the bucket. |
Name | Description |
---|---|
Output | The node will output confirmation, in the form of a JS object, as to whether or not the bucket policy exists, and if it does, the details of the policy, e.g. {"getBucketPolicy":true, "policy":{...} } |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Set the bucket policy on the specified bucket. bucketPolicy is detailed here.
Name | Parameter ( passed in as ) |
Description |
---|---|---|
Bucket | bucketName ( msg.bucketName ) |
Name of the bucket. |
Policy | bucketPolicy ( msg.bucketPolicy ) |
Bucket policy. |
Name | Description |
---|---|
Output | The node will output confirmation, in the form of a JS object, as to whether or not the bucket policy has been set, e.g. {"setBucketPolicy":true} |
Error | Any errors received in response to the request will be passed to the node's 'Error' output. |
Copyright © 2020 Colin Payne