files.com 1.2.274 → 1.2.275
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/_VERSION +1 -1
- package/docs/models/RemoteMountBackend.md +10 -12
- package/lib/Files.js +1 -1
- package/lib/models/RemoteMountBackend.js +47 -96
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/RemoteMountBackend.js +25 -54
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.275
|
|
@@ -74,9 +74,6 @@ await RemoteMountBackend.find(id)
|
|
|
74
74
|
|
|
75
75
|
```
|
|
76
76
|
await RemoteMountBackend.create({
|
|
77
|
-
'canary_file_path': "backend1.txt",
|
|
78
|
-
'remote_server_mount_id': 1,
|
|
79
|
-
'remote_server_id': 1,
|
|
80
77
|
'enabled': true,
|
|
81
78
|
'fall': 1,
|
|
82
79
|
'health_check_enabled': true,
|
|
@@ -87,15 +84,15 @@ await RemoteMountBackend.create({
|
|
|
87
84
|
'priority': 1,
|
|
88
85
|
'remote_path': "/path/on/remote",
|
|
89
86
|
'rise': 1,
|
|
87
|
+
'canary_file_path': "backend1.txt",
|
|
88
|
+
'remote_server_mount_id': 1,
|
|
89
|
+
'remote_server_id': 1,
|
|
90
90
|
})
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
### Parameters
|
|
95
95
|
|
|
96
|
-
* `canary_file_path` (string): Required - Path to the canary file used for health checks.
|
|
97
|
-
* `remote_server_mount_id` (int64): Required - The mount ID of the Remote Server Mount that this backend is associated with.
|
|
98
|
-
* `remote_server_id` (int64): Required - The remote server that this backend is associated with.
|
|
99
96
|
* `enabled` (boolean): True if this backend is enabled.
|
|
100
97
|
* `fall` (int64): Number of consecutive failures before considering the backend unhealthy.
|
|
101
98
|
* `health_check_enabled` (boolean): True if health checks are enabled for this backend.
|
|
@@ -106,6 +103,9 @@ await RemoteMountBackend.create({
|
|
|
106
103
|
* `priority` (int64): Priority of this backend.
|
|
107
104
|
* `remote_path` (string): Path on the remote server to treat as the root of this mount.
|
|
108
105
|
* `rise` (int64): Number of consecutive successes before considering the backend healthy.
|
|
106
|
+
* `canary_file_path` (string): Required - Path to the canary file used for health checks.
|
|
107
|
+
* `remote_server_mount_id` (int64): Required - The mount ID of the Remote Server Mount that this backend is associated with.
|
|
108
|
+
* `remote_server_id` (int64): Required - The remote server that this backend is associated with.
|
|
109
109
|
|
|
110
110
|
---
|
|
111
111
|
|
|
@@ -130,9 +130,6 @@ await remote_mount_backend.reset_status()
|
|
|
130
130
|
const remote_mount_backend = await RemoteMountBackend.find(id)
|
|
131
131
|
|
|
132
132
|
await remote_mount_backend.update({
|
|
133
|
-
'canary_file_path': "backend1.txt",
|
|
134
|
-
'remote_server_mount_id': 1,
|
|
135
|
-
'remote_server_id': 1,
|
|
136
133
|
'enabled': true,
|
|
137
134
|
'fall': 1,
|
|
138
135
|
'health_check_enabled': true,
|
|
@@ -143,15 +140,14 @@ await remote_mount_backend.update({
|
|
|
143
140
|
'priority': 1,
|
|
144
141
|
'remote_path': "/path/on/remote",
|
|
145
142
|
'rise': 1,
|
|
143
|
+
'canary_file_path': "backend1.txt",
|
|
144
|
+
'remote_server_id': 1,
|
|
146
145
|
})
|
|
147
146
|
```
|
|
148
147
|
|
|
149
148
|
### Parameters
|
|
150
149
|
|
|
151
150
|
* `id` (int64): Required - Remote Mount Backend ID.
|
|
152
|
-
* `canary_file_path` (string): Required - Path to the canary file used for health checks.
|
|
153
|
-
* `remote_server_mount_id` (int64): Required - The mount ID of the Remote Server Mount that this backend is associated with.
|
|
154
|
-
* `remote_server_id` (int64): Required - The remote server that this backend is associated with.
|
|
155
151
|
* `enabled` (boolean): True if this backend is enabled.
|
|
156
152
|
* `fall` (int64): Number of consecutive failures before considering the backend unhealthy.
|
|
157
153
|
* `health_check_enabled` (boolean): True if health checks are enabled for this backend.
|
|
@@ -162,6 +158,8 @@ await remote_mount_backend.update({
|
|
|
162
158
|
* `priority` (int64): Priority of this backend.
|
|
163
159
|
* `remote_path` (string): Path on the remote server to treat as the root of this mount.
|
|
164
160
|
* `rise` (int64): Number of consecutive successes before considering the backend healthy.
|
|
161
|
+
* `canary_file_path` (string): Path to the canary file used for health checks.
|
|
162
|
+
* `remote_server_id` (int64): The remote server that this backend is associated with.
|
|
165
163
|
|
|
166
164
|
### Example Response
|
|
167
165
|
|
package/lib/Files.js
CHANGED
|
@@ -12,7 +12,7 @@ var apiKey;
|
|
|
12
12
|
var baseUrl = 'https://app.files.com';
|
|
13
13
|
var sessionId = null;
|
|
14
14
|
var language = null;
|
|
15
|
-
var version = '1.2.
|
|
15
|
+
var version = '1.2.275';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
|
@@ -194,9 +194,6 @@ var RemoteMountBackend = /*#__PURE__*/(0, _createClass2.default)(function Remote
|
|
|
194
194
|
}, _callee);
|
|
195
195
|
})));
|
|
196
196
|
// Parameters:
|
|
197
|
-
// canary_file_path (required) - string - Path to the canary file used for health checks.
|
|
198
|
-
// remote_server_mount_id (required) - int64 - The mount ID of the Remote Server Mount that this backend is associated with.
|
|
199
|
-
// remote_server_id (required) - int64 - The remote server that this backend is associated with.
|
|
200
197
|
// enabled - boolean - True if this backend is enabled.
|
|
201
198
|
// fall - int64 - Number of consecutive failures before considering the backend unhealthy.
|
|
202
199
|
// health_check_enabled - boolean - True if health checks are enabled for this backend.
|
|
@@ -207,6 +204,8 @@ var RemoteMountBackend = /*#__PURE__*/(0, _createClass2.default)(function Remote
|
|
|
207
204
|
// priority - int64 - Priority of this backend.
|
|
208
205
|
// remote_path - string - Path on the remote server to treat as the root of this mount.
|
|
209
206
|
// rise - int64 - Number of consecutive successes before considering the backend healthy.
|
|
207
|
+
// canary_file_path - string - Path to the canary file used for health checks.
|
|
208
|
+
// remote_server_id - int64 - The remote server that this backend is associated with.
|
|
210
209
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
211
210
|
var params,
|
|
212
211
|
response,
|
|
@@ -234,122 +233,74 @@ var RemoteMountBackend = /*#__PURE__*/(0, _createClass2.default)(function Remote
|
|
|
234
233
|
}
|
|
235
234
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
236
235
|
case 3:
|
|
237
|
-
if (!(params.
|
|
236
|
+
if (!(params.fall && !(0, _utils.isInt)(params.fall))) {
|
|
238
237
|
_context2.next = 4;
|
|
239
238
|
break;
|
|
240
239
|
}
|
|
241
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
240
|
+
throw new errors.InvalidParameterError("Bad parameter: fall must be of type Int, received ".concat((0, _utils.getType)(params.fall)));
|
|
242
241
|
case 4:
|
|
243
|
-
if (!(params.
|
|
242
|
+
if (!(params.health_check_type && !(0, _utils.isString)(params.health_check_type))) {
|
|
244
243
|
_context2.next = 5;
|
|
245
244
|
break;
|
|
246
245
|
}
|
|
247
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
246
|
+
throw new errors.InvalidParameterError("Bad parameter: health_check_type must be of type String, received ".concat((0, _utils.getType)(params.health_check_type)));
|
|
248
247
|
case 5:
|
|
249
|
-
if (!(params.
|
|
248
|
+
if (!(params.interval && !(0, _utils.isInt)(params.interval))) {
|
|
250
249
|
_context2.next = 6;
|
|
251
250
|
break;
|
|
252
251
|
}
|
|
253
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
252
|
+
throw new errors.InvalidParameterError("Bad parameter: interval must be of type Int, received ".concat((0, _utils.getType)(params.interval)));
|
|
254
253
|
case 6:
|
|
255
|
-
if (!(params.
|
|
254
|
+
if (!(params.priority && !(0, _utils.isInt)(params.priority))) {
|
|
256
255
|
_context2.next = 7;
|
|
257
256
|
break;
|
|
258
257
|
}
|
|
259
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
258
|
+
throw new errors.InvalidParameterError("Bad parameter: priority must be of type Int, received ".concat((0, _utils.getType)(params.priority)));
|
|
260
259
|
case 7:
|
|
261
|
-
if (!(params.
|
|
260
|
+
if (!(params.remote_path && !(0, _utils.isString)(params.remote_path))) {
|
|
262
261
|
_context2.next = 8;
|
|
263
262
|
break;
|
|
264
263
|
}
|
|
265
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
264
|
+
throw new errors.InvalidParameterError("Bad parameter: remote_path must be of type String, received ".concat((0, _utils.getType)(params.remote_path)));
|
|
266
265
|
case 8:
|
|
267
|
-
if (!(params.
|
|
266
|
+
if (!(params.rise && !(0, _utils.isInt)(params.rise))) {
|
|
268
267
|
_context2.next = 9;
|
|
269
268
|
break;
|
|
270
269
|
}
|
|
271
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
270
|
+
throw new errors.InvalidParameterError("Bad parameter: rise must be of type Int, received ".concat((0, _utils.getType)(params.rise)));
|
|
272
271
|
case 9:
|
|
273
|
-
if (!(params.
|
|
272
|
+
if (!(params.canary_file_path && !(0, _utils.isString)(params.canary_file_path))) {
|
|
274
273
|
_context2.next = 10;
|
|
275
274
|
break;
|
|
276
275
|
}
|
|
277
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
276
|
+
throw new errors.InvalidParameterError("Bad parameter: canary_file_path must be of type String, received ".concat((0, _utils.getType)(params.canary_file_path)));
|
|
278
277
|
case 10:
|
|
279
|
-
if (!(params.
|
|
278
|
+
if (!(params.remote_server_id && !(0, _utils.isInt)(params.remote_server_id))) {
|
|
280
279
|
_context2.next = 11;
|
|
281
280
|
break;
|
|
282
281
|
}
|
|
283
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
282
|
+
throw new errors.InvalidParameterError("Bad parameter: remote_server_id must be of type Int, received ".concat((0, _utils.getType)(params.remote_server_id)));
|
|
284
283
|
case 11:
|
|
285
|
-
if (!(params.rise && !(0, _utils.isInt)(params.rise))) {
|
|
286
|
-
_context2.next = 12;
|
|
287
|
-
break;
|
|
288
|
-
}
|
|
289
|
-
throw new errors.InvalidParameterError("Bad parameter: rise must be of type Int, received ".concat((0, _utils.getType)(params.rise)));
|
|
290
|
-
case 12:
|
|
291
284
|
if (params.id) {
|
|
292
|
-
_context2.next =
|
|
285
|
+
_context2.next = 13;
|
|
293
286
|
break;
|
|
294
287
|
}
|
|
295
288
|
if (!_this.attributes.id) {
|
|
296
|
-
_context2.next =
|
|
289
|
+
_context2.next = 12;
|
|
297
290
|
break;
|
|
298
291
|
}
|
|
299
292
|
params.id = _this.id;
|
|
300
|
-
_context2.next =
|
|
293
|
+
_context2.next = 13;
|
|
301
294
|
break;
|
|
302
|
-
case
|
|
295
|
+
case 12:
|
|
303
296
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
304
|
-
case
|
|
305
|
-
|
|
306
|
-
_context2.next = 16;
|
|
307
|
-
break;
|
|
308
|
-
}
|
|
309
|
-
if (!_this.attributes.canary_file_path) {
|
|
310
|
-
_context2.next = 15;
|
|
311
|
-
break;
|
|
312
|
-
}
|
|
313
|
-
params.canary_file_path = _this.canary_file_path;
|
|
314
|
-
_context2.next = 16;
|
|
315
|
-
break;
|
|
316
|
-
case 15:
|
|
317
|
-
throw new errors.MissingParameterError('Parameter missing: canary_file_path');
|
|
318
|
-
case 16:
|
|
319
|
-
if (params.remote_server_mount_id) {
|
|
320
|
-
_context2.next = 18;
|
|
321
|
-
break;
|
|
322
|
-
}
|
|
323
|
-
if (!_this.attributes.remote_server_mount_id) {
|
|
324
|
-
_context2.next = 17;
|
|
325
|
-
break;
|
|
326
|
-
}
|
|
327
|
-
params.remote_server_mount_id = _this.remote_server_mount_id;
|
|
328
|
-
_context2.next = 18;
|
|
329
|
-
break;
|
|
330
|
-
case 17:
|
|
331
|
-
throw new errors.MissingParameterError('Parameter missing: remote_server_mount_id');
|
|
332
|
-
case 18:
|
|
333
|
-
if (params.remote_server_id) {
|
|
334
|
-
_context2.next = 20;
|
|
335
|
-
break;
|
|
336
|
-
}
|
|
337
|
-
if (!_this.attributes.remote_server_id) {
|
|
338
|
-
_context2.next = 19;
|
|
339
|
-
break;
|
|
340
|
-
}
|
|
341
|
-
params.remote_server_id = _this.remote_server_id;
|
|
342
|
-
_context2.next = 20;
|
|
343
|
-
break;
|
|
344
|
-
case 19:
|
|
345
|
-
throw new errors.MissingParameterError('Parameter missing: remote_server_id');
|
|
346
|
-
case 20:
|
|
347
|
-
_context2.next = 21;
|
|
297
|
+
case 13:
|
|
298
|
+
_context2.next = 14;
|
|
348
299
|
return _Api.default.sendRequest("/remote_mount_backends/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
|
349
|
-
case
|
|
300
|
+
case 14:
|
|
350
301
|
response = _context2.sent;
|
|
351
302
|
return _context2.abrupt("return", new RemoteMountBackend(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
352
|
-
case
|
|
303
|
+
case 15:
|
|
353
304
|
case "end":
|
|
354
305
|
return _context2.stop();
|
|
355
306
|
}
|
|
@@ -547,9 +498,6 @@ _RemoteMountBackend = RemoteMountBackend;
|
|
|
547
498
|
return _RemoteMountBackend.find(id, params, options);
|
|
548
499
|
});
|
|
549
500
|
// Parameters:
|
|
550
|
-
// canary_file_path (required) - string - Path to the canary file used for health checks.
|
|
551
|
-
// remote_server_mount_id (required) - int64 - The mount ID of the Remote Server Mount that this backend is associated with.
|
|
552
|
-
// remote_server_id (required) - int64 - The remote server that this backend is associated with.
|
|
553
501
|
// enabled - boolean - True if this backend is enabled.
|
|
554
502
|
// fall - int64 - Number of consecutive failures before considering the backend unhealthy.
|
|
555
503
|
// health_check_enabled - boolean - True if health checks are enabled for this backend.
|
|
@@ -560,6 +508,9 @@ _RemoteMountBackend = RemoteMountBackend;
|
|
|
560
508
|
// priority - int64 - Priority of this backend.
|
|
561
509
|
// remote_path - string - Path on the remote server to treat as the root of this mount.
|
|
562
510
|
// rise - int64 - Number of consecutive successes before considering the backend healthy.
|
|
511
|
+
// canary_file_path (required) - string - Path to the canary file used for health checks.
|
|
512
|
+
// remote_server_mount_id (required) - int64 - The mount ID of the Remote Server Mount that this backend is associated with.
|
|
513
|
+
// remote_server_id (required) - int64 - The remote server that this backend is associated with.
|
|
563
514
|
(0, _defineProperty2.default)(RemoteMountBackend, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
564
515
|
var params,
|
|
565
516
|
options,
|
|
@@ -588,59 +539,59 @@ _RemoteMountBackend = RemoteMountBackend;
|
|
|
588
539
|
}
|
|
589
540
|
throw new errors.MissingParameterError('Parameter missing: remote_server_id');
|
|
590
541
|
case 3:
|
|
591
|
-
if (!(params.
|
|
542
|
+
if (!(params.fall && !(0, _utils.isInt)(params.fall))) {
|
|
592
543
|
_context7.next = 4;
|
|
593
544
|
break;
|
|
594
545
|
}
|
|
595
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
546
|
+
throw new errors.InvalidParameterError("Bad parameter: fall must be of type Int, received ".concat((0, _utils.getType)(params.fall)));
|
|
596
547
|
case 4:
|
|
597
|
-
if (!(params.
|
|
548
|
+
if (!(params.health_check_type && !(0, _utils.isString)(params.health_check_type))) {
|
|
598
549
|
_context7.next = 5;
|
|
599
550
|
break;
|
|
600
551
|
}
|
|
601
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
552
|
+
throw new errors.InvalidParameterError("Bad parameter: health_check_type must be of type String, received ".concat((0, _utils.getType)(params.health_check_type)));
|
|
602
553
|
case 5:
|
|
603
|
-
if (!(params.
|
|
554
|
+
if (!(params.interval && !(0, _utils.isInt)(params.interval))) {
|
|
604
555
|
_context7.next = 6;
|
|
605
556
|
break;
|
|
606
557
|
}
|
|
607
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
558
|
+
throw new errors.InvalidParameterError("Bad parameter: interval must be of type Int, received ".concat((0, _utils.getType)(params.interval)));
|
|
608
559
|
case 6:
|
|
609
|
-
if (!(params.
|
|
560
|
+
if (!(params.priority && !(0, _utils.isInt)(params.priority))) {
|
|
610
561
|
_context7.next = 7;
|
|
611
562
|
break;
|
|
612
563
|
}
|
|
613
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
564
|
+
throw new errors.InvalidParameterError("Bad parameter: priority must be of type Int, received ".concat((0, _utils.getType)(params.priority)));
|
|
614
565
|
case 7:
|
|
615
|
-
if (!(params.
|
|
566
|
+
if (!(params.remote_path && !(0, _utils.isString)(params.remote_path))) {
|
|
616
567
|
_context7.next = 8;
|
|
617
568
|
break;
|
|
618
569
|
}
|
|
619
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
570
|
+
throw new errors.InvalidParameterError("Bad parameter: remote_path must be of type String, received ".concat((0, _utils.getType)(params.remote_path)));
|
|
620
571
|
case 8:
|
|
621
|
-
if (!(params.
|
|
572
|
+
if (!(params.rise && !(0, _utils.isInt)(params.rise))) {
|
|
622
573
|
_context7.next = 9;
|
|
623
574
|
break;
|
|
624
575
|
}
|
|
625
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
576
|
+
throw new errors.InvalidParameterError("Bad parameter: rise must be of type Int, received ".concat((0, _utils.getType)(params.rise)));
|
|
626
577
|
case 9:
|
|
627
|
-
if (!(params.
|
|
578
|
+
if (!(params.canary_file_path && !(0, _utils.isString)(params.canary_file_path))) {
|
|
628
579
|
_context7.next = 10;
|
|
629
580
|
break;
|
|
630
581
|
}
|
|
631
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
582
|
+
throw new errors.InvalidParameterError("Bad parameter: canary_file_path must be of type String, received ".concat((0, _utils.getType)(params.canary_file_path)));
|
|
632
583
|
case 10:
|
|
633
|
-
if (!(params.
|
|
584
|
+
if (!(params.remote_server_mount_id && !(0, _utils.isInt)(params.remote_server_mount_id))) {
|
|
634
585
|
_context7.next = 11;
|
|
635
586
|
break;
|
|
636
587
|
}
|
|
637
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
588
|
+
throw new errors.InvalidParameterError("Bad parameter: remote_server_mount_id must be of type Int, received ".concat((0, _utils.getType)(params.remote_server_mount_id)));
|
|
638
589
|
case 11:
|
|
639
|
-
if (!(params.
|
|
590
|
+
if (!(params.remote_server_id && !(0, _utils.isInt)(params.remote_server_id))) {
|
|
640
591
|
_context7.next = 12;
|
|
641
592
|
break;
|
|
642
593
|
}
|
|
643
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
594
|
+
throw new errors.InvalidParameterError("Bad parameter: remote_server_id must be of type Int, received ".concat((0, _utils.getType)(params.remote_server_id)));
|
|
644
595
|
case 12:
|
|
645
596
|
_context7.next = 13;
|
|
646
597
|
return _Api.default.sendRequest('/remote_mount_backends', 'POST', params, options);
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
|
@@ -167,9 +167,6 @@ class RemoteMountBackend {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
// Parameters:
|
|
170
|
-
// canary_file_path (required) - string - Path to the canary file used for health checks.
|
|
171
|
-
// remote_server_mount_id (required) - int64 - The mount ID of the Remote Server Mount that this backend is associated with.
|
|
172
|
-
// remote_server_id (required) - int64 - The remote server that this backend is associated with.
|
|
173
170
|
// enabled - boolean - True if this backend is enabled.
|
|
174
171
|
// fall - int64 - Number of consecutive failures before considering the backend unhealthy.
|
|
175
172
|
// health_check_enabled - boolean - True if health checks are enabled for this backend.
|
|
@@ -180,6 +177,8 @@ class RemoteMountBackend {
|
|
|
180
177
|
// priority - int64 - Priority of this backend.
|
|
181
178
|
// remote_path - string - Path on the remote server to treat as the root of this mount.
|
|
182
179
|
// rise - int64 - Number of consecutive successes before considering the backend healthy.
|
|
180
|
+
// canary_file_path - string - Path to the canary file used for health checks.
|
|
181
|
+
// remote_server_id - int64 - The remote server that this backend is associated with.
|
|
183
182
|
update = async (params = {}) => {
|
|
184
183
|
if (!this.attributes.id) {
|
|
185
184
|
throw new errors.EmptyPropertyError('Current object has no id')
|
|
@@ -194,18 +193,6 @@ class RemoteMountBackend {
|
|
|
194
193
|
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
|
|
195
194
|
}
|
|
196
195
|
|
|
197
|
-
if (params.canary_file_path && !isString(params.canary_file_path)) {
|
|
198
|
-
throw new errors.InvalidParameterError(`Bad parameter: canary_file_path must be of type String, received ${getType(params.canary_file_path)}`)
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
if (params.remote_server_mount_id && !isInt(params.remote_server_mount_id)) {
|
|
202
|
-
throw new errors.InvalidParameterError(`Bad parameter: remote_server_mount_id must be of type Int, received ${getType(params.remote_server_mount_id)}`)
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
if (params.remote_server_id && !isInt(params.remote_server_id)) {
|
|
206
|
-
throw new errors.InvalidParameterError(`Bad parameter: remote_server_id must be of type Int, received ${getType(params.remote_server_id)}`)
|
|
207
|
-
}
|
|
208
|
-
|
|
209
196
|
if (params.fall && !isInt(params.fall)) {
|
|
210
197
|
throw new errors.InvalidParameterError(`Bad parameter: fall must be of type Int, received ${getType(params.fall)}`)
|
|
211
198
|
}
|
|
@@ -230,35 +217,19 @@ class RemoteMountBackend {
|
|
|
230
217
|
throw new errors.InvalidParameterError(`Bad parameter: rise must be of type Int, received ${getType(params.rise)}`)
|
|
231
218
|
}
|
|
232
219
|
|
|
233
|
-
if (!params.
|
|
234
|
-
|
|
235
|
-
params.id = this.id
|
|
236
|
-
} else {
|
|
237
|
-
throw new errors.MissingParameterError('Parameter missing: id')
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
if (!params.canary_file_path) {
|
|
242
|
-
if (this.attributes.canary_file_path) {
|
|
243
|
-
params.canary_file_path = this.canary_file_path
|
|
244
|
-
} else {
|
|
245
|
-
throw new errors.MissingParameterError('Parameter missing: canary_file_path')
|
|
246
|
-
}
|
|
220
|
+
if (params.canary_file_path && !isString(params.canary_file_path)) {
|
|
221
|
+
throw new errors.InvalidParameterError(`Bad parameter: canary_file_path must be of type String, received ${getType(params.canary_file_path)}`)
|
|
247
222
|
}
|
|
248
223
|
|
|
249
|
-
if (!params.
|
|
250
|
-
|
|
251
|
-
params.remote_server_mount_id = this.remote_server_mount_id
|
|
252
|
-
} else {
|
|
253
|
-
throw new errors.MissingParameterError('Parameter missing: remote_server_mount_id')
|
|
254
|
-
}
|
|
224
|
+
if (params.remote_server_id && !isInt(params.remote_server_id)) {
|
|
225
|
+
throw new errors.InvalidParameterError(`Bad parameter: remote_server_id must be of type Int, received ${getType(params.remote_server_id)}`)
|
|
255
226
|
}
|
|
256
227
|
|
|
257
|
-
if (!params.
|
|
258
|
-
if (this.attributes.
|
|
259
|
-
params.
|
|
228
|
+
if (!params.id) {
|
|
229
|
+
if (this.attributes.id) {
|
|
230
|
+
params.id = this.id
|
|
260
231
|
} else {
|
|
261
|
-
throw new errors.MissingParameterError('Parameter missing:
|
|
232
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
|
262
233
|
}
|
|
263
234
|
}
|
|
264
235
|
|
|
@@ -354,9 +325,6 @@ class RemoteMountBackend {
|
|
|
354
325
|
RemoteMountBackend.find(id, params, options)
|
|
355
326
|
|
|
356
327
|
// Parameters:
|
|
357
|
-
// canary_file_path (required) - string - Path to the canary file used for health checks.
|
|
358
|
-
// remote_server_mount_id (required) - int64 - The mount ID of the Remote Server Mount that this backend is associated with.
|
|
359
|
-
// remote_server_id (required) - int64 - The remote server that this backend is associated with.
|
|
360
328
|
// enabled - boolean - True if this backend is enabled.
|
|
361
329
|
// fall - int64 - Number of consecutive failures before considering the backend unhealthy.
|
|
362
330
|
// health_check_enabled - boolean - True if health checks are enabled for this backend.
|
|
@@ -367,6 +335,9 @@ class RemoteMountBackend {
|
|
|
367
335
|
// priority - int64 - Priority of this backend.
|
|
368
336
|
// remote_path - string - Path on the remote server to treat as the root of this mount.
|
|
369
337
|
// rise - int64 - Number of consecutive successes before considering the backend healthy.
|
|
338
|
+
// canary_file_path (required) - string - Path to the canary file used for health checks.
|
|
339
|
+
// remote_server_mount_id (required) - int64 - The mount ID of the Remote Server Mount that this backend is associated with.
|
|
340
|
+
// remote_server_id (required) - int64 - The remote server that this backend is associated with.
|
|
370
341
|
static create = async (params = {}, options = {}) => {
|
|
371
342
|
if (!params.canary_file_path) {
|
|
372
343
|
throw new errors.MissingParameterError('Parameter missing: canary_file_path')
|
|
@@ -380,18 +351,6 @@ class RemoteMountBackend {
|
|
|
380
351
|
throw new errors.MissingParameterError('Parameter missing: remote_server_id')
|
|
381
352
|
}
|
|
382
353
|
|
|
383
|
-
if (params.canary_file_path && !isString(params.canary_file_path)) {
|
|
384
|
-
throw new errors.InvalidParameterError(`Bad parameter: canary_file_path must be of type String, received ${getType(params.canary_file_path)}`)
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
if (params.remote_server_mount_id && !isInt(params.remote_server_mount_id)) {
|
|
388
|
-
throw new errors.InvalidParameterError(`Bad parameter: remote_server_mount_id must be of type Int, received ${getType(params.remote_server_mount_id)}`)
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
if (params.remote_server_id && !isInt(params.remote_server_id)) {
|
|
392
|
-
throw new errors.InvalidParameterError(`Bad parameter: remote_server_id must be of type Int, received ${getType(params.remote_server_id)}`)
|
|
393
|
-
}
|
|
394
|
-
|
|
395
354
|
if (params.fall && !isInt(params.fall)) {
|
|
396
355
|
throw new errors.InvalidParameterError(`Bad parameter: fall must be of type Int, received ${getType(params.fall)}`)
|
|
397
356
|
}
|
|
@@ -416,6 +375,18 @@ class RemoteMountBackend {
|
|
|
416
375
|
throw new errors.InvalidParameterError(`Bad parameter: rise must be of type Int, received ${getType(params.rise)}`)
|
|
417
376
|
}
|
|
418
377
|
|
|
378
|
+
if (params.canary_file_path && !isString(params.canary_file_path)) {
|
|
379
|
+
throw new errors.InvalidParameterError(`Bad parameter: canary_file_path must be of type String, received ${getType(params.canary_file_path)}`)
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
if (params.remote_server_mount_id && !isInt(params.remote_server_mount_id)) {
|
|
383
|
+
throw new errors.InvalidParameterError(`Bad parameter: remote_server_mount_id must be of type Int, received ${getType(params.remote_server_mount_id)}`)
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if (params.remote_server_id && !isInt(params.remote_server_id)) {
|
|
387
|
+
throw new errors.InvalidParameterError(`Bad parameter: remote_server_id must be of type Int, received ${getType(params.remote_server_id)}`)
|
|
388
|
+
}
|
|
389
|
+
|
|
419
390
|
const response = await Api.sendRequest('/remote_mount_backends', 'POST', params, options)
|
|
420
391
|
|
|
421
392
|
return new RemoteMountBackend(response?.data, options)
|