n8n-nodes-do 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +19 -0
- package/README.md +350 -0
- package/dist/credentials/DigitalOceanApi.credentials.d.ts +10 -0
- package/dist/credentials/DigitalOceanApi.credentials.js +41 -0
- package/dist/credentials/DigitalOceanApi.credentials.js.map +1 -0
- package/dist/icons/github.dark.svg +3 -0
- package/dist/icons/github.svg +3 -0
- package/dist/nodes/DigitalOcean/DigitalOcean.node.d.ts +22 -0
- package/dist/nodes/DigitalOcean/DigitalOcean.node.js +1648 -0
- package/dist/nodes/DigitalOcean/DigitalOcean.node.js.map +1 -0
- package/dist/nodes/DigitalOcean/digitalocean.svg +18 -0
- package/dist/package.json +58 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,1648 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DigitalOcean = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const BASE_URL = 'https://api.digitalocean.com/v2';
|
|
6
|
+
async function makePaginatedRequest(method, path, qs, headers, limit) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const returnData = [];
|
|
9
|
+
let page = 1;
|
|
10
|
+
const perPage = 200;
|
|
11
|
+
do {
|
|
12
|
+
const response = await this.helpers.httpRequest({
|
|
13
|
+
method,
|
|
14
|
+
url: `${BASE_URL}${path}`,
|
|
15
|
+
qs: { ...qs, page, per_page: perPage },
|
|
16
|
+
headers,
|
|
17
|
+
});
|
|
18
|
+
const dataKey = Object.keys(response).find(k => Array.isArray(response[k]));
|
|
19
|
+
if (dataKey && response[dataKey]) {
|
|
20
|
+
returnData.push(...response[dataKey]);
|
|
21
|
+
}
|
|
22
|
+
const hasNextPage = (_b = (_a = response.links) === null || _a === void 0 ? void 0 : _a.pages) === null || _b === void 0 ? void 0 : _b.next;
|
|
23
|
+
if (!hasNextPage)
|
|
24
|
+
break;
|
|
25
|
+
page++;
|
|
26
|
+
} while (returnData.length < limit);
|
|
27
|
+
return returnData.slice(0, limit);
|
|
28
|
+
}
|
|
29
|
+
class DigitalOcean {
|
|
30
|
+
constructor() {
|
|
31
|
+
this.description = {
|
|
32
|
+
displayName: 'DigitalOcean',
|
|
33
|
+
name: 'digitalOcean',
|
|
34
|
+
icon: 'file:digitalocean.svg',
|
|
35
|
+
group: ['transform'],
|
|
36
|
+
version: 1,
|
|
37
|
+
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
|
|
38
|
+
description: 'Manage DigitalOcean cloud resources including Droplets, Volumes, Databases, Kubernetes, and more.',
|
|
39
|
+
defaults: { name: 'DigitalOcean' },
|
|
40
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
41
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
42
|
+
credentials: [{ name: 'digitalOceanApi', required: true }],
|
|
43
|
+
properties: [
|
|
44
|
+
{
|
|
45
|
+
displayName: 'Resource',
|
|
46
|
+
name: 'resource',
|
|
47
|
+
type: 'options',
|
|
48
|
+
noDataExpression: true,
|
|
49
|
+
options: [
|
|
50
|
+
{ name: 'Account', value: 'account' },
|
|
51
|
+
{ name: 'Database', value: 'database' },
|
|
52
|
+
{ name: 'Domain', value: 'domain' },
|
|
53
|
+
{ name: 'Droplet', value: 'droplet' },
|
|
54
|
+
{ name: 'Image', value: 'image' },
|
|
55
|
+
{ name: 'Kubernete', value: 'kubernetes' },
|
|
56
|
+
{ name: 'Load Balancer', value: 'loadBalancer' },
|
|
57
|
+
{ name: 'Project', value: 'project' },
|
|
58
|
+
{ name: 'Reserved IP', value: 'reservedIp' },
|
|
59
|
+
{ name: 'Snapshot', value: 'snapshot' },
|
|
60
|
+
{ name: 'SSH Key', value: 'sshKey' },
|
|
61
|
+
{ name: 'VPC', value: 'vpc' },
|
|
62
|
+
{ name: 'Volume', value: 'volume' },
|
|
63
|
+
],
|
|
64
|
+
default: 'droplet',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Operation',
|
|
68
|
+
name: 'operation',
|
|
69
|
+
type: 'options',
|
|
70
|
+
noDataExpression: true,
|
|
71
|
+
displayOptions: { show: { resource: ['account'] } },
|
|
72
|
+
options: [
|
|
73
|
+
{ name: 'Get', value: 'get', description: 'Get account information', action: 'Get account information' },
|
|
74
|
+
],
|
|
75
|
+
default: 'get',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Operation',
|
|
79
|
+
name: 'operation',
|
|
80
|
+
type: 'options',
|
|
81
|
+
noDataExpression: true,
|
|
82
|
+
displayOptions: { show: { resource: ['droplet'] } },
|
|
83
|
+
options: [
|
|
84
|
+
{ name: 'Create', value: 'create', description: 'Create a new droplet', action: 'Create a droplet' },
|
|
85
|
+
{ name: 'Delete', value: 'delete', description: 'Delete a droplet', action: 'Delete a droplet' },
|
|
86
|
+
{ name: 'Get', value: 'get', description: 'Get a droplet by ID', action: 'Get a droplet' },
|
|
87
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get many droplets', action: 'Get many droplets' },
|
|
88
|
+
{ name: 'Power Off', value: 'powerOff', description: 'Power off a droplet', action: 'Power off a droplet' },
|
|
89
|
+
{ name: 'Power On', value: 'powerOn', description: 'Power on a droplet', action: 'Power on a droplet' },
|
|
90
|
+
{ name: 'Reboot', value: 'reboot', description: 'Reboot a droplet', action: 'Reboot a droplet' },
|
|
91
|
+
{ name: 'Shutdown', value: 'shutdown', description: 'Shutdown a droplet', action: 'Shutdown a droplet' },
|
|
92
|
+
],
|
|
93
|
+
default: 'getAll',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
displayName: 'Operation',
|
|
97
|
+
name: 'operation',
|
|
98
|
+
type: 'options',
|
|
99
|
+
noDataExpression: true,
|
|
100
|
+
displayOptions: { show: { resource: ['volume'] } },
|
|
101
|
+
options: [
|
|
102
|
+
{ name: 'Create', value: 'create', description: 'Create a new volume', action: 'Create a volume' },
|
|
103
|
+
{ name: 'Delete', value: 'delete', description: 'Delete a volume', action: 'Delete a volume' },
|
|
104
|
+
{ name: 'Get', value: 'get', description: 'Get a volume by ID', action: 'Get a volume' },
|
|
105
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get many volumes', action: 'Get many volumes' },
|
|
106
|
+
],
|
|
107
|
+
default: 'getAll',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
displayName: 'Operation',
|
|
111
|
+
name: 'operation',
|
|
112
|
+
type: 'options',
|
|
113
|
+
noDataExpression: true,
|
|
114
|
+
displayOptions: { show: { resource: ['database'] } },
|
|
115
|
+
options: [
|
|
116
|
+
{ name: 'Create', value: 'create', description: 'Create a new database cluster', action: 'Create a database' },
|
|
117
|
+
{ name: 'Delete', value: 'delete', description: 'Delete a database cluster', action: 'Delete a database' },
|
|
118
|
+
{ name: 'Get', value: 'get', description: 'Get a database cluster by ID', action: 'Get a database' },
|
|
119
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get many database clusters', action: 'Get many databases' },
|
|
120
|
+
],
|
|
121
|
+
default: 'getAll',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
displayName: 'Operation',
|
|
125
|
+
name: 'operation',
|
|
126
|
+
type: 'options',
|
|
127
|
+
noDataExpression: true,
|
|
128
|
+
displayOptions: { show: { resource: ['domain'] } },
|
|
129
|
+
options: [
|
|
130
|
+
{ name: 'Create', value: 'create', description: 'Create a new domain', action: 'Create a domain' },
|
|
131
|
+
{ name: 'Delete', value: 'delete', description: 'Delete a domain', action: 'Delete a domain' },
|
|
132
|
+
{ name: 'Get', value: 'get', description: 'Get a domain by name', action: 'Get a domain' },
|
|
133
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get many domains', action: 'Get many domains' },
|
|
134
|
+
{ name: 'Get Records', value: 'getRecords', description: 'Get domain records', action: 'Get domain records' },
|
|
135
|
+
],
|
|
136
|
+
default: 'getAll',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
displayName: 'Operation',
|
|
140
|
+
name: 'operation',
|
|
141
|
+
type: 'options',
|
|
142
|
+
noDataExpression: true,
|
|
143
|
+
displayOptions: { show: { resource: ['image'] } },
|
|
144
|
+
options: [
|
|
145
|
+
{ name: 'Delete', value: 'delete', description: 'Delete an image', action: 'Delete an image' },
|
|
146
|
+
{ name: 'Get', value: 'get', description: 'Get an image by ID', action: 'Get an image' },
|
|
147
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get many images', action: 'Get many images' },
|
|
148
|
+
],
|
|
149
|
+
default: 'getAll',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
displayName: 'Operation',
|
|
153
|
+
name: 'operation',
|
|
154
|
+
type: 'options',
|
|
155
|
+
noDataExpression: true,
|
|
156
|
+
displayOptions: { show: { resource: ['kubernetes'] } },
|
|
157
|
+
options: [
|
|
158
|
+
{ name: 'Delete Cluster', value: 'deleteCluster', description: 'Delete a Kubernetes cluster', action: 'Delete a kubernetes cluster' },
|
|
159
|
+
{ name: 'Get Cluster', value: 'getCluster', description: 'Get a Kubernetes cluster', action: 'Get a kubernetes cluster' },
|
|
160
|
+
{ name: 'Get All Clusters', value: 'getAllClusters', description: 'Get all Kubernetes clusters', action: 'Get all kubernetes clusters' },
|
|
161
|
+
{ name: 'Get Kubeconfig', value: 'getKubeconfig', description: 'Get kubeconfig for a cluster', action: 'Get kubeconfig' },
|
|
162
|
+
],
|
|
163
|
+
default: 'getAllClusters',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
displayName: 'Operation',
|
|
167
|
+
name: 'operation',
|
|
168
|
+
type: 'options',
|
|
169
|
+
noDataExpression: true,
|
|
170
|
+
displayOptions: { show: { resource: ['loadBalancer'] } },
|
|
171
|
+
options: [
|
|
172
|
+
{ name: 'Create', value: 'create', description: 'Create a load balancer', action: 'Create a load balancer' },
|
|
173
|
+
{ name: 'Delete', value: 'delete', description: 'Delete a load balancer', action: 'Delete a load balancer' },
|
|
174
|
+
{ name: 'Get', value: 'get', description: 'Get a load balancer', action: 'Get a load balancer' },
|
|
175
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get many load balancers', action: 'Get many load balancers' },
|
|
176
|
+
],
|
|
177
|
+
default: 'getAll',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
displayName: 'Operation',
|
|
181
|
+
name: 'operation',
|
|
182
|
+
type: 'options',
|
|
183
|
+
noDataExpression: true,
|
|
184
|
+
displayOptions: { show: { resource: ['project'] } },
|
|
185
|
+
options: [
|
|
186
|
+
{ name: 'Create', value: 'create', description: 'Create a project', action: 'Create a project' },
|
|
187
|
+
{ name: 'Delete', value: 'delete', description: 'Delete a project', action: 'Delete a project' },
|
|
188
|
+
{ name: 'Get', value: 'get', description: 'Get a project', action: 'Get a project' },
|
|
189
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get many projects', action: 'Get many projects' },
|
|
190
|
+
],
|
|
191
|
+
default: 'getAll',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
displayName: 'Operation',
|
|
195
|
+
name: 'operation',
|
|
196
|
+
type: 'options',
|
|
197
|
+
noDataExpression: true,
|
|
198
|
+
displayOptions: { show: { resource: ['reservedIp'] } },
|
|
199
|
+
options: [
|
|
200
|
+
{ name: 'Create', value: 'create', description: 'Create a reserved IP', action: 'Create a reserved IP' },
|
|
201
|
+
{ name: 'Delete', value: 'delete', description: 'Delete a reserved IP', action: 'Delete a reserved IP' },
|
|
202
|
+
{ name: 'Get', value: 'get', description: 'Get a reserved IP', action: 'Get a reserved IP' },
|
|
203
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get many reserved IPs', action: 'Get many reserved i ps' },
|
|
204
|
+
],
|
|
205
|
+
default: 'getAll',
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
displayName: 'Operation',
|
|
209
|
+
name: 'operation',
|
|
210
|
+
type: 'options',
|
|
211
|
+
noDataExpression: true,
|
|
212
|
+
displayOptions: { show: { resource: ['snapshot'] } },
|
|
213
|
+
options: [
|
|
214
|
+
{ name: 'Delete', value: 'delete', description: 'Delete a snapshot', action: 'Delete a snapshot' },
|
|
215
|
+
{ name: 'Get', value: 'get', description: 'Get a snapshot', action: 'Get a snapshot' },
|
|
216
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get many snapshots', action: 'Get many snapshots' },
|
|
217
|
+
],
|
|
218
|
+
default: 'getAll',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
displayName: 'Operation',
|
|
222
|
+
name: 'operation',
|
|
223
|
+
type: 'options',
|
|
224
|
+
noDataExpression: true,
|
|
225
|
+
displayOptions: { show: { resource: ['sshKey'] } },
|
|
226
|
+
options: [
|
|
227
|
+
{ name: 'Create', value: 'create', description: 'Create an SSH key', action: 'Create an SSH key' },
|
|
228
|
+
{ name: 'Delete', value: 'delete', description: 'Delete an SSH key', action: 'Delete an SSH key' },
|
|
229
|
+
{ name: 'Get', value: 'get', description: 'Get an SSH key', action: 'Get an SSH key' },
|
|
230
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get many SSH keys', action: 'Get many SSH keys' },
|
|
231
|
+
],
|
|
232
|
+
default: 'getAll',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
displayName: 'Droplet Name or ID',
|
|
236
|
+
name: 'dropletId',
|
|
237
|
+
type: 'options',
|
|
238
|
+
required: true,
|
|
239
|
+
typeOptions: { loadOptionsMethod: 'getDroplets' },
|
|
240
|
+
displayOptions: {
|
|
241
|
+
show: {
|
|
242
|
+
resource: ['droplet'],
|
|
243
|
+
operation: ['get', 'delete', 'reboot', 'shutdown', 'powerOn', 'powerOff'],
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
default: '',
|
|
247
|
+
description: 'The droplet to operate on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
displayName: 'Name',
|
|
251
|
+
name: 'dropletName',
|
|
252
|
+
type: 'string',
|
|
253
|
+
required: true,
|
|
254
|
+
displayOptions: { show: { resource: ['droplet'], operation: ['create'] } },
|
|
255
|
+
default: '',
|
|
256
|
+
description: 'The name of the droplet',
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
displayName: 'Region',
|
|
260
|
+
name: 'dropletRegion',
|
|
261
|
+
type: 'options',
|
|
262
|
+
required: true,
|
|
263
|
+
displayOptions: { show: { resource: ['droplet'], operation: ['create'] } },
|
|
264
|
+
options: [
|
|
265
|
+
{ name: 'Amsterdam (Ams1)', value: 'ams1' },
|
|
266
|
+
{ name: 'Amsterdam (Ams2)', value: 'ams2' },
|
|
267
|
+
{ name: 'Amsterdam (Ams3)', value: 'ams3' },
|
|
268
|
+
{ name: 'Bangalore (Blr1)', value: 'blr1' },
|
|
269
|
+
{ name: 'Frankfurt (Fra1)', value: 'fra1' },
|
|
270
|
+
{ name: 'London (Lon1)', value: 'lon1' },
|
|
271
|
+
{ name: 'New York (Nyc1)', value: 'nyc1' },
|
|
272
|
+
{ name: 'New York (Nyc2)', value: 'nyc2' },
|
|
273
|
+
{ name: 'New York (Nyc3)', value: 'nyc3' },
|
|
274
|
+
{ name: 'San Francisco (Sfo1)', value: 'sfo1' },
|
|
275
|
+
{ name: 'San Francisco (Sfo2)', value: 'sfo2' },
|
|
276
|
+
{ name: 'San Francisco (Sfo3)', value: 'sfo3' },
|
|
277
|
+
{ name: 'Singapore (Sgp1)', value: 'sgp1' },
|
|
278
|
+
{ name: 'Sydney (Syd1)', value: 'syd1' },
|
|
279
|
+
{ name: 'Toronto (Tor1)', value: 'tor1' },
|
|
280
|
+
],
|
|
281
|
+
default: 'nyc1',
|
|
282
|
+
description: 'The region where the droplet will be created',
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
displayName: 'Size',
|
|
286
|
+
name: 'dropletSize',
|
|
287
|
+
type: 'options',
|
|
288
|
+
required: true,
|
|
289
|
+
displayOptions: { show: { resource: ['droplet'], operation: ['create'] } },
|
|
290
|
+
options: [
|
|
291
|
+
{ name: 's-1vcpu-1gb', value: 's-1vcpu-1gb' },
|
|
292
|
+
{ name: 's-1vcpu-2gb', value: 's-1vcpu-2gb' },
|
|
293
|
+
{ name: 's-2vcpu-2gb', value: 's-2vcpu-2gb' },
|
|
294
|
+
{ name: 's-2vcpu-4gb', value: 's-2vcpu-4gb' },
|
|
295
|
+
{ name: 's-4vcpu-8gb', value: 's-4vcpu-8gb' },
|
|
296
|
+
{ name: 's-8vcpu-16gb', value: 's-8vcpu-16gb' },
|
|
297
|
+
{ name: 's-8vcpu-32gb', value: 's-8vcpu-32gb' },
|
|
298
|
+
{ name: 's-16vcpu-64gb', value: 's-16vcpu-64gb' },
|
|
299
|
+
],
|
|
300
|
+
default: 's-1vcpu-1gb',
|
|
301
|
+
description: 'The size slug for the droplet',
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
displayName: 'Image Name or ID',
|
|
305
|
+
name: 'dropletImage',
|
|
306
|
+
type: 'options',
|
|
307
|
+
required: true,
|
|
308
|
+
typeOptions: { loadOptionsMethod: 'getImages' },
|
|
309
|
+
displayOptions: { show: { resource: ['droplet'], operation: ['create'] } },
|
|
310
|
+
default: '',
|
|
311
|
+
description: 'The image to use for the droplet. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
displayName: 'Additional Fields',
|
|
315
|
+
name: 'additionalFields',
|
|
316
|
+
type: 'collection',
|
|
317
|
+
placeholder: 'Add Field',
|
|
318
|
+
default: {},
|
|
319
|
+
displayOptions: { show: { resource: ['droplet'], operation: ['create'] } },
|
|
320
|
+
options: [
|
|
321
|
+
{ displayName: 'Backups', name: 'backups', type: 'boolean', default: false, description: 'Whether to enable automated backups' },
|
|
322
|
+
{ displayName: 'IPv6', name: 'ipv6', type: 'boolean', default: false, description: 'Whether to enable IPv6' },
|
|
323
|
+
{ displayName: 'Monitoring', name: 'monitoring', type: 'boolean', default: true, description: 'Whether to enable monitoring' },
|
|
324
|
+
{ displayName: 'Private Networking', name: 'privateNetworking', type: 'boolean', default: false, description: 'Whether to enable private networking' },
|
|
325
|
+
{ displayName: 'SSH Key Names or IDs', name: 'sshKeys', type: 'multiOptions', typeOptions: { loadOptionsMethod: 'getSshKeys' }, default: [], description: 'SSH keys to add to the droplet. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' },
|
|
326
|
+
{ displayName: 'Tags', name: 'tags', type: 'string', default: '', description: 'Comma-separated list of tags' },
|
|
327
|
+
{ displayName: 'User Data', name: 'userData', type: 'string', default: '', description: 'Cloud-init user data script' },
|
|
328
|
+
{ displayName: 'Volume Names or IDs', name: 'volumes', type: 'multiOptions', typeOptions: { loadOptionsMethod: 'getVolumes' }, default: [], description: 'Volumes to attach to the droplet. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' },
|
|
329
|
+
{ displayName: 'VPC UUID Name or ID', name: 'vpcUuid', type: 'options', typeOptions: { loadOptionsMethod: 'getVpcs' }, default: '', description: 'The VPC to place the droplet in. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' },
|
|
330
|
+
],
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
displayName: 'Volume Name or ID',
|
|
334
|
+
name: 'volumeId',
|
|
335
|
+
type: 'options',
|
|
336
|
+
required: true,
|
|
337
|
+
typeOptions: { loadOptionsMethod: 'getVolumes' },
|
|
338
|
+
displayOptions: { show: { resource: ['volume'], operation: ['get', 'delete'] } },
|
|
339
|
+
default: '',
|
|
340
|
+
description: 'The volume to operate on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
displayName: 'Name',
|
|
344
|
+
name: 'volumeName',
|
|
345
|
+
type: 'string',
|
|
346
|
+
required: true,
|
|
347
|
+
displayOptions: { show: { resource: ['volume'], operation: ['create'] } },
|
|
348
|
+
default: '',
|
|
349
|
+
description: 'The name of the volume',
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
displayName: 'Size (GB)',
|
|
353
|
+
name: 'volumeSizeGigabytes',
|
|
354
|
+
type: 'number',
|
|
355
|
+
required: true,
|
|
356
|
+
typeOptions: { minValue: 1, maxValue: 16000 },
|
|
357
|
+
displayOptions: { show: { resource: ['volume'], operation: ['create'] } },
|
|
358
|
+
default: 10,
|
|
359
|
+
description: 'The size of the volume in GB',
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
displayName: 'Region',
|
|
363
|
+
name: 'volumeRegion',
|
|
364
|
+
type: 'options',
|
|
365
|
+
required: true,
|
|
366
|
+
displayOptions: { show: { resource: ['volume'], operation: ['create'] } },
|
|
367
|
+
options: [
|
|
368
|
+
{ name: 'Amsterdam (Ams1)', value: 'ams1' },
|
|
369
|
+
{ name: 'Amsterdam (Ams2)', value: 'ams2' },
|
|
370
|
+
{ name: 'Amsterdam (Ams3)', value: 'ams3' },
|
|
371
|
+
{ name: 'Bangalore (Blr1)', value: 'blr1' },
|
|
372
|
+
{ name: 'Frankfurt (Fra1)', value: 'fra1' },
|
|
373
|
+
{ name: 'London (Lon1)', value: 'lon1' },
|
|
374
|
+
{ name: 'New York (Nyc1)', value: 'nyc1' },
|
|
375
|
+
{ name: 'New York (Nyc2)', value: 'nyc2' },
|
|
376
|
+
{ name: 'New York (Nyc3)', value: 'nyc3' },
|
|
377
|
+
{ name: 'San Francisco (Sfo1)', value: 'sfo1' },
|
|
378
|
+
{ name: 'San Francisco (Sfo2)', value: 'sfo2' },
|
|
379
|
+
{ name: 'San Francisco (Sfo3)', value: 'sfo3' },
|
|
380
|
+
{ name: 'Singapore (Sgp1)', value: 'sgp1' },
|
|
381
|
+
{ name: 'Sydney (Syd1)', value: 'syd1' },
|
|
382
|
+
{ name: 'Toronto (Tor1)', value: 'tor1' },
|
|
383
|
+
],
|
|
384
|
+
default: 'nyc1',
|
|
385
|
+
description: 'The region where the volume will be created',
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
displayName: 'Description',
|
|
389
|
+
name: 'volumeDescription',
|
|
390
|
+
type: 'string',
|
|
391
|
+
displayOptions: { show: { resource: ['volume'], operation: ['create'] } },
|
|
392
|
+
default: '',
|
|
393
|
+
description: 'A description for the volume',
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
displayName: 'Snapshot Name or ID',
|
|
397
|
+
name: 'volumeSnapshotId',
|
|
398
|
+
type: 'options',
|
|
399
|
+
typeOptions: { loadOptionsMethod: 'getSnapshots' },
|
|
400
|
+
displayOptions: { show: { resource: ['volume'], operation: ['create'] } },
|
|
401
|
+
default: '',
|
|
402
|
+
description: 'Create volume from a snapshot. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
displayName: 'Database Name or ID',
|
|
406
|
+
name: 'databaseId',
|
|
407
|
+
type: 'options',
|
|
408
|
+
required: true,
|
|
409
|
+
typeOptions: { loadOptionsMethod: 'getDatabases' },
|
|
410
|
+
displayOptions: { show: { resource: ['database'], operation: ['get', 'delete'] } },
|
|
411
|
+
default: '',
|
|
412
|
+
description: 'The database cluster to operate on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
displayName: 'Name',
|
|
416
|
+
name: 'databaseName',
|
|
417
|
+
type: 'string',
|
|
418
|
+
required: true,
|
|
419
|
+
displayOptions: { show: { resource: ['database'], operation: ['create'] } },
|
|
420
|
+
default: '',
|
|
421
|
+
description: 'The name of the database cluster',
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
displayName: 'Engine',
|
|
425
|
+
name: 'databaseEngine',
|
|
426
|
+
type: 'options',
|
|
427
|
+
required: true,
|
|
428
|
+
displayOptions: { show: { resource: ['database'], operation: ['create'] } },
|
|
429
|
+
options: [
|
|
430
|
+
{ name: 'MySQL', value: 'mysql' },
|
|
431
|
+
{ name: 'PostgreSQL', value: 'pg' },
|
|
432
|
+
{ name: 'Redis', value: 'redis' },
|
|
433
|
+
{ name: 'MongoDB', value: 'mongodb' },
|
|
434
|
+
],
|
|
435
|
+
default: 'pg',
|
|
436
|
+
description: 'The database engine',
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
displayName: 'Version',
|
|
440
|
+
name: 'databaseVersion',
|
|
441
|
+
type: 'string',
|
|
442
|
+
displayOptions: { show: { resource: ['database'], operation: ['create'] } },
|
|
443
|
+
default: '',
|
|
444
|
+
description: 'The engine version (e.g., 14 for PostgreSQL)',
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
displayName: 'Region',
|
|
448
|
+
name: 'databaseRegion',
|
|
449
|
+
type: 'options',
|
|
450
|
+
required: true,
|
|
451
|
+
displayOptions: { show: { resource: ['database'], operation: ['create'] } },
|
|
452
|
+
options: [
|
|
453
|
+
{ name: 'Amsterdam (Ams3)', value: 'ams3' },
|
|
454
|
+
{ name: 'Bangalore (Blr1)', value: 'blr1' },
|
|
455
|
+
{ name: 'Frankfurt (Fra1)', value: 'fra1' },
|
|
456
|
+
{ name: 'London (Lon1)', value: 'lon1' },
|
|
457
|
+
{ name: 'New York (Nyc1)', value: 'nyc1' },
|
|
458
|
+
{ name: 'New York (Nyc3)', value: 'nyc3' },
|
|
459
|
+
{ name: 'San Francisco (Sfo2)', value: 'sfo2' },
|
|
460
|
+
{ name: 'San Francisco (Sfo3)', value: 'sfo3' },
|
|
461
|
+
{ name: 'Singapore (Sgp1)', value: 'sgp1' },
|
|
462
|
+
{ name: 'Sydney (Syd1)', value: 'syd1' },
|
|
463
|
+
{ name: 'Toronto (Tor1)', value: 'tor1' },
|
|
464
|
+
],
|
|
465
|
+
default: 'nyc1',
|
|
466
|
+
description: 'The region where the database will be created',
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
displayName: 'Size',
|
|
470
|
+
name: 'databaseSize',
|
|
471
|
+
type: 'options',
|
|
472
|
+
required: true,
|
|
473
|
+
displayOptions: { show: { resource: ['database'], operation: ['create'] } },
|
|
474
|
+
options: [
|
|
475
|
+
{ name: 'db-s-1vcpu-1gb', value: 'db-s-1vcpu-1gb' },
|
|
476
|
+
{ name: 'db-s-1vcpu-2gb', value: 'db-s-1vcpu-2gb' },
|
|
477
|
+
{ name: 'db-s-2vcpu-4gb', value: 'db-s-2vcpu-4gb' },
|
|
478
|
+
{ name: 'db-s-4vcpu-8gb', value: 'db-s-4vcpu-8gb' },
|
|
479
|
+
{ name: 'db-s-6vcpu-16gb', value: 'db-s-6vcpu-16gb' },
|
|
480
|
+
{ name: 'db-s-8vcpu-32gb', value: 'db-s-8vcpu-32gb' },
|
|
481
|
+
],
|
|
482
|
+
default: 'db-s-1vcpu-1gb',
|
|
483
|
+
description: 'The database size slug',
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
displayName: 'Number of Nodes',
|
|
487
|
+
name: 'databaseNumNodes',
|
|
488
|
+
type: 'number',
|
|
489
|
+
typeOptions: { minValue: 1, maxValue: 3 },
|
|
490
|
+
displayOptions: { show: { resource: ['database'], operation: ['create'] } },
|
|
491
|
+
default: 1,
|
|
492
|
+
description: 'Number of nodes in the cluster (1-3)',
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
displayName: 'Domain Name or ID',
|
|
496
|
+
name: 'domainName',
|
|
497
|
+
type: 'options',
|
|
498
|
+
required: true,
|
|
499
|
+
typeOptions: { loadOptionsMethod: 'getDomains' },
|
|
500
|
+
displayOptions: { show: { resource: ['domain'], operation: ['get', 'delete', 'getRecords'] } },
|
|
501
|
+
default: '',
|
|
502
|
+
description: 'The domain to operate on. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code/expressions/">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
displayName: 'Domain Name',
|
|
506
|
+
name: 'domainNameCreate',
|
|
507
|
+
type: 'string',
|
|
508
|
+
required: true,
|
|
509
|
+
displayOptions: { show: { resource: ['domain'], operation: ['create'] } },
|
|
510
|
+
default: '',
|
|
511
|
+
description: 'The domain name to create',
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
displayName: 'IP Address',
|
|
515
|
+
name: 'domainIp',
|
|
516
|
+
type: 'string',
|
|
517
|
+
displayOptions: { show: { resource: ['domain'], operation: ['create'] } },
|
|
518
|
+
default: '',
|
|
519
|
+
description: 'IP address to create an A record for the domain',
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
displayName: 'Image Name or ID',
|
|
523
|
+
name: 'imageId',
|
|
524
|
+
type: 'options',
|
|
525
|
+
required: true,
|
|
526
|
+
typeOptions: { loadOptionsMethod: 'getImages' },
|
|
527
|
+
displayOptions: { show: { resource: ['image'], operation: ['get', 'delete'] } },
|
|
528
|
+
default: '',
|
|
529
|
+
description: 'The image to operate on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
displayName: 'Cluster Name or ID',
|
|
533
|
+
name: 'clusterId',
|
|
534
|
+
type: 'options',
|
|
535
|
+
required: true,
|
|
536
|
+
typeOptions: { loadOptionsMethod: 'getClusters' },
|
|
537
|
+
displayOptions: { show: { resource: ['kubernetes'], operation: ['getCluster', 'deleteCluster', 'getKubeconfig'] } },
|
|
538
|
+
default: '',
|
|
539
|
+
description: 'The Kubernetes cluster to operate on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
displayName: 'Load Balancer Name or ID',
|
|
543
|
+
name: 'loadBalancerId',
|
|
544
|
+
type: 'options',
|
|
545
|
+
required: true,
|
|
546
|
+
typeOptions: { loadOptionsMethod: 'getLoadBalancers' },
|
|
547
|
+
displayOptions: { show: { resource: ['loadBalancer'], operation: ['get', 'delete'] } },
|
|
548
|
+
default: '',
|
|
549
|
+
description: 'The load balancer to operate on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
displayName: 'Name',
|
|
553
|
+
name: 'loadBalancerName',
|
|
554
|
+
type: 'string',
|
|
555
|
+
required: true,
|
|
556
|
+
displayOptions: { show: { resource: ['loadBalancer'], operation: ['create'] } },
|
|
557
|
+
default: '',
|
|
558
|
+
description: 'The name of the load balancer',
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
displayName: 'Region',
|
|
562
|
+
name: 'loadBalancerRegion',
|
|
563
|
+
type: 'options',
|
|
564
|
+
required: true,
|
|
565
|
+
displayOptions: { show: { resource: ['loadBalancer'], operation: ['create'] } },
|
|
566
|
+
options: [
|
|
567
|
+
{ name: 'Amsterdam (Ams1)', value: 'ams1' },
|
|
568
|
+
{ name: 'Amsterdam (Ams2)', value: 'ams2' },
|
|
569
|
+
{ name: 'Amsterdam (Ams3)', value: 'ams3' },
|
|
570
|
+
{ name: 'Bangalore (Blr1)', value: 'blr1' },
|
|
571
|
+
{ name: 'Frankfurt (Fra1)', value: 'fra1' },
|
|
572
|
+
{ name: 'London (Lon1)', value: 'lon1' },
|
|
573
|
+
{ name: 'New York (Nyc1)', value: 'nyc1' },
|
|
574
|
+
{ name: 'New York (Nyc2)', value: 'nyc2' },
|
|
575
|
+
{ name: 'New York (Nyc3)', value: 'nyc3' },
|
|
576
|
+
{ name: 'San Francisco (Sfo1)', value: 'sfo1' },
|
|
577
|
+
{ name: 'San Francisco (Sfo2)', value: 'sfo2' },
|
|
578
|
+
{ name: 'San Francisco (Sfo3)', value: 'sfo3' },
|
|
579
|
+
{ name: 'Singapore (Sgp1)', value: 'sgp1' },
|
|
580
|
+
{ name: 'Sydney (Syd1)', value: 'syd1' },
|
|
581
|
+
{ name: 'Toronto (Tor1)', value: 'tor1' },
|
|
582
|
+
],
|
|
583
|
+
default: 'nyc1',
|
|
584
|
+
description: 'The region where the load balancer will be created',
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
displayName: 'Droplet ID Names or IDs',
|
|
588
|
+
name: 'loadBalancerDropletIds',
|
|
589
|
+
type: 'multiOptions',
|
|
590
|
+
typeOptions: { loadOptionsMethod: 'getDroplets' },
|
|
591
|
+
displayOptions: { show: { resource: ['loadBalancer'], operation: ['create'] } },
|
|
592
|
+
default: [],
|
|
593
|
+
description: 'Droplets to add to the load balancer. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
displayName: 'Project Name or ID',
|
|
597
|
+
name: 'projectId',
|
|
598
|
+
type: 'options',
|
|
599
|
+
required: true,
|
|
600
|
+
typeOptions: { loadOptionsMethod: 'getProjects' },
|
|
601
|
+
displayOptions: { show: { resource: ['project'], operation: ['get', 'delete'] } },
|
|
602
|
+
default: '',
|
|
603
|
+
description: 'The project to operate on. Choose from the list, or specify a UUID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
displayName: 'Name',
|
|
607
|
+
name: 'projectName',
|
|
608
|
+
type: 'string',
|
|
609
|
+
required: true,
|
|
610
|
+
displayOptions: { show: { resource: ['project'], operation: ['create'] } },
|
|
611
|
+
default: '',
|
|
612
|
+
description: 'The name of the project',
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
displayName: 'Description',
|
|
616
|
+
name: 'projectDescription',
|
|
617
|
+
type: 'string',
|
|
618
|
+
displayOptions: { show: { resource: ['project'], operation: ['create'] } },
|
|
619
|
+
default: '',
|
|
620
|
+
description: 'A description for the project',
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
displayName: 'Purpose',
|
|
624
|
+
name: 'projectPurpose',
|
|
625
|
+
type: 'string',
|
|
626
|
+
displayOptions: { show: { resource: ['project'], operation: ['create'] } },
|
|
627
|
+
default: '',
|
|
628
|
+
description: 'The purpose of the project',
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
displayName: 'Environment',
|
|
632
|
+
name: 'projectEnvironment',
|
|
633
|
+
type: 'options',
|
|
634
|
+
displayOptions: { show: { resource: ['project'], operation: ['create'] } },
|
|
635
|
+
options: [
|
|
636
|
+
{ name: 'Development', value: 'Development' },
|
|
637
|
+
{ name: 'Staging', value: 'Staging' },
|
|
638
|
+
{ name: 'Production', value: 'Production' },
|
|
639
|
+
],
|
|
640
|
+
default: 'Development',
|
|
641
|
+
description: 'The environment of the project',
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
displayName: 'Reserved IP Name or ID',
|
|
645
|
+
name: 'reservedIp',
|
|
646
|
+
type: 'options',
|
|
647
|
+
required: true,
|
|
648
|
+
typeOptions: { loadOptionsMethod: 'getReservedIps' },
|
|
649
|
+
displayOptions: { show: { resource: ['reservedIp'], operation: ['get', 'delete'] } },
|
|
650
|
+
default: '',
|
|
651
|
+
description: 'The reserved IP to operate on. Choose from the list, or specify an IP using an <a href="https://docs.n8n.io/code/expressions/">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
displayName: 'Region',
|
|
655
|
+
name: 'reservedIpRegion',
|
|
656
|
+
type: 'options',
|
|
657
|
+
required: true,
|
|
658
|
+
displayOptions: { show: { resource: ['reservedIp'], operation: ['create'] } },
|
|
659
|
+
options: [
|
|
660
|
+
{ name: 'Amsterdam (Ams1)', value: 'ams1' },
|
|
661
|
+
{ name: 'Amsterdam (Ams2)', value: 'ams2' },
|
|
662
|
+
{ name: 'Amsterdam (Ams3)', value: 'ams3' },
|
|
663
|
+
{ name: 'Bangalore (Blr1)', value: 'blr1' },
|
|
664
|
+
{ name: 'Frankfurt (Fra1)', value: 'fra1' },
|
|
665
|
+
{ name: 'London (Lon1)', value: 'lon1' },
|
|
666
|
+
{ name: 'New York (Nyc1)', value: 'nyc1' },
|
|
667
|
+
{ name: 'New York (Nyc2)', value: 'nyc2' },
|
|
668
|
+
{ name: 'New York (Nyc3)', value: 'nyc3' },
|
|
669
|
+
{ name: 'San Francisco (Sfo1)', value: 'sfo1' },
|
|
670
|
+
{ name: 'San Francisco (Sfo2)', value: 'sfo2' },
|
|
671
|
+
{ name: 'San Francisco (Sfo3)', value: 'sfo3' },
|
|
672
|
+
{ name: 'Singapore (Sgp1)', value: 'sgp1' },
|
|
673
|
+
{ name: 'Sydney (Syd1)', value: 'syd1' },
|
|
674
|
+
{ name: 'Toronto (Tor1)', value: 'tor1' },
|
|
675
|
+
],
|
|
676
|
+
default: 'nyc1',
|
|
677
|
+
description: 'The region where the reserved IP will be created',
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
displayName: 'Droplet Name or ID',
|
|
681
|
+
name: 'reservedIpDropletId',
|
|
682
|
+
type: 'options',
|
|
683
|
+
typeOptions: { loadOptionsMethod: 'getDroplets' },
|
|
684
|
+
displayOptions: { show: { resource: ['reservedIp'], operation: ['create'] } },
|
|
685
|
+
default: '',
|
|
686
|
+
description: 'The droplet to assign the reserved IP to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
displayName: 'Snapshot Name or ID',
|
|
690
|
+
name: 'snapshotId',
|
|
691
|
+
type: 'options',
|
|
692
|
+
required: true,
|
|
693
|
+
typeOptions: { loadOptionsMethod: 'getSnapshots' },
|
|
694
|
+
displayOptions: { show: { resource: ['snapshot'], operation: ['get', 'delete'] } },
|
|
695
|
+
default: '',
|
|
696
|
+
description: 'The snapshot to operate on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
displayName: 'SSH Key Name or ID',
|
|
700
|
+
name: 'sshKeyId',
|
|
701
|
+
type: 'options',
|
|
702
|
+
required: true,
|
|
703
|
+
typeOptions: { loadOptionsMethod: 'getSshKeys' },
|
|
704
|
+
displayOptions: { show: { resource: ['sshKey'], operation: ['get', 'delete'] } },
|
|
705
|
+
default: '',
|
|
706
|
+
description: 'The SSH key to operate on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
displayName: 'Name',
|
|
710
|
+
name: 'sshKeyName',
|
|
711
|
+
type: 'string',
|
|
712
|
+
required: true,
|
|
713
|
+
displayOptions: { show: { resource: ['sshKey'], operation: ['create'] } },
|
|
714
|
+
default: '',
|
|
715
|
+
description: 'The name for the SSH key',
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
displayName: 'Public Key',
|
|
719
|
+
name: 'sshPublicKey',
|
|
720
|
+
type: 'string',
|
|
721
|
+
required: true,
|
|
722
|
+
displayOptions: { show: { resource: ['sshKey'], operation: ['create'] } },
|
|
723
|
+
default: '',
|
|
724
|
+
description: 'The SSH public key',
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
displayName: 'VPC Name or ID',
|
|
728
|
+
name: 'vpcId',
|
|
729
|
+
type: 'options',
|
|
730
|
+
required: true,
|
|
731
|
+
typeOptions: { loadOptionsMethod: 'getVpcs' },
|
|
732
|
+
displayOptions: { show: { resource: ['vpc'], operation: ['get', 'delete'] } },
|
|
733
|
+
default: '',
|
|
734
|
+
description: 'The VPC to operate on. Choose from the list, or specify a UUID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
displayName: 'Name',
|
|
738
|
+
name: 'vpcName',
|
|
739
|
+
type: 'string',
|
|
740
|
+
required: true,
|
|
741
|
+
displayOptions: { show: { resource: ['vpc'], operation: ['create'] } },
|
|
742
|
+
default: '',
|
|
743
|
+
description: 'The name of the VPC',
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
displayName: 'Region',
|
|
747
|
+
name: 'vpcRegion',
|
|
748
|
+
type: 'options',
|
|
749
|
+
required: true,
|
|
750
|
+
displayOptions: { show: { resource: ['vpc'], operation: ['create'] } },
|
|
751
|
+
options: [
|
|
752
|
+
{ name: 'Amsterdam (Ams3)', value: 'ams3' },
|
|
753
|
+
{ name: 'Bangalore (Blr1)', value: 'blr1' },
|
|
754
|
+
{ name: 'Frankfurt (Fra1)', value: 'fra1' },
|
|
755
|
+
{ name: 'London (Lon1)', value: 'lon1' },
|
|
756
|
+
{ name: 'New York (Nyc1)', value: 'nyc1' },
|
|
757
|
+
{ name: 'New York (Nyc3)', value: 'nyc3' },
|
|
758
|
+
{ name: 'San Francisco (Sfo2)', value: 'sfo2' },
|
|
759
|
+
{ name: 'San Francisco (Sfo3)', value: 'sfo3' },
|
|
760
|
+
{ name: 'Singapore (Sgp1)', value: 'sgp1' },
|
|
761
|
+
{ name: 'Sydney (Syd1)', value: 'syd1' },
|
|
762
|
+
{ name: 'Toronto (Tor1)', value: 'tor1' },
|
|
763
|
+
],
|
|
764
|
+
default: 'nyc1',
|
|
765
|
+
description: 'The region where the VPC will be created',
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
displayName: 'Description',
|
|
769
|
+
name: 'vpcDescription',
|
|
770
|
+
type: 'string',
|
|
771
|
+
displayOptions: { show: { resource: ['vpc'], operation: ['create'] } },
|
|
772
|
+
default: '',
|
|
773
|
+
description: 'A description for the VPC',
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
displayName: 'IP Range',
|
|
777
|
+
name: 'vpcIpRange',
|
|
778
|
+
type: 'string',
|
|
779
|
+
displayOptions: { show: { resource: ['vpc'], operation: ['create'] } },
|
|
780
|
+
default: '',
|
|
781
|
+
description: 'The IP range for the VPC (e.g., 10.116.0.0/20)',
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
displayName: 'Return All',
|
|
785
|
+
name: 'returnAll',
|
|
786
|
+
type: 'boolean',
|
|
787
|
+
displayOptions: {
|
|
788
|
+
show: {
|
|
789
|
+
operation: ['getAll', 'getAllClusters', 'getRecords'],
|
|
790
|
+
},
|
|
791
|
+
},
|
|
792
|
+
default: false,
|
|
793
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
displayName: 'Limit',
|
|
797
|
+
name: 'limit',
|
|
798
|
+
type: 'number',
|
|
799
|
+
displayOptions: {
|
|
800
|
+
show: {
|
|
801
|
+
operation: ['getAll', 'getAllClusters', 'getRecords'],
|
|
802
|
+
returnAll: [false],
|
|
803
|
+
},
|
|
804
|
+
},
|
|
805
|
+
typeOptions: { minValue: 1, maxValue: 1000 },
|
|
806
|
+
default: 50,
|
|
807
|
+
description: 'Max number of results to return',
|
|
808
|
+
},
|
|
809
|
+
],
|
|
810
|
+
usableAsTool: true,
|
|
811
|
+
};
|
|
812
|
+
this.methods = {
|
|
813
|
+
loadOptions: {
|
|
814
|
+
async getDroplets() {
|
|
815
|
+
const returnData = [];
|
|
816
|
+
try {
|
|
817
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
818
|
+
const response = await this.helpers.httpRequest({
|
|
819
|
+
method: 'GET',
|
|
820
|
+
url: `${BASE_URL}/droplets`,
|
|
821
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
822
|
+
qs: { per_page: 200 },
|
|
823
|
+
});
|
|
824
|
+
if (response === null || response === void 0 ? void 0 : response.droplets) {
|
|
825
|
+
for (const item of response.droplets) {
|
|
826
|
+
returnData.push({
|
|
827
|
+
name: `${item.name} (ID: ${item.id})`,
|
|
828
|
+
value: item.id.toString(),
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
catch (error) { }
|
|
834
|
+
return returnData;
|
|
835
|
+
},
|
|
836
|
+
async getVolumes() {
|
|
837
|
+
const returnData = [];
|
|
838
|
+
try {
|
|
839
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
840
|
+
const response = await this.helpers.httpRequest({
|
|
841
|
+
method: 'GET',
|
|
842
|
+
url: `${BASE_URL}/volumes`,
|
|
843
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
844
|
+
qs: { per_page: 200 },
|
|
845
|
+
});
|
|
846
|
+
if (response === null || response === void 0 ? void 0 : response.volumes) {
|
|
847
|
+
for (const item of response.volumes) {
|
|
848
|
+
returnData.push({
|
|
849
|
+
name: `${item.name} (${item.size_gigabytes}GB)`,
|
|
850
|
+
value: item.id,
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
catch (error) { }
|
|
856
|
+
return returnData;
|
|
857
|
+
},
|
|
858
|
+
async getDatabases() {
|
|
859
|
+
const returnData = [];
|
|
860
|
+
try {
|
|
861
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
862
|
+
const response = await this.helpers.httpRequest({
|
|
863
|
+
method: 'GET',
|
|
864
|
+
url: `${BASE_URL}/databases`,
|
|
865
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
866
|
+
qs: { per_page: 200 },
|
|
867
|
+
});
|
|
868
|
+
if (response === null || response === void 0 ? void 0 : response.databases) {
|
|
869
|
+
for (const item of response.databases) {
|
|
870
|
+
returnData.push({
|
|
871
|
+
name: `${item.name} (${item.engine})`,
|
|
872
|
+
value: item.id,
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
catch (error) { }
|
|
878
|
+
return returnData;
|
|
879
|
+
},
|
|
880
|
+
async getDomains() {
|
|
881
|
+
const returnData = [];
|
|
882
|
+
try {
|
|
883
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
884
|
+
const response = await this.helpers.httpRequest({
|
|
885
|
+
method: 'GET',
|
|
886
|
+
url: `${BASE_URL}/domains`,
|
|
887
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
888
|
+
qs: { per_page: 200 },
|
|
889
|
+
});
|
|
890
|
+
if (response === null || response === void 0 ? void 0 : response.domains) {
|
|
891
|
+
for (const item of response.domains) {
|
|
892
|
+
returnData.push({ name: item.name, value: item.name });
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
catch (error) { }
|
|
897
|
+
return returnData;
|
|
898
|
+
},
|
|
899
|
+
async getImages() {
|
|
900
|
+
const returnData = [];
|
|
901
|
+
try {
|
|
902
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
903
|
+
const response = await this.helpers.httpRequest({
|
|
904
|
+
method: 'GET',
|
|
905
|
+
url: `${BASE_URL}/images`,
|
|
906
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
907
|
+
qs: { per_page: 200, type: 'distribution' },
|
|
908
|
+
});
|
|
909
|
+
if (response === null || response === void 0 ? void 0 : response.images) {
|
|
910
|
+
for (const item of response.images) {
|
|
911
|
+
returnData.push({
|
|
912
|
+
name: `${item.name} (${item.distribution})`,
|
|
913
|
+
value: item.id.toString(),
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
catch (error) { }
|
|
919
|
+
return returnData;
|
|
920
|
+
},
|
|
921
|
+
async getClusters() {
|
|
922
|
+
const returnData = [];
|
|
923
|
+
try {
|
|
924
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
925
|
+
const response = await this.helpers.httpRequest({
|
|
926
|
+
method: 'GET',
|
|
927
|
+
url: `${BASE_URL}/kubernetes/clusters`,
|
|
928
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
929
|
+
qs: { per_page: 200 },
|
|
930
|
+
});
|
|
931
|
+
if (response === null || response === void 0 ? void 0 : response.kubernetes_clusters) {
|
|
932
|
+
for (const item of response.kubernetes_clusters) {
|
|
933
|
+
returnData.push({
|
|
934
|
+
name: `${item.name} (${item.region})`,
|
|
935
|
+
value: item.id,
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
catch (error) { }
|
|
941
|
+
return returnData;
|
|
942
|
+
},
|
|
943
|
+
async getLoadBalancers() {
|
|
944
|
+
var _a;
|
|
945
|
+
const returnData = [];
|
|
946
|
+
try {
|
|
947
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
948
|
+
const response = await this.helpers.httpRequest({
|
|
949
|
+
method: 'GET',
|
|
950
|
+
url: `${BASE_URL}/load_balancers`,
|
|
951
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
952
|
+
qs: { per_page: 200 },
|
|
953
|
+
});
|
|
954
|
+
if (response === null || response === void 0 ? void 0 : response.load_balancers) {
|
|
955
|
+
for (const item of response.load_balancers) {
|
|
956
|
+
returnData.push({
|
|
957
|
+
name: `${item.name} (${((_a = item.region) === null || _a === void 0 ? void 0 : _a.name) || item.region})`,
|
|
958
|
+
value: item.id,
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
catch (error) { }
|
|
964
|
+
return returnData;
|
|
965
|
+
},
|
|
966
|
+
async getProjects() {
|
|
967
|
+
const returnData = [];
|
|
968
|
+
try {
|
|
969
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
970
|
+
const response = await this.helpers.httpRequest({
|
|
971
|
+
method: 'GET',
|
|
972
|
+
url: `${BASE_URL}/projects`,
|
|
973
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
974
|
+
qs: { per_page: 200 },
|
|
975
|
+
});
|
|
976
|
+
if (response === null || response === void 0 ? void 0 : response.projects) {
|
|
977
|
+
for (const item of response.projects) {
|
|
978
|
+
returnData.push({ name: item.name, value: item.id });
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
catch (error) { }
|
|
983
|
+
return returnData;
|
|
984
|
+
},
|
|
985
|
+
async getReservedIps() {
|
|
986
|
+
const returnData = [];
|
|
987
|
+
try {
|
|
988
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
989
|
+
const response = await this.helpers.httpRequest({
|
|
990
|
+
method: 'GET',
|
|
991
|
+
url: `${BASE_URL}/reserved_ips`,
|
|
992
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
993
|
+
qs: { per_page: 200 },
|
|
994
|
+
});
|
|
995
|
+
if (response === null || response === void 0 ? void 0 : response.reserved_ips) {
|
|
996
|
+
for (const item of response.reserved_ips) {
|
|
997
|
+
returnData.push({ name: item.ip, value: item.ip });
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
catch (error) { }
|
|
1002
|
+
return returnData;
|
|
1003
|
+
},
|
|
1004
|
+
async getSnapshots() {
|
|
1005
|
+
const returnData = [];
|
|
1006
|
+
try {
|
|
1007
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
1008
|
+
const response = await this.helpers.httpRequest({
|
|
1009
|
+
method: 'GET',
|
|
1010
|
+
url: `${BASE_URL}/snapshots`,
|
|
1011
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
1012
|
+
qs: { per_page: 200 },
|
|
1013
|
+
});
|
|
1014
|
+
if (response === null || response === void 0 ? void 0 : response.snapshots) {
|
|
1015
|
+
for (const item of response.snapshots) {
|
|
1016
|
+
returnData.push({
|
|
1017
|
+
name: `${item.name} (${item.resource_type || 'snapshot'})`,
|
|
1018
|
+
value: item.id,
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
catch (error) { }
|
|
1024
|
+
return returnData;
|
|
1025
|
+
},
|
|
1026
|
+
async getSshKeys() {
|
|
1027
|
+
var _a;
|
|
1028
|
+
const returnData = [];
|
|
1029
|
+
try {
|
|
1030
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
1031
|
+
const response = await this.helpers.httpRequest({
|
|
1032
|
+
method: 'GET',
|
|
1033
|
+
url: `${BASE_URL}/account/keys`,
|
|
1034
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
1035
|
+
qs: { per_page: 200 },
|
|
1036
|
+
});
|
|
1037
|
+
if (response === null || response === void 0 ? void 0 : response.ssh_keys) {
|
|
1038
|
+
for (const item of response.ssh_keys) {
|
|
1039
|
+
returnData.push({
|
|
1040
|
+
name: `${item.name} (${(_a = item.fingerprint) === null || _a === void 0 ? void 0 : _a.substring(0, 8)}...)`,
|
|
1041
|
+
value: item.id.toString(),
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
catch (error) { }
|
|
1047
|
+
return returnData;
|
|
1048
|
+
},
|
|
1049
|
+
async getVpcs() {
|
|
1050
|
+
const returnData = [];
|
|
1051
|
+
try {
|
|
1052
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
1053
|
+
const response = await this.helpers.httpRequest({
|
|
1054
|
+
method: 'GET',
|
|
1055
|
+
url: `${BASE_URL}/vpcs`,
|
|
1056
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
1057
|
+
qs: { per_page: 200 },
|
|
1058
|
+
});
|
|
1059
|
+
if (response === null || response === void 0 ? void 0 : response.vpcs) {
|
|
1060
|
+
for (const item of response.vpcs) {
|
|
1061
|
+
returnData.push({
|
|
1062
|
+
name: `${item.name} (${item.region})`,
|
|
1063
|
+
value: item.id,
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
catch (error) { }
|
|
1069
|
+
return returnData;
|
|
1070
|
+
},
|
|
1071
|
+
async getFirewalls() {
|
|
1072
|
+
const returnData = [];
|
|
1073
|
+
try {
|
|
1074
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
1075
|
+
const response = await this.helpers.httpRequest({
|
|
1076
|
+
method: 'GET',
|
|
1077
|
+
url: `${BASE_URL}/firewalls`,
|
|
1078
|
+
headers: { Authorization: `Bearer ${credentials.accessToken}` },
|
|
1079
|
+
qs: { per_page: 200 },
|
|
1080
|
+
});
|
|
1081
|
+
if (response === null || response === void 0 ? void 0 : response.firewalls) {
|
|
1082
|
+
for (const item of response.firewalls) {
|
|
1083
|
+
returnData.push({ name: item.name, value: item.id });
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
catch (error) { }
|
|
1088
|
+
return returnData;
|
|
1089
|
+
},
|
|
1090
|
+
},
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
async execute() {
|
|
1094
|
+
var _a, _b;
|
|
1095
|
+
const items = this.getInputData();
|
|
1096
|
+
const returnData = [];
|
|
1097
|
+
const credentials = await this.getCredentials('digitalOceanApi');
|
|
1098
|
+
const headers = { Authorization: `Bearer ${credentials.accessToken}` };
|
|
1099
|
+
for (let i = 0; i < items.length; i++) {
|
|
1100
|
+
try {
|
|
1101
|
+
const resource = this.getNodeParameter('resource', i);
|
|
1102
|
+
const operation = this.getNodeParameter('operation', i);
|
|
1103
|
+
let responseData;
|
|
1104
|
+
if (resource === 'account') {
|
|
1105
|
+
const response = await this.helpers.httpRequest({
|
|
1106
|
+
method: 'GET',
|
|
1107
|
+
url: `${BASE_URL}/account`,
|
|
1108
|
+
headers,
|
|
1109
|
+
});
|
|
1110
|
+
responseData = response.account;
|
|
1111
|
+
}
|
|
1112
|
+
else if (resource === 'droplet') {
|
|
1113
|
+
if (operation === 'getAll') {
|
|
1114
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1115
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1116
|
+
responseData = await makePaginatedRequest.call(this, 'GET', '/droplets', {}, headers, limit);
|
|
1117
|
+
}
|
|
1118
|
+
else if (operation === 'get') {
|
|
1119
|
+
const dropletId = this.getNodeParameter('dropletId', i);
|
|
1120
|
+
const response = await this.helpers.httpRequest({
|
|
1121
|
+
method: 'GET',
|
|
1122
|
+
url: `${BASE_URL}/droplets/${dropletId}`,
|
|
1123
|
+
headers,
|
|
1124
|
+
});
|
|
1125
|
+
responseData = response.droplet;
|
|
1126
|
+
}
|
|
1127
|
+
else if (operation === 'create') {
|
|
1128
|
+
const name = this.getNodeParameter('dropletName', i);
|
|
1129
|
+
const region = this.getNodeParameter('dropletRegion', i);
|
|
1130
|
+
const size = this.getNodeParameter('dropletSize', i);
|
|
1131
|
+
const image = this.getNodeParameter('dropletImage', i);
|
|
1132
|
+
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
1133
|
+
const body = { name, region, size, image };
|
|
1134
|
+
if (additionalFields.backups)
|
|
1135
|
+
body.backups = true;
|
|
1136
|
+
if (additionalFields.ipv6)
|
|
1137
|
+
body.ipv6 = true;
|
|
1138
|
+
if (additionalFields.monitoring)
|
|
1139
|
+
body.monitoring = true;
|
|
1140
|
+
if (additionalFields.privateNetworking)
|
|
1141
|
+
body.private_networking = true;
|
|
1142
|
+
if ((_a = additionalFields.sshKeys) === null || _a === void 0 ? void 0 : _a.length)
|
|
1143
|
+
body.ssh_keys = additionalFields.sshKeys.map((id) => parseInt(id));
|
|
1144
|
+
if (additionalFields.tags)
|
|
1145
|
+
body.tags = additionalFields.tags.split(',').map((t) => t.trim());
|
|
1146
|
+
if (additionalFields.userData)
|
|
1147
|
+
body.user_data = additionalFields.userData;
|
|
1148
|
+
if (additionalFields.vpcUuid)
|
|
1149
|
+
body.vpc_uuid = additionalFields.vpcUuid;
|
|
1150
|
+
if ((_b = additionalFields.volumes) === null || _b === void 0 ? void 0 : _b.length)
|
|
1151
|
+
body.volumes = additionalFields.volumes;
|
|
1152
|
+
const response = await this.helpers.httpRequest({
|
|
1153
|
+
method: 'POST',
|
|
1154
|
+
url: `${BASE_URL}/droplets`,
|
|
1155
|
+
headers,
|
|
1156
|
+
body,
|
|
1157
|
+
});
|
|
1158
|
+
responseData = response.droplet;
|
|
1159
|
+
}
|
|
1160
|
+
else if (operation === 'delete') {
|
|
1161
|
+
const dropletId = this.getNodeParameter('dropletId', i);
|
|
1162
|
+
await this.helpers.httpRequest({
|
|
1163
|
+
method: 'DELETE',
|
|
1164
|
+
url: `${BASE_URL}/droplets/${dropletId}`,
|
|
1165
|
+
headers,
|
|
1166
|
+
});
|
|
1167
|
+
responseData = { success: true };
|
|
1168
|
+
}
|
|
1169
|
+
else if (operation === 'reboot') {
|
|
1170
|
+
const dropletId = this.getNodeParameter('dropletId', i);
|
|
1171
|
+
const response = await this.helpers.httpRequest({
|
|
1172
|
+
method: 'POST',
|
|
1173
|
+
url: `${BASE_URL}/droplets/${dropletId}/actions`,
|
|
1174
|
+
headers,
|
|
1175
|
+
body: { type: 'reboot' },
|
|
1176
|
+
});
|
|
1177
|
+
responseData = response.action;
|
|
1178
|
+
}
|
|
1179
|
+
else if (operation === 'shutdown') {
|
|
1180
|
+
const dropletId = this.getNodeParameter('dropletId', i);
|
|
1181
|
+
const response = await this.helpers.httpRequest({
|
|
1182
|
+
method: 'POST',
|
|
1183
|
+
url: `${BASE_URL}/droplets/${dropletId}/actions`,
|
|
1184
|
+
headers,
|
|
1185
|
+
body: { type: 'shutdown' },
|
|
1186
|
+
});
|
|
1187
|
+
responseData = response.action;
|
|
1188
|
+
}
|
|
1189
|
+
else if (operation === 'powerOn') {
|
|
1190
|
+
const dropletId = this.getNodeParameter('dropletId', i);
|
|
1191
|
+
const response = await this.helpers.httpRequest({
|
|
1192
|
+
method: 'POST',
|
|
1193
|
+
url: `${BASE_URL}/droplets/${dropletId}/actions`,
|
|
1194
|
+
headers,
|
|
1195
|
+
body: { type: 'power_on' },
|
|
1196
|
+
});
|
|
1197
|
+
responseData = response.action;
|
|
1198
|
+
}
|
|
1199
|
+
else if (operation === 'powerOff') {
|
|
1200
|
+
const dropletId = this.getNodeParameter('dropletId', i);
|
|
1201
|
+
const response = await this.helpers.httpRequest({
|
|
1202
|
+
method: 'POST',
|
|
1203
|
+
url: `${BASE_URL}/droplets/${dropletId}/actions`,
|
|
1204
|
+
headers,
|
|
1205
|
+
body: { type: 'power_off' },
|
|
1206
|
+
});
|
|
1207
|
+
responseData = response.action;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
else if (resource === 'volume') {
|
|
1211
|
+
if (operation === 'getAll') {
|
|
1212
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1213
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1214
|
+
responseData = await makePaginatedRequest.call(this, 'GET', '/volumes', {}, headers, limit);
|
|
1215
|
+
}
|
|
1216
|
+
else if (operation === 'get') {
|
|
1217
|
+
const volumeId = this.getNodeParameter('volumeId', i);
|
|
1218
|
+
const response = await this.helpers.httpRequest({
|
|
1219
|
+
method: 'GET',
|
|
1220
|
+
url: `${BASE_URL}/volumes/${volumeId}`,
|
|
1221
|
+
headers,
|
|
1222
|
+
});
|
|
1223
|
+
responseData = response.volume;
|
|
1224
|
+
}
|
|
1225
|
+
else if (operation === 'create') {
|
|
1226
|
+
const name = this.getNodeParameter('volumeName', i);
|
|
1227
|
+
const sizeGigabytes = this.getNodeParameter('volumeSizeGigabytes', i);
|
|
1228
|
+
const region = this.getNodeParameter('volumeRegion', i);
|
|
1229
|
+
const body = { name, size_gigabytes: sizeGigabytes, region };
|
|
1230
|
+
const description = this.getNodeParameter('volumeDescription', i, '');
|
|
1231
|
+
const snapshotId = this.getNodeParameter('volumeSnapshotId', i, '');
|
|
1232
|
+
if (description)
|
|
1233
|
+
body.description = description;
|
|
1234
|
+
if (snapshotId)
|
|
1235
|
+
body.snapshot_id = snapshotId;
|
|
1236
|
+
const response = await this.helpers.httpRequest({
|
|
1237
|
+
method: 'POST',
|
|
1238
|
+
url: `${BASE_URL}/volumes`,
|
|
1239
|
+
headers,
|
|
1240
|
+
body,
|
|
1241
|
+
});
|
|
1242
|
+
responseData = response.volume;
|
|
1243
|
+
}
|
|
1244
|
+
else if (operation === 'delete') {
|
|
1245
|
+
const volumeId = this.getNodeParameter('volumeId', i);
|
|
1246
|
+
await this.helpers.httpRequest({
|
|
1247
|
+
method: 'DELETE',
|
|
1248
|
+
url: `${BASE_URL}/volumes/${volumeId}`,
|
|
1249
|
+
headers,
|
|
1250
|
+
});
|
|
1251
|
+
responseData = { success: true };
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
else if (resource === 'database') {
|
|
1255
|
+
if (operation === 'getAll') {
|
|
1256
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1257
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1258
|
+
responseData = await makePaginatedRequest.call(this, 'GET', '/databases', {}, headers, limit);
|
|
1259
|
+
}
|
|
1260
|
+
else if (operation === 'get') {
|
|
1261
|
+
const databaseId = this.getNodeParameter('databaseId', i);
|
|
1262
|
+
const response = await this.helpers.httpRequest({
|
|
1263
|
+
method: 'GET',
|
|
1264
|
+
url: `${BASE_URL}/databases/${databaseId}`,
|
|
1265
|
+
headers,
|
|
1266
|
+
});
|
|
1267
|
+
responseData = response.database;
|
|
1268
|
+
}
|
|
1269
|
+
else if (operation === 'create') {
|
|
1270
|
+
const name = this.getNodeParameter('databaseName', i);
|
|
1271
|
+
const engine = this.getNodeParameter('databaseEngine', i);
|
|
1272
|
+
const version = this.getNodeParameter('databaseVersion', i, '');
|
|
1273
|
+
const region = this.getNodeParameter('databaseRegion', i);
|
|
1274
|
+
const size = this.getNodeParameter('databaseSize', i);
|
|
1275
|
+
const numNodes = this.getNodeParameter('databaseNumNodes', i, 1);
|
|
1276
|
+
const body = { name, engine, region, size, num_nodes: numNodes };
|
|
1277
|
+
if (version)
|
|
1278
|
+
body.version = version;
|
|
1279
|
+
const response = await this.helpers.httpRequest({
|
|
1280
|
+
method: 'POST',
|
|
1281
|
+
url: `${BASE_URL}/databases`,
|
|
1282
|
+
headers,
|
|
1283
|
+
body,
|
|
1284
|
+
});
|
|
1285
|
+
responseData = response.database;
|
|
1286
|
+
}
|
|
1287
|
+
else if (operation === 'delete') {
|
|
1288
|
+
const databaseId = this.getNodeParameter('databaseId', i);
|
|
1289
|
+
await this.helpers.httpRequest({
|
|
1290
|
+
method: 'DELETE',
|
|
1291
|
+
url: `${BASE_URL}/databases/${databaseId}`,
|
|
1292
|
+
headers,
|
|
1293
|
+
});
|
|
1294
|
+
responseData = { success: true };
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
else if (resource === 'domain') {
|
|
1298
|
+
if (operation === 'getAll') {
|
|
1299
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1300
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1301
|
+
responseData = await makePaginatedRequest.call(this, 'GET', '/domains', {}, headers, limit);
|
|
1302
|
+
}
|
|
1303
|
+
else if (operation === 'get') {
|
|
1304
|
+
const domainName = this.getNodeParameter('domainName', i);
|
|
1305
|
+
const response = await this.helpers.httpRequest({
|
|
1306
|
+
method: 'GET',
|
|
1307
|
+
url: `${BASE_URL}/domains/${domainName}`,
|
|
1308
|
+
headers,
|
|
1309
|
+
});
|
|
1310
|
+
responseData = response.domain;
|
|
1311
|
+
}
|
|
1312
|
+
else if (operation === 'create') {
|
|
1313
|
+
const name = this.getNodeParameter('domainNameCreate', i);
|
|
1314
|
+
const ip = this.getNodeParameter('domainIp', i, '');
|
|
1315
|
+
const body = { name };
|
|
1316
|
+
if (ip)
|
|
1317
|
+
body.ip_address = ip;
|
|
1318
|
+
const response = await this.helpers.httpRequest({
|
|
1319
|
+
method: 'POST',
|
|
1320
|
+
url: `${BASE_URL}/domains`,
|
|
1321
|
+
headers,
|
|
1322
|
+
body,
|
|
1323
|
+
});
|
|
1324
|
+
responseData = response.domain;
|
|
1325
|
+
}
|
|
1326
|
+
else if (operation === 'delete') {
|
|
1327
|
+
const domainName = this.getNodeParameter('domainName', i);
|
|
1328
|
+
await this.helpers.httpRequest({
|
|
1329
|
+
method: 'DELETE',
|
|
1330
|
+
url: `${BASE_URL}/domains/${domainName}`,
|
|
1331
|
+
headers,
|
|
1332
|
+
});
|
|
1333
|
+
responseData = { success: true };
|
|
1334
|
+
}
|
|
1335
|
+
else if (operation === 'getRecords') {
|
|
1336
|
+
const domainName = this.getNodeParameter('domainName', i);
|
|
1337
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1338
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1339
|
+
responseData = await makePaginatedRequest.call(this, 'GET', `/domains/${domainName}/records`, {}, headers, limit);
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
else if (resource === 'image') {
|
|
1343
|
+
if (operation === 'getAll') {
|
|
1344
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1345
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1346
|
+
responseData = await makePaginatedRequest.call(this, 'GET', '/images', { type: 'distribution' }, headers, limit);
|
|
1347
|
+
}
|
|
1348
|
+
else if (operation === 'get') {
|
|
1349
|
+
const imageId = this.getNodeParameter('imageId', i);
|
|
1350
|
+
const response = await this.helpers.httpRequest({
|
|
1351
|
+
method: 'GET',
|
|
1352
|
+
url: `${BASE_URL}/images/${imageId}`,
|
|
1353
|
+
headers,
|
|
1354
|
+
});
|
|
1355
|
+
responseData = response.image;
|
|
1356
|
+
}
|
|
1357
|
+
else if (operation === 'delete') {
|
|
1358
|
+
const imageId = this.getNodeParameter('imageId', i);
|
|
1359
|
+
await this.helpers.httpRequest({
|
|
1360
|
+
method: 'DELETE',
|
|
1361
|
+
url: `${BASE_URL}/images/${imageId}`,
|
|
1362
|
+
headers,
|
|
1363
|
+
});
|
|
1364
|
+
responseData = { success: true };
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
else if (resource === 'kubernetes') {
|
|
1368
|
+
if (operation === 'getAllClusters') {
|
|
1369
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1370
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1371
|
+
responseData = await makePaginatedRequest.call(this, 'GET', '/kubernetes/clusters', {}, headers, limit);
|
|
1372
|
+
}
|
|
1373
|
+
else if (operation === 'getCluster') {
|
|
1374
|
+
const clusterId = this.getNodeParameter('clusterId', i);
|
|
1375
|
+
const response = await this.helpers.httpRequest({
|
|
1376
|
+
method: 'GET',
|
|
1377
|
+
url: `${BASE_URL}/kubernetes/clusters/${clusterId}`,
|
|
1378
|
+
headers,
|
|
1379
|
+
});
|
|
1380
|
+
responseData = response.kubernetes_cluster;
|
|
1381
|
+
}
|
|
1382
|
+
else if (operation === 'deleteCluster') {
|
|
1383
|
+
const clusterId = this.getNodeParameter('clusterId', i);
|
|
1384
|
+
await this.helpers.httpRequest({
|
|
1385
|
+
method: 'DELETE',
|
|
1386
|
+
url: `${BASE_URL}/kubernetes/clusters/${clusterId}`,
|
|
1387
|
+
headers,
|
|
1388
|
+
});
|
|
1389
|
+
responseData = { success: true };
|
|
1390
|
+
}
|
|
1391
|
+
else if (operation === 'getKubeconfig') {
|
|
1392
|
+
const clusterId = this.getNodeParameter('clusterId', i);
|
|
1393
|
+
const response = await this.helpers.httpRequest({
|
|
1394
|
+
method: 'GET',
|
|
1395
|
+
url: `${BASE_URL}/kubernetes/clusters/${clusterId}/kubeconfig`,
|
|
1396
|
+
headers,
|
|
1397
|
+
});
|
|
1398
|
+
responseData = { kubeconfig: response };
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
else if (resource === 'loadBalancer') {
|
|
1402
|
+
if (operation === 'getAll') {
|
|
1403
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1404
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1405
|
+
responseData = await makePaginatedRequest.call(this, 'GET', '/load_balancers', {}, headers, limit);
|
|
1406
|
+
}
|
|
1407
|
+
else if (operation === 'get') {
|
|
1408
|
+
const loadBalancerId = this.getNodeParameter('loadBalancerId', i);
|
|
1409
|
+
const response = await this.helpers.httpRequest({
|
|
1410
|
+
method: 'GET',
|
|
1411
|
+
url: `${BASE_URL}/load_balancers/${loadBalancerId}`,
|
|
1412
|
+
headers,
|
|
1413
|
+
});
|
|
1414
|
+
responseData = response.load_balancer;
|
|
1415
|
+
}
|
|
1416
|
+
else if (operation === 'create') {
|
|
1417
|
+
const name = this.getNodeParameter('loadBalancerName', i);
|
|
1418
|
+
const region = this.getNodeParameter('loadBalancerRegion', i);
|
|
1419
|
+
const dropletIds = this.getNodeParameter('loadBalancerDropletIds', i, []);
|
|
1420
|
+
const body = { name, region };
|
|
1421
|
+
if (dropletIds.length)
|
|
1422
|
+
body.droplet_ids = dropletIds.map((id) => parseInt(id));
|
|
1423
|
+
const response = await this.helpers.httpRequest({
|
|
1424
|
+
method: 'POST',
|
|
1425
|
+
url: `${BASE_URL}/load_balancers`,
|
|
1426
|
+
headers,
|
|
1427
|
+
body,
|
|
1428
|
+
});
|
|
1429
|
+
responseData = response.load_balancer;
|
|
1430
|
+
}
|
|
1431
|
+
else if (operation === 'delete') {
|
|
1432
|
+
const loadBalancerId = this.getNodeParameter('loadBalancerId', i);
|
|
1433
|
+
await this.helpers.httpRequest({
|
|
1434
|
+
method: 'DELETE',
|
|
1435
|
+
url: `${BASE_URL}/load_balancers/${loadBalancerId}`,
|
|
1436
|
+
headers,
|
|
1437
|
+
});
|
|
1438
|
+
responseData = { success: true };
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
else if (resource === 'project') {
|
|
1442
|
+
if (operation === 'getAll') {
|
|
1443
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1444
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1445
|
+
responseData = await makePaginatedRequest.call(this, 'GET', '/projects', {}, headers, limit);
|
|
1446
|
+
}
|
|
1447
|
+
else if (operation === 'get') {
|
|
1448
|
+
const projectId = this.getNodeParameter('projectId', i);
|
|
1449
|
+
const response = await this.helpers.httpRequest({
|
|
1450
|
+
method: 'GET',
|
|
1451
|
+
url: `${BASE_URL}/projects/${projectId}`,
|
|
1452
|
+
headers,
|
|
1453
|
+
});
|
|
1454
|
+
responseData = response.project;
|
|
1455
|
+
}
|
|
1456
|
+
else if (operation === 'create') {
|
|
1457
|
+
const name = this.getNodeParameter('projectName', i);
|
|
1458
|
+
const description = this.getNodeParameter('projectDescription', i, '');
|
|
1459
|
+
const purpose = this.getNodeParameter('projectPurpose', i, '');
|
|
1460
|
+
const environment = this.getNodeParameter('projectEnvironment', i, 'Development');
|
|
1461
|
+
const body = { name, environment };
|
|
1462
|
+
if (description)
|
|
1463
|
+
body.description = description;
|
|
1464
|
+
if (purpose)
|
|
1465
|
+
body.purpose = purpose;
|
|
1466
|
+
const response = await this.helpers.httpRequest({
|
|
1467
|
+
method: 'POST',
|
|
1468
|
+
url: `${BASE_URL}/projects`,
|
|
1469
|
+
headers,
|
|
1470
|
+
body,
|
|
1471
|
+
});
|
|
1472
|
+
responseData = response.project;
|
|
1473
|
+
}
|
|
1474
|
+
else if (operation === 'delete') {
|
|
1475
|
+
const projectId = this.getNodeParameter('projectId', i);
|
|
1476
|
+
await this.helpers.httpRequest({
|
|
1477
|
+
method: 'DELETE',
|
|
1478
|
+
url: `${BASE_URL}/projects/${projectId}`,
|
|
1479
|
+
headers,
|
|
1480
|
+
});
|
|
1481
|
+
responseData = { success: true };
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
else if (resource === 'reservedIp') {
|
|
1485
|
+
if (operation === 'getAll') {
|
|
1486
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1487
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1488
|
+
responseData = await makePaginatedRequest.call(this, 'GET', '/reserved_ips', {}, headers, limit);
|
|
1489
|
+
}
|
|
1490
|
+
else if (operation === 'get') {
|
|
1491
|
+
const reservedIp = this.getNodeParameter('reservedIp', i);
|
|
1492
|
+
const response = await this.helpers.httpRequest({
|
|
1493
|
+
method: 'GET',
|
|
1494
|
+
url: `${BASE_URL}/reserved_ips/${reservedIp}`,
|
|
1495
|
+
headers,
|
|
1496
|
+
});
|
|
1497
|
+
responseData = response.reserved_ip;
|
|
1498
|
+
}
|
|
1499
|
+
else if (operation === 'create') {
|
|
1500
|
+
const region = this.getNodeParameter('reservedIpRegion', i);
|
|
1501
|
+
const dropletId = this.getNodeParameter('reservedIpDropletId', i, '');
|
|
1502
|
+
const body = { region };
|
|
1503
|
+
if (dropletId)
|
|
1504
|
+
body.droplet_id = parseInt(dropletId);
|
|
1505
|
+
const response = await this.helpers.httpRequest({
|
|
1506
|
+
method: 'POST',
|
|
1507
|
+
url: `${BASE_URL}/reserved_ips`,
|
|
1508
|
+
headers,
|
|
1509
|
+
body,
|
|
1510
|
+
});
|
|
1511
|
+
responseData = response.reserved_ip;
|
|
1512
|
+
}
|
|
1513
|
+
else if (operation === 'delete') {
|
|
1514
|
+
const reservedIp = this.getNodeParameter('reservedIp', i);
|
|
1515
|
+
await this.helpers.httpRequest({
|
|
1516
|
+
method: 'DELETE',
|
|
1517
|
+
url: `${BASE_URL}/reserved_ips/${reservedIp}`,
|
|
1518
|
+
headers,
|
|
1519
|
+
});
|
|
1520
|
+
responseData = { success: true };
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
else if (resource === 'snapshot') {
|
|
1524
|
+
if (operation === 'getAll') {
|
|
1525
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1526
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1527
|
+
responseData = await makePaginatedRequest.call(this, 'GET', '/snapshots', {}, headers, limit);
|
|
1528
|
+
}
|
|
1529
|
+
else if (operation === 'get') {
|
|
1530
|
+
const snapshotId = this.getNodeParameter('snapshotId', i);
|
|
1531
|
+
const response = await this.helpers.httpRequest({
|
|
1532
|
+
method: 'GET',
|
|
1533
|
+
url: `${BASE_URL}/snapshots/${snapshotId}`,
|
|
1534
|
+
headers,
|
|
1535
|
+
});
|
|
1536
|
+
responseData = response.snapshot;
|
|
1537
|
+
}
|
|
1538
|
+
else if (operation === 'delete') {
|
|
1539
|
+
const snapshotId = this.getNodeParameter('snapshotId', i);
|
|
1540
|
+
await this.helpers.httpRequest({
|
|
1541
|
+
method: 'DELETE',
|
|
1542
|
+
url: `${BASE_URL}/snapshots/${snapshotId}`,
|
|
1543
|
+
headers,
|
|
1544
|
+
});
|
|
1545
|
+
responseData = { success: true };
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
else if (resource === 'sshKey') {
|
|
1549
|
+
if (operation === 'getAll') {
|
|
1550
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1551
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1552
|
+
responseData = await makePaginatedRequest.call(this, 'GET', '/account/keys', {}, headers, limit);
|
|
1553
|
+
}
|
|
1554
|
+
else if (operation === 'get') {
|
|
1555
|
+
const sshKeyId = this.getNodeParameter('sshKeyId', i);
|
|
1556
|
+
const response = await this.helpers.httpRequest({
|
|
1557
|
+
method: 'GET',
|
|
1558
|
+
url: `${BASE_URL}/account/keys/${sshKeyId}`,
|
|
1559
|
+
headers,
|
|
1560
|
+
});
|
|
1561
|
+
responseData = response.ssh_key;
|
|
1562
|
+
}
|
|
1563
|
+
else if (operation === 'create') {
|
|
1564
|
+
const name = this.getNodeParameter('sshKeyName', i);
|
|
1565
|
+
const publicKey = this.getNodeParameter('sshPublicKey', i);
|
|
1566
|
+
const response = await this.helpers.httpRequest({
|
|
1567
|
+
method: 'POST',
|
|
1568
|
+
url: `${BASE_URL}/account/keys`,
|
|
1569
|
+
headers,
|
|
1570
|
+
body: { name, public_key: publicKey },
|
|
1571
|
+
});
|
|
1572
|
+
responseData = response.ssh_key;
|
|
1573
|
+
}
|
|
1574
|
+
else if (operation === 'delete') {
|
|
1575
|
+
const sshKeyId = this.getNodeParameter('sshKeyId', i);
|
|
1576
|
+
await this.helpers.httpRequest({
|
|
1577
|
+
method: 'DELETE',
|
|
1578
|
+
url: `${BASE_URL}/account/keys/${sshKeyId}`,
|
|
1579
|
+
headers,
|
|
1580
|
+
});
|
|
1581
|
+
responseData = { success: true };
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
else if (resource === 'vpc') {
|
|
1585
|
+
if (operation === 'getAll') {
|
|
1586
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1587
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', i);
|
|
1588
|
+
responseData = await makePaginatedRequest.call(this, 'GET', '/vpcs', {}, headers, limit);
|
|
1589
|
+
}
|
|
1590
|
+
else if (operation === 'get') {
|
|
1591
|
+
const vpcId = this.getNodeParameter('vpcId', i);
|
|
1592
|
+
const response = await this.helpers.httpRequest({
|
|
1593
|
+
method: 'GET',
|
|
1594
|
+
url: `${BASE_URL}/vpcs/${vpcId}`,
|
|
1595
|
+
headers,
|
|
1596
|
+
});
|
|
1597
|
+
responseData = response.vpc;
|
|
1598
|
+
}
|
|
1599
|
+
else if (operation === 'create') {
|
|
1600
|
+
const name = this.getNodeParameter('vpcName', i);
|
|
1601
|
+
const region = this.getNodeParameter('vpcRegion', i);
|
|
1602
|
+
const description = this.getNodeParameter('vpcDescription', i, '');
|
|
1603
|
+
const ipRange = this.getNodeParameter('vpcIpRange', i, '');
|
|
1604
|
+
const body = { name, region };
|
|
1605
|
+
if (description)
|
|
1606
|
+
body.description = description;
|
|
1607
|
+
if (ipRange)
|
|
1608
|
+
body.ip_range = ipRange;
|
|
1609
|
+
const response = await this.helpers.httpRequest({
|
|
1610
|
+
method: 'POST',
|
|
1611
|
+
url: `${BASE_URL}/vpcs`,
|
|
1612
|
+
headers,
|
|
1613
|
+
body,
|
|
1614
|
+
});
|
|
1615
|
+
responseData = response.vpc;
|
|
1616
|
+
}
|
|
1617
|
+
else if (operation === 'delete') {
|
|
1618
|
+
const vpcId = this.getNodeParameter('vpcId', i);
|
|
1619
|
+
await this.helpers.httpRequest({
|
|
1620
|
+
method: 'DELETE',
|
|
1621
|
+
url: `${BASE_URL}/vpcs/${vpcId}`,
|
|
1622
|
+
headers,
|
|
1623
|
+
});
|
|
1624
|
+
responseData = { success: true };
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
if (Array.isArray(responseData)) {
|
|
1628
|
+
for (const item of responseData) {
|
|
1629
|
+
returnData.push({ json: item, pairedItem: { item: i } });
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
else if (responseData) {
|
|
1633
|
+
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
catch (error) {
|
|
1637
|
+
if (this.continueOnFail()) {
|
|
1638
|
+
returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
|
|
1639
|
+
continue;
|
|
1640
|
+
}
|
|
1641
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
return [returnData];
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
exports.DigitalOcean = DigitalOcean;
|
|
1648
|
+
//# sourceMappingURL=DigitalOcean.node.js.map
|