-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathgce-instance.html
149 lines (129 loc) · 4.54 KB
/
gce-instance.html
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<!--
Copyright 2022 Google Inc.
Created by Ari Victor
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('google-cloud-compute-engine-instance', {
category: 'GCP',
color: '#3FADB5',
defaults: {
account: { type: "google-cloud-credentials", required: false },
keyFilename: {value: "", required: false },
name: { value: "" },
projectId: { value: "" },
zone: { value: "" },
instance: { value: "" },
operation: { value: "" },
template: { value: "{}" },
},
inputs:1,
outputs:1,
icon: "font-awesome/fa-television",
label: function () {
return this.name || "gce-instance";
},
paletteLabel: "gce-instance",
oneditprepare: function() {
// Template JSON input
$("#node-input-template").typedInput({
type:"json",
types:["json"],
});
}
});
</script>
<script type="text/html" data-template-name="google-cloud-compute-engine-instance">
<!-- Node Name -->
<div class="form-row">
<label for="node-input-name">
<i class="fa fa-tag"></i>
Node Name
</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<hr>
<!-- Account -->
<div class="form-row">
<label for="node-input-account">
<i class="fa fa-user"></i>
Credentials
</label>
<input type="text" id="node-input-account">
</div>
<!-- Key Filename -->
<div class="form-row">
<label for="node-input-keyFilename">
<i class="fa fa-user"></i>
Key File
</label>
<input type="text" id="node-input-keyFilename">
</div>
<hr>
<!-- Operation -->
<div class="form-row">
<label for="node-input-operation">
Operation
</label>
<select id="node-input-operation">
<option value="get">get</option>
<option value="list">list</option>
<option value="start">start</option>
<option value="stop">stop</option>
<option value="reset">reset</option>
<option value="delete">delete</option>
<option value="create">create</option>
</select>
</div>
<hr>
<!-- Project ID -->
<div class="form-row">
<label for="node-input-projectId">
Project ID
</label>
<input type="text" id="node-input-projectId" placeholder="msg.payload.projectId">
</div>
<!-- Zone -->
<div class="form-row">
<label for="node-input-zone">
Zone
</label>
<input type="text" id="node-input-zone" placeholder="msg.payload.zone">
</div>
<!-- Instance Name -->
<div class="form-row">
<label for="node-input-instance">
Instance Name
</label>
<input type="text" id="node-input-instance" placeholder="msg.payload.instance">
</div>
<!-- Template -->
<div class="form-row">
<label for="node-input-template">
Instance Template
</label>
<input type="text" id="node-input-template" placeholder="msg.payload.template">
</div>
</script>
<!-- Documentation -->
<script type="text/html" data-help-name="google-cloud-compute-engine-instance">
<p>A node for working with Cloud Compute Engine (GCP) instances</p>
<h3>Configuration</h3>
<p>
Properties can be explicitly set in the node. The node will also accept a dynamic payload object with the
set properties. Some operations will not require all properties to be configured.
</p>
<h3>Credentials</h3>
<p>
Credentials can be explicitly configured in the attached google-cloud-credentials node. If credentials are not specified the node will attempt
to use any implicit GCP identity found in the Node Red environment. For local use we recommend setting your Application Default Credentials.
</p>
</script>