-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.html
More file actions
66 lines (64 loc) · 2.65 KB
/
service.html
File metadata and controls
66 lines (64 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<script type="text/javascript">
RED.nodes.registerType('service', {
category : 'Aquila',
color : '#D8BFD8',
defaults: {
name : {value: ""},
server : {value: "", type:"aquila-remote-server", required: true},
device : {value: "", required: true},
method : {value: "", required: true},
serviceName : {value: "", required: true}
},
inputs : 1,
outputs : 1,
icon : "white-globe.png",
label : function() {
return this.name || "Service";
}
});
</script>
<script data-template-name="service" type="text/x-red">
<div class="form-row">
<label for="node-input-name"> <i class="icon-tag"></i> Name </label>
<input type="text" placeholder="Name" id="node-input-name" value="" name="">
</div>
<div class="form-row">
<label for="node-input-server"> <i class="icon-tag"></i> Server </label>
<input type="text" placeholder="Server" id="node-input-server" value="" name="">
</div>
<div class="form-row">
<label for="node-input-method"><i class="fa fa-tasks"></i> Method</label>
<select type="text" id="node-input-method" style="width:72%;">
<option value="get">GET</option>
<option value="post">POST</option>
<option value="put">PUT</option>
<option value="delete">DELETE</option>
</select>
</div>
<div class="form-row">
<label for="node-input-device"> <i class="icon-tag"></i> Device id </label>
<input type="text" placeholder="Device id" id="node-input-device" value="" name="">
</div>
<div class="form-row">
<label for="node-input-serviceName"> <i class="icon-tag"></i> Service name </label>
<input type="text" placeholder="Service Name" id="node-input-serviceName" value="" name="">
</div>
</script>
<script type="text/x-red" data-help-name="service">
<h2>Service</h2>
<hr>
<p>Request a service in the device. Deppending on your device implementation
you can request GET, POST, PUT or DELETE.</p>
<h3>Parameters</h3>
<ul>
<li><b>Name:</b> The name of the node</li>
<li><b>Server:</b> The server connection credentials</li>
<li><b>Method:</b> The request method you want to use</li>
<li><b>Device:</b> Device's hardware address, you can find it at the HUB under device details</li>
<li><b>Service Name:</b> The name of the service you want to work with (CASE SENSITIVE)</li>
</ul>
<h3>Input</h3>
<p>Any JSON data in msg.payload will be sent as the request's body. IMPORTANT: msg.payload must be a JSON object, otherwise it will be ignored.</p>
<h3>Output</h3>
<p>Response data will be received in msg.payload</p>
</script>