node-red-contrib-dynamorse-file-io
Version:
Dynamorse File IO nodes for Node-RED
158 lines (143 loc) • 6.63 kB
HTML
<!--
Copyright 2018 Streampunk Media Ltd.
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/javascript">
RED.nodes.registerType('cloud-store-out', {
category: 'spout',
color: '#FDE8C3',
defaults: {
name: { value : "" },
region: { value : "eu-west-1" },
bucket: { value : "" },
key: { value : "" },
partSize: { value : 5, validate : RED.validators.number() },
queueSize: { value : 4, validate : RED.validators.number() },
timeout: { value : 0, validate : RED.validators.number() }
},
inputs:1,
outputs:0,
align: 'right',
icon: "spout.png",
label: function() {
return this.name || "cloud-store-out";
}
});
</script>
<script type="text/x-red" data-template-name="cloud-store-out">
<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>
<div class="form-row"> <!-- TODO Consider changing to a drop down choice list. -->
<label for="node-input-region"><i class="fa fa-globe" aria-hidden="true"></i> region</label>
<select id="node-input-sampling" style="width: 120px">
<option value="us-east-2">US East (Ohio)</option>
<option value="us-east-1">US East (N. Virginia)</option>
<option value="us-west-1">US West (N. California)</option>
<option value="us-west-2">US West (Oregon)</option>
<option value="ca-central-1">Canada (Central)</option>
<option value="ap-south-1">Asia Pacific (Mumbai)</option>
<option value="ap-northeast-2">Asia Pacific (Seoul)</option>
<option value="ap-southeast-1">Asia Pacific (Singapore)</option>
<option value="ap-southeast-2">Asia Pacific (Sydney)</option>
<option value="ap-northeast-1">Asia Pacific (Tokyo)</option>
<option value="eu-central-1">EU (Frankfurt)</option>
<option value="eu-west-1" selected>EU (Ireland)</option>
<option value="eu-west-2">EU (London)</option>
<option value="sa-east-1">South America (São Paulo)</option>
</select>
</div>
<div class="form-row">
<label for="node-input-bucket"><i class="fa fa-archive" aria-hidden="true"></i> bucket</label>
<input type="text" id="node-input-bucket" placeholder="bucket">
</div>
<div class="form-row">
<label for="node-input-key"><i class="fa fa-key" aria-hidden="true"></i> key</label>
<input type="text" id="node-input-key" placeholder="flowKey">
</div>
<div class="form-row">
<label for="node-input-timeout"><i class="fa fa-clock-o"></i> timeout</label>
<input type="number" min="0" id="node-input-timeout" placeholder="0" style="width: 100px">
</div>
<div class="form-row">
<label for="node-input-partSize"><i class="fa fa-puzzle-piece" aria-hidden="true"></i> part size</label>
<input type="number" min="0" id="node-input-partSize" placeholder="5" style="width: 100px">
<label for="node-input-queueSize"><i class="fa fa-fighter-jet" aria-hidden="true"></i> queue size</label>
<input type="number" min="1" id="node-input-queueSize" placeholder="4" style="width: 100px">
</div>
</script>
<style>
.param-table table, th, td {
vertical-align: top;
padding: 3px;
}
</style>
<script type="text/x-red" data-help-name="cloud-store-out">
<h1>Cloud store output</h1>
<p>Write an object or objects that are sequence of payloads for grains to an
AWS S3-style interface cloud store. Objects are stored with metadata that allows them
to be recreated using the partner <em>cloud-store-in</em> node without loss
of grain metadata.</p>
<p>Prior to using this capability, security credentials must have been
established so that Node.JS, and hence Node-RED, can access the buckets of an
assocatied AWS account. This could be by creating a local file called
<code>~/.aws/credentials</code> or by assigning an IAM role with S3 write
permissions. See the AWS documentation on <a href="http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html">
Setting Credntials in Node.js</a>.</p>
<p>The bucket that is to be used must already have been created.</p>
<p>The AWS SDK provides a parallel upload facility for streams of unknown
length and to improve performance. Configure this using the <em>part size</em>
and <em>queue size</em> properties.</p>
<h3>Parameters</h3>
<div class="param-table">
<table>
<tr>
<th>parameter</th><th>description</th>
</tr>
<tr>
<td><i class="fa fa-tag" aria-hidden="true"></i> name</td>
<td>Name of the node.</td>
</tr>
<tr>
<td><i class="fa fa-globe" aria-hidden="true"></i> region</td>
<td>Region in S3 to use.</td>
</tr>
<tr>
<td><i class="fa fa-archive" aria-hidden="true"></i> bucket</td>
<td>Name of the S3 bucket where the grain payloads are to be stored.</td>
</tr>
<tr>
<td><i class="fa fa-key" aria-hidden="true"></i> key</i></td>
<td>Object key to name the object or sequence of objects.</td>
</tr>
<tr>
<td><i class="fa fa-clock-o"></i> timeout</td>
<td>Time to wait between writing each grain. Controls the back-pressure.</td>
</tr>
<tr>
<td><i class="fa fa-puzzle-piece" aria-hidden="true"></i> part size</td>
<td>Size of upload chunk when uploading to S3, measured in megabytes.</td>
</tr>
<tr>
<td><i class="fa fa-fighter-jet" aria-hidden="true"></i> queue size</td>
<td>Number of concurrent streams to use for upload. Set to 1 for synchronous.</td>
</tr>
</table>
</div>
<p>Note that this interface does not use the S3 HTTP/S interface directly,
relying instead on the official <a href="https://www.npmjs.com/package/aws-sdk">
AWS Javascript SDK module <code>aws-sdk</code></a>.</p>
<p>Streams of variable bitrate are not yet supported.</p>
<h3>Maturity</h3>
<p>Implementation in progress -
<a href="https://github.com/Streampunk/dynamorse/issues/7">status</a>.
</script>