UNPKG

node-red-node-web-nodes

Version:

A collection of Node-RED nodes for popular web services.

189 lines (174 loc) 7.89 kB
<!-- Copyright 2014 IBM Corp. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <script type="text/x-red" data-template-name="amazon s3 in"> <div class="form-row"> <label for="node-input-aws"><i class="fa fa-user"></i> AWS</label> <input type="text" id="node-input-aws"> </div> <div class="form-row"> <label for="node-input-bucket"><i class="fa fa-folder"></i> Bucket</label> <input type="text" id="node-input-bucket" placeholder="bucket name"> </div> <div class="form-row node-input-filepattern"> <label for="node-input-filepattern"><i class="fa fa-file"></i> Filename Pattern</label> <input type="text" id="node-input-filepattern" placeholder="Filepattern"> </div> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> </script> <script type="text/x-red" data-help-name="amazon s3 in"> <p>Amazon S3 watch node. Watches for file events on Box. By default all file events are reported, but the filename pattern can be supplied to limit the events to files which have full filenames that match the glob pattern. The event messages consist of the full filename in <b>msg.payload</b> property, the filename in <b>msg.file</b>, the event type in <b>msg.event</b>.</p> </script> <script type="text/javascript"> RED.nodes.registerType('amazon s3 in',{ category: 'storage-input', color:"#C0DEED", defaults: { aws: {type:"aws-config",required:true}, bucket: {required:true}, filepattern: {value:""}, name: {value:""}, }, inputs:0, outputs:1, icon: "amazon.png", label: function() { return this.bucket ? "s3 "+this.bucket : "s3"; } }); </script> <script type="text/x-red" data-template-name="amazon s3"> <div class="form-row"> <label for="node-input-aws"><i class="fa fa-user"></i> AWS</label> <input type="text" id="node-input-aws"> </div> <div class="form-row"> <label for="node-input-bucket"><i class="fa fa-folder"></i> Bucket</label> <input type="text" id="node-input-bucket" placeholder="bucket name"> </div> <div class="form-row node-input-filename"> <label for="node-input-filename"><i class="fa fa-file"></i> Filename</label> <input type="text" id="node-input-filename" placeholder="Filename"> </div> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> </script> <script type="text/x-red" data-help-name="amazon s3"> <p>Amazon S3 input node. Downloads content from an Amazon S3 bucket. The bucket name can be specified in the node <b>bucket</b> property or in the <b>msg.bucket</b> property. The name of the file to download is taken from the node <b>filename</b> property or the <b>msg.filename</b> property. The downloaded content is sent as <b>msg.payload</b> property. If the download fails <b>msg.error</b> will contain an error object.</p> </script> <script type="text/javascript"> RED.nodes.registerType('amazon s3',{ category: 'storage-output', color:"#C0DEED", defaults: { aws: {type:"aws-config",required:true}, bucket: {required:true}, filename: {value:""}, name: {value:""}, }, inputs:1, outputs:1, icon: "amazon.png", align: "right", label: function() { return this.bucket ? "s3 "+this.bucket : "s3"; } }); </script> <script type="text/x-red" data-template-name="amazon s3 out"> <div class="form-row"> <label for="node-input-aws"><i class="fa fa-user"></i> AWS</label> <input type="text" id="node-input-aws"> </div> <div class="form-row"> <label for="node-input-bucket"><i class="fa fa-folder"></i> Bucket</label> <input type="text" id="node-input-bucket" placeholder="bucket name"> </div> <div class="form-row node-input-filename"> <label for="node-input-filename"><i class="fa fa-file"></i> Filename</label> <input type="text" id="node-input-filename" placeholder="Filename"> </div> <div class="form-row node-input-localFilename"> <label for="node-input-localFilename"><i class="fa fa-file"></i> Local Filename</label> <input type="text" id="node-input-localFilename" placeholder="Local Filename"> </div> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> </script> <script type="text/x-red" data-help-name="amazon s3 out"> <p>Amazon S3 out node. Uploads content to an Amazon S3 bucket. The bucket name can be specified in the node <b>bucket</b> property or in the <b>msg.bucket</b> property. The filename on Amazon S3 is taken from the node <b>filename</b> property or the <b>msg.filename</b> property. The content is taken from either the node <b>localFilename</b> property, the <b>msg.localFilename</b> property or the <b>msg.payload</b> property.</p> </script> <script type="text/javascript"> RED.nodes.registerType('amazon s3 out',{ category: 'storage-output', color:"#C0DEED", defaults: { aws: {type:"aws-config",required:true}, bucket: {required:true}, filename: {value:""}, localFilename: {value:""}, name: {value:""}, }, inputs:1, outputs:0, icon: "amazon.png", align: "right", label: function() { return this.bucket ? "s3 "+this.bucket : "s3"; } }); </script> <script type="text/x-red" data-template-name="aws-config"> <div class="form-row"> <label for="node-config-input-accesskeyid"><i class="fa fa-bookmark"></i>AccessKeyID</label> <input class="input-append-left" type="text" id="node-config-input-accesskeyid" style="width: 40%;" > </div> <div class="form-row"> <label for="node-config-input-secretaccesskey"><i class="fa fa-bookmark"></i>Secret Access Key</label> <input class="input-append-left" type="password" id="node-config-input-secretaccesskey" style="width: 40%;" > </div> <div class="form-tips"> <p>To obtain these credentials, sign up to <a href="http://aws.amazon.com/">Amazon Web Services</a>, Then either: <ul> <li>click on your account name and select "Security Credentials" then click "Access Keys (Access Key ID and Secret Access Key)" or</li> <li>select "IAM" under "Deployment & Management" from the AWS console and create an 'IAM' user with a suitable policy.</li> </ul> </div> </script> <script type="text/javascript"> (function() { RED.nodes.registerType('aws-config',{ category: 'config', defaults: { }, credentials: { accesskeyid: {type:"text",required:true}, secretaccesskey: {type: "password",required:true}, }, label: function() { return this.accesskeyid ? "AWS "+this.accesskeyid : "AWS"; }, exportable: false, }); })(); </script>