@scaleway/sdk-rdb 1.2.0 → 2.1.1

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.
@@ -1,1060 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const content_gen = require("./content.gen.cjs");
5
- const marshalling_gen = require("./marshalling.gen.cjs");
6
- const jsonContentHeaders = {
7
- "Content-Type": "application/json; charset=utf-8"
8
- };
9
- class API extends sdkClient.API {
10
- /**
11
- * Locality of this API.
12
- * type ∈ {'zone','region','global','unspecified'}
13
- */
14
- static LOCALITY = sdkClient.toApiLocality({
15
- regions: ["fr-par", "nl-ams", "pl-waw"]
16
- });
17
- pageOfListDatabaseEngines = (request = {}) => this.client.fetch(
18
- {
19
- method: "GET",
20
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/database-engines`,
21
- urlParams: sdkClient.urlParams(
22
- ["name", request.name],
23
- ["page", request.page],
24
- [
25
- "page_size",
26
- request.pageSize ?? this.client.settings.defaultPageSize
27
- ],
28
- ["version", request.version]
29
- )
30
- },
31
- marshalling_gen.unmarshalListDatabaseEnginesResponse
32
- );
33
- /**
34
- * List available database engines. List the PostgreSQL and MySQL database engines available at Scaleway.
35
- *
36
- * @param request - The request {@link ListDatabaseEnginesRequest}
37
- * @returns A Promise of ListDatabaseEnginesResponse
38
- */
39
- listDatabaseEngines = (request = {}) => sdkClient.enrichForPagination("engines", this.pageOfListDatabaseEngines, request);
40
- pageOfListNodeTypes = (request) => this.client.fetch(
41
- {
42
- method: "GET",
43
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
44
- urlParams: sdkClient.urlParams(
45
- ["include_disabled_types", request.includeDisabledTypes],
46
- ["page", request.page],
47
- [
48
- "page_size",
49
- request.pageSize ?? this.client.settings.defaultPageSize
50
- ]
51
- )
52
- },
53
- marshalling_gen.unmarshalListNodeTypesResponse
54
- );
55
- /**
56
- * List available node types. List all available node types. By default, the node types returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
57
- *
58
- * @param request - The request {@link ListNodeTypesRequest}
59
- * @returns A Promise of ListNodeTypesResponse
60
- */
61
- listNodeTypes = (request) => sdkClient.enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
62
- pageOfListDatabaseBackups = (request = {}) => this.client.fetch(
63
- {
64
- method: "GET",
65
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups`,
66
- urlParams: sdkClient.urlParams(
67
- ["instance_id", request.instanceId],
68
- ["name", request.name],
69
- ["order_by", request.orderBy],
70
- ["organization_id", request.organizationId],
71
- ["page", request.page],
72
- [
73
- "page_size",
74
- request.pageSize ?? this.client.settings.defaultPageSize
75
- ],
76
- ["project_id", request.projectId]
77
- )
78
- },
79
- marshalling_gen.unmarshalListDatabaseBackupsResponse
80
- );
81
- /**
82
- * List database backups. List all backups in a specified region, for a given Scaleway Organization or Scaleway Project. By default, the backups listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
83
- *
84
- * @param request - The request {@link ListDatabaseBackupsRequest}
85
- * @returns A Promise of ListDatabaseBackupsResponse
86
- */
87
- listDatabaseBackups = (request = {}) => sdkClient.enrichForPagination(
88
- "databaseBackups",
89
- this.pageOfListDatabaseBackups,
90
- request
91
- );
92
- /**
93
- * Create a database backup. Create a new backup. You must set the `instance_id`, `database_name`, `name` and `expires_at` parameters.
94
- *
95
- * @param request - The request {@link CreateDatabaseBackupRequest}
96
- * @returns A Promise of DatabaseBackup
97
- */
98
- createDatabaseBackup = (request) => this.client.fetch(
99
- {
100
- body: JSON.stringify(
101
- marshalling_gen.marshalCreateDatabaseBackupRequest(request, this.client.settings)
102
- ),
103
- headers: jsonContentHeaders,
104
- method: "POST",
105
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups`
106
- },
107
- marshalling_gen.unmarshalDatabaseBackup
108
- );
109
- /**
110
- * Get a database backup. Retrieve information about a given backup, specified by its database backup ID and region. Full details about the backup, like size, URL and expiration date, are returned in the response.
111
- *
112
- * @param request - The request {@link GetDatabaseBackupRequest}
113
- * @returns A Promise of DatabaseBackup
114
- */
115
- getDatabaseBackup = (request) => this.client.fetch(
116
- {
117
- method: "GET",
118
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${sdkClient.validatePathParam("databaseBackupId", request.databaseBackupId)}`
119
- },
120
- marshalling_gen.unmarshalDatabaseBackup
121
- );
122
- /**
123
- * Waits for {@link DatabaseBackup} to be in a final state.
124
- *
125
- * @param request - The request {@link GetDatabaseBackupRequest}
126
- * @param options - The waiting options
127
- * @returns A Promise of DatabaseBackup
128
- */
129
- waitForDatabaseBackup = (request, options) => sdkClient.waitForResource(
130
- options?.stop ?? ((res) => Promise.resolve(
131
- !content_gen.DATABASE_BACKUP_TRANSIENT_STATUSES.includes(res.status)
132
- )),
133
- this.getDatabaseBackup,
134
- request,
135
- options
136
- );
137
- /**
138
- * Update a database backup. Update the parameters of a backup, including name and expiration date.
139
- *
140
- * @param request - The request {@link UpdateDatabaseBackupRequest}
141
- * @returns A Promise of DatabaseBackup
142
- */
143
- updateDatabaseBackup = (request) => this.client.fetch(
144
- {
145
- body: JSON.stringify(
146
- marshalling_gen.marshalUpdateDatabaseBackupRequest(request, this.client.settings)
147
- ),
148
- headers: jsonContentHeaders,
149
- method: "PATCH",
150
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${sdkClient.validatePathParam("databaseBackupId", request.databaseBackupId)}`
151
- },
152
- marshalling_gen.unmarshalDatabaseBackup
153
- );
154
- /**
155
- * Delete a database backup. Delete a backup, specified by its database backup ID and region. Deleting a backup is permanent, and cannot be undone.
156
- *
157
- * @param request - The request {@link DeleteDatabaseBackupRequest}
158
- * @returns A Promise of DatabaseBackup
159
- */
160
- deleteDatabaseBackup = (request) => this.client.fetch(
161
- {
162
- method: "DELETE",
163
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${sdkClient.validatePathParam("databaseBackupId", request.databaseBackupId)}`
164
- },
165
- marshalling_gen.unmarshalDatabaseBackup
166
- );
167
- /**
168
- * Restore a database backup. Launch the process of restoring database backup. You must specify the `instance_id` of the Database Instance of destination, where the backup will be restored. Note that large database backups can take up to several hours to restore.
169
- *
170
- * @param request - The request {@link RestoreDatabaseBackupRequest}
171
- * @returns A Promise of DatabaseBackup
172
- */
173
- restoreDatabaseBackup = (request) => this.client.fetch(
174
- {
175
- body: JSON.stringify(
176
- marshalling_gen.marshalRestoreDatabaseBackupRequest(request, this.client.settings)
177
- ),
178
- headers: jsonContentHeaders,
179
- method: "POST",
180
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${sdkClient.validatePathParam("databaseBackupId", request.databaseBackupId)}/restore`
181
- },
182
- marshalling_gen.unmarshalDatabaseBackup
183
- );
184
- /**
185
- * Export a database backup. Export a backup, specified by the `database_backup_id` and the `region` parameters. The download URL is returned in the response.
186
- *
187
- * @param request - The request {@link ExportDatabaseBackupRequest}
188
- * @returns A Promise of DatabaseBackup
189
- */
190
- exportDatabaseBackup = (request) => this.client.fetch(
191
- {
192
- body: "{}",
193
- headers: jsonContentHeaders,
194
- method: "POST",
195
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${sdkClient.validatePathParam("databaseBackupId", request.databaseBackupId)}/export`
196
- },
197
- marshalling_gen.unmarshalDatabaseBackup
198
- );
199
- /**
200
- * Upgrade a Database Instance. Upgrade your current Database Instance specifications like node type, high availability, volume, or the database engine version. Note that upon upgrade the `enable_ha` parameter can only be set to `true`.
201
- *
202
- * @param request - The request {@link UpgradeInstanceRequest}
203
- * @returns A Promise of Instance
204
- */
205
- upgradeInstance = (request) => this.client.fetch(
206
- {
207
- body: JSON.stringify(
208
- marshalling_gen.marshalUpgradeInstanceRequest(request, this.client.settings)
209
- ),
210
- headers: jsonContentHeaders,
211
- method: "POST",
212
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/upgrade`
213
- },
214
- marshalling_gen.unmarshalInstance
215
- );
216
- pageOfListInstances = (request = {}) => this.client.fetch(
217
- {
218
- method: "GET",
219
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances`,
220
- urlParams: sdkClient.urlParams(
221
- ["has_maintenances", request.hasMaintenances],
222
- ["name", request.name],
223
- ["order_by", request.orderBy],
224
- ["organization_id", request.organizationId],
225
- ["page", request.page],
226
- [
227
- "page_size",
228
- request.pageSize ?? this.client.settings.defaultPageSize
229
- ],
230
- ["project_id", request.projectId],
231
- ["tags", request.tags]
232
- )
233
- },
234
- marshalling_gen.unmarshalListInstancesResponse
235
- );
236
- /**
237
- * List Database Instances. List all Database Instances in the specified region, for a given Scaleway Organization or Scaleway Project. By default, the Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags` and `name`. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter.
238
- *
239
- * @param request - The request {@link ListInstancesRequest}
240
- * @returns A Promise of ListInstancesResponse
241
- */
242
- listInstances = (request = {}) => sdkClient.enrichForPagination("instances", this.pageOfListInstances, request);
243
- /**
244
- * Get a Database Instance. Retrieve information about a given Database Instance, specified by the `region` and `instance_id` parameters. Its full details, including name, status, IP address and port, are returned in the response object.
245
- *
246
- * @param request - The request {@link GetInstanceRequest}
247
- * @returns A Promise of Instance
248
- */
249
- getInstance = (request) => this.client.fetch(
250
- {
251
- method: "GET",
252
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}`
253
- },
254
- marshalling_gen.unmarshalInstance
255
- );
256
- /**
257
- * Waits for {@link Instance} to be in a final state.
258
- *
259
- * @param request - The request {@link GetInstanceRequest}
260
- * @param options - The waiting options
261
- * @returns A Promise of Instance
262
- */
263
- waitForInstance = (request, options) => sdkClient.waitForResource(
264
- options?.stop ?? ((res) => Promise.resolve(
265
- !content_gen.INSTANCE_TRANSIENT_STATUSES.includes(res.status)
266
- )),
267
- this.getInstance,
268
- request,
269
- options
270
- );
271
- /**
272
- * Create a Database Instance. Create a new Database Instance. You must set the `engine`, `user_name`, `password` and `node_type` parameters. Optionally, you can specify the volume type and size.
273
- *
274
- * @param request - The request {@link CreateInstanceRequest}
275
- * @returns A Promise of Instance
276
- */
277
- createInstance = (request) => this.client.fetch(
278
- {
279
- body: JSON.stringify(
280
- marshalling_gen.marshalCreateInstanceRequest(request, this.client.settings)
281
- ),
282
- headers: jsonContentHeaders,
283
- method: "POST",
284
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances`
285
- },
286
- marshalling_gen.unmarshalInstance
287
- );
288
- /**
289
- * Update a Database Instance. Update the parameters of a Database Instance, including name, tags and backup schedule details.
290
- *
291
- * @param request - The request {@link UpdateInstanceRequest}
292
- * @returns A Promise of Instance
293
- */
294
- updateInstance = (request) => this.client.fetch(
295
- {
296
- body: JSON.stringify(
297
- marshalling_gen.marshalUpdateInstanceRequest(request, this.client.settings)
298
- ),
299
- headers: jsonContentHeaders,
300
- method: "PATCH",
301
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}`
302
- },
303
- marshalling_gen.unmarshalInstance
304
- );
305
- /**
306
- * Delete a Database Instance. Delete a given Database Instance, specified by the `region` and `instance_id` parameters. Deleting a Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost.
307
- *
308
- * @param request - The request {@link DeleteInstanceRequest}
309
- * @returns A Promise of Instance
310
- */
311
- deleteInstance = (request) => this.client.fetch(
312
- {
313
- method: "DELETE",
314
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}`
315
- },
316
- marshalling_gen.unmarshalInstance
317
- );
318
- /**
319
- * Clone a Database Instance. Clone a given Database Instance, specified by the `region` and `instance_id` parameters. The clone feature allows you to create a new Database Instance from an existing one. The clone includes all existing databases, users and permissions. You can create a clone on a Database Instance bigger than your current one.
320
- *
321
- * @param request - The request {@link CloneInstanceRequest}
322
- * @returns A Promise of Instance
323
- */
324
- cloneInstance = (request) => this.client.fetch(
325
- {
326
- body: JSON.stringify(
327
- marshalling_gen.marshalCloneInstanceRequest(request, this.client.settings)
328
- ),
329
- headers: jsonContentHeaders,
330
- method: "POST",
331
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/clone`
332
- },
333
- marshalling_gen.unmarshalInstance
334
- );
335
- /**
336
- * Restart Database Instance. Restart a given Database Instance, specified by the `region` and `instance_id` parameters. The status of the Database Instance returned in the response.
337
- *
338
- * @param request - The request {@link RestartInstanceRequest}
339
- * @returns A Promise of Instance
340
- */
341
- restartInstance = (request) => this.client.fetch(
342
- {
343
- body: "{}",
344
- headers: jsonContentHeaders,
345
- method: "POST",
346
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/restart`
347
- },
348
- marshalling_gen.unmarshalInstance
349
- );
350
- /**
351
- * Get the TLS certificate of a Database Instance. Retrieve information about the TLS certificate of a given Database Instance. Details like name and content are returned in the response.
352
- *
353
- * @param request - The request {@link GetInstanceCertificateRequest}
354
- * @returns A Promise of Blob
355
- */
356
- getInstanceCertificate = (request) => this.client.fetch({
357
- method: "GET",
358
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/certificate`,
359
- urlParams: sdkClient.urlParams(["dl", 1]),
360
- responseType: "blob"
361
- });
362
- /**
363
- * Renew the TLS certificate of a Database Instance. Renew a TLS for a Database Instance. Renewing a certificate means that you will not be able to connect to your Database Instance using the previous certificate. You will also need to download and update the new certificate for all database clients.
364
- *
365
- * @param request - The request {@link RenewInstanceCertificateRequest}
366
- */
367
- renewInstanceCertificate = (request) => this.client.fetch({
368
- body: "{}",
369
- headers: jsonContentHeaders,
370
- method: "POST",
371
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/renew-certificate`
372
- });
373
- /**
374
- * Get Database Instance metrics. Retrieve the time series metrics of a given Database Instance. You can define the period from which to retrieve metrics by specifying the `start_date` and `end_date`.
375
- *
376
- * @param request - The request {@link GetInstanceMetricsRequest}
377
- * @returns A Promise of InstanceMetrics
378
- */
379
- getInstanceMetrics = (request) => this.client.fetch(
380
- {
381
- method: "GET",
382
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/metrics`,
383
- urlParams: sdkClient.urlParams(
384
- ["end_date", request.endDate],
385
- ["metric_name", request.metricName],
386
- ["start_date", request.startDate]
387
- )
388
- },
389
- marshalling_gen.unmarshalInstanceMetrics
390
- );
391
- /**
392
- * Create a Read Replica. Create a new Read Replica of a Database Instance. You must specify the `region` and the `instance_id`. You can only create a maximum of 3 Read Replicas per Database Instance.
393
- *
394
- * @param request - The request {@link CreateReadReplicaRequest}
395
- * @returns A Promise of ReadReplica
396
- */
397
- createReadReplica = (request) => this.client.fetch(
398
- {
399
- body: JSON.stringify(
400
- marshalling_gen.marshalCreateReadReplicaRequest(request, this.client.settings)
401
- ),
402
- headers: jsonContentHeaders,
403
- method: "POST",
404
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas`
405
- },
406
- marshalling_gen.unmarshalReadReplica
407
- );
408
- /**
409
- * Get a Read Replica. Retrieve information about a Database Instance Read Replica. Full details about the Read Replica, like `endpoints`, `status` and `region` are returned in the response.
410
- *
411
- * @param request - The request {@link GetReadReplicaRequest}
412
- * @returns A Promise of ReadReplica
413
- */
414
- getReadReplica = (request) => this.client.fetch(
415
- {
416
- method: "GET",
417
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${sdkClient.validatePathParam("readReplicaId", request.readReplicaId)}`
418
- },
419
- marshalling_gen.unmarshalReadReplica
420
- );
421
- /**
422
- * Waits for {@link ReadReplica} to be in a final state.
423
- *
424
- * @param request - The request {@link GetReadReplicaRequest}
425
- * @param options - The waiting options
426
- * @returns A Promise of ReadReplica
427
- */
428
- waitForReadReplica = (request, options) => sdkClient.waitForResource(
429
- options?.stop ?? ((res) => Promise.resolve(
430
- !content_gen.READ_REPLICA_TRANSIENT_STATUSES.includes(res.status)
431
- )),
432
- this.getReadReplica,
433
- request,
434
- options
435
- );
436
- /**
437
- * Delete a Read Replica. Delete a Read Replica of a Database Instance. You must specify the `region` and `read_replica_id` parameters of the Read Replica you want to delete.
438
- *
439
- * @param request - The request {@link DeleteReadReplicaRequest}
440
- * @returns A Promise of ReadReplica
441
- */
442
- deleteReadReplica = (request) => this.client.fetch(
443
- {
444
- method: "DELETE",
445
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${sdkClient.validatePathParam("readReplicaId", request.readReplicaId)}`
446
- },
447
- marshalling_gen.unmarshalReadReplica
448
- );
449
- /**
450
- * Resync a Read Replica. When you resync a Read Replica, first it is reset, then its data is resynchronized from the primary node. Your Read Replica remains unavailable during the resync process. The duration of this process is proportional to the size of your Database Instance.
451
- The configured endpoints do not change.
452
- *
453
- * @param request - The request {@link ResetReadReplicaRequest}
454
- * @returns A Promise of ReadReplica
455
- */
456
- resetReadReplica = (request) => this.client.fetch(
457
- {
458
- body: "{}",
459
- headers: jsonContentHeaders,
460
- method: "POST",
461
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${sdkClient.validatePathParam("readReplicaId", request.readReplicaId)}/reset`
462
- },
463
- marshalling_gen.unmarshalReadReplica
464
- );
465
- /**
466
- * Promote a Read Replica. Promote a Read Replica to Database Instance automatically.
467
- *
468
- * @param request - The request {@link PromoteReadReplicaRequest}
469
- * @returns A Promise of Instance
470
- */
471
- promoteReadReplica = (request) => this.client.fetch(
472
- {
473
- body: "{}",
474
- headers: jsonContentHeaders,
475
- method: "POST",
476
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${sdkClient.validatePathParam("readReplicaId", request.readReplicaId)}/promote`
477
- },
478
- marshalling_gen.unmarshalInstance
479
- );
480
- /**
481
- * Create an endpoint for a Read Replica. Create a new endpoint for a Read Replica. Read Replicas can have at most one direct access and one Private Network endpoint.
482
- *
483
- * @param request - The request {@link CreateReadReplicaEndpointRequest}
484
- * @returns A Promise of ReadReplica
485
- */
486
- createReadReplicaEndpoint = (request) => this.client.fetch(
487
- {
488
- body: JSON.stringify(
489
- marshalling_gen.marshalCreateReadReplicaEndpointRequest(
490
- request,
491
- this.client.settings
492
- )
493
- ),
494
- headers: jsonContentHeaders,
495
- method: "POST",
496
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${sdkClient.validatePathParam("readReplicaId", request.readReplicaId)}/endpoints`
497
- },
498
- marshalling_gen.unmarshalReadReplica
499
- );
500
- /**
501
- * Prepare logs of a Database Instance. Prepare your Database Instance logs. You can define the `start_date` and `end_date` parameters for your query. The download URL is returned in the response. Logs are recorded from 00h00 to 23h59 and then aggregated in a `.log` file once a day. Therefore, even if you specify a timeframe from which you want to get the logs, you will receive logs from the full 24 hours.
502
- *
503
- * @param request - The request {@link PrepareInstanceLogsRequest}
504
- * @returns A Promise of PrepareInstanceLogsResponse
505
- */
506
- prepareInstanceLogs = (request) => this.client.fetch(
507
- {
508
- body: JSON.stringify(
509
- marshalling_gen.marshalPrepareInstanceLogsRequest(request, this.client.settings)
510
- ),
511
- headers: jsonContentHeaders,
512
- method: "POST",
513
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/prepare-logs`
514
- },
515
- marshalling_gen.unmarshalPrepareInstanceLogsResponse
516
- );
517
- /**
518
- * List available logs of a Database Instance. List the available logs of a Database Instance. By default, the logs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field.
519
- *
520
- * @param request - The request {@link ListInstanceLogsRequest}
521
- * @returns A Promise of ListInstanceLogsResponse
522
- */
523
- listInstanceLogs = (request) => this.client.fetch(
524
- {
525
- method: "GET",
526
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/logs`,
527
- urlParams: sdkClient.urlParams(["order_by", request.orderBy])
528
- },
529
- marshalling_gen.unmarshalListInstanceLogsResponse
530
- );
531
- /**
532
- * Get given logs of a Database Instance. Retrieve information about the logs of a Database Instance. Specify the `instance_log_id` and `region` in your request to get information such as `download_url`, `status`, `expires_at` and `created_at` about your logs in the response.
533
- *
534
- * @param request - The request {@link GetInstanceLogRequest}
535
- * @returns A Promise of InstanceLog
536
- */
537
- getInstanceLog = (request) => this.client.fetch(
538
- {
539
- method: "GET",
540
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/logs/${sdkClient.validatePathParam("instanceLogId", request.instanceLogId)}`
541
- },
542
- marshalling_gen.unmarshalInstanceLog
543
- );
544
- /**
545
- * Waits for {@link InstanceLog} to be in a final state.
546
- *
547
- * @param request - The request {@link GetInstanceLogRequest}
548
- * @param options - The waiting options
549
- * @returns A Promise of InstanceLog
550
- */
551
- waitForInstanceLog = (request, options) => sdkClient.waitForResource(
552
- options?.stop ?? ((res) => Promise.resolve(
553
- !content_gen.INSTANCE_LOG_TRANSIENT_STATUSES.includes(res.status)
554
- )),
555
- this.getInstanceLog,
556
- request,
557
- options
558
- );
559
- /**
560
- * Purge remote Database Instance logs. Purge a given remote log from a Database Instance. You can specify the `log_name` of the log you wish to clean from your Database Instance.
561
- *
562
- * @param request - The request {@link PurgeInstanceLogsRequest}
563
- */
564
- purgeInstanceLogs = (request) => this.client.fetch({
565
- body: JSON.stringify(
566
- marshalling_gen.marshalPurgeInstanceLogsRequest(request, this.client.settings)
567
- ),
568
- headers: jsonContentHeaders,
569
- method: "POST",
570
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/purge-logs`
571
- });
572
- /**
573
- * List remote Database Instance logs details. List remote log details. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field.
574
- *
575
- * @param request - The request {@link ListInstanceLogsDetailsRequest}
576
- * @returns A Promise of ListInstanceLogsDetailsResponse
577
- */
578
- listInstanceLogsDetails = (request) => this.client.fetch(
579
- {
580
- method: "GET",
581
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/logs-details`
582
- },
583
- marshalling_gen.unmarshalListInstanceLogsDetailsResponse
584
- );
585
- /**
586
- * Add Database Instance advanced settings. Add an advanced setting to a Database Instance. You must set the `name` and the `value` of each setting.
587
- *
588
- * @param request - The request {@link AddInstanceSettingsRequest}
589
- * @returns A Promise of AddInstanceSettingsResponse
590
- */
591
- addInstanceSettings = (request) => this.client.fetch(
592
- {
593
- body: JSON.stringify(
594
- marshalling_gen.marshalAddInstanceSettingsRequest(request, this.client.settings)
595
- ),
596
- headers: jsonContentHeaders,
597
- method: "POST",
598
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/settings`
599
- },
600
- marshalling_gen.unmarshalAddInstanceSettingsResponse
601
- );
602
- /**
603
- * Delete Database Instance advanced settings. Delete an advanced setting in a Database Instance. You must specify the names of the settings you want to delete in the request.
604
- *
605
- * @param request - The request {@link DeleteInstanceSettingsRequest}
606
- * @returns A Promise of DeleteInstanceSettingsResponse
607
- */
608
- deleteInstanceSettings = (request) => this.client.fetch(
609
- {
610
- body: JSON.stringify(
611
- marshalling_gen.marshalDeleteInstanceSettingsRequest(request, this.client.settings)
612
- ),
613
- headers: jsonContentHeaders,
614
- method: "DELETE",
615
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/settings`
616
- },
617
- marshalling_gen.unmarshalDeleteInstanceSettingsResponse
618
- );
619
- /**
620
- * Set Database Instance advanced settings. Update an advanced setting for a Database Instance. Settings added upon database engine initialization can only be defined once, and cannot, therefore, be updated.
621
- *
622
- * @param request - The request {@link SetInstanceSettingsRequest}
623
- * @returns A Promise of SetInstanceSettingsResponse
624
- */
625
- setInstanceSettings = (request) => this.client.fetch(
626
- {
627
- body: JSON.stringify(
628
- marshalling_gen.marshalSetInstanceSettingsRequest(request, this.client.settings)
629
- ),
630
- headers: jsonContentHeaders,
631
- method: "PUT",
632
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/settings`
633
- },
634
- marshalling_gen.unmarshalSetInstanceSettingsResponse
635
- );
636
- pageOfListInstanceACLRules = (request) => this.client.fetch(
637
- {
638
- method: "GET",
639
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/acls`,
640
- urlParams: sdkClient.urlParams(
641
- ["page", request.page],
642
- [
643
- "page_size",
644
- request.pageSize ?? this.client.settings.defaultPageSize
645
- ]
646
- )
647
- },
648
- marshalling_gen.unmarshalListInstanceACLRulesResponse
649
- );
650
- /**
651
- * List ACL rules of a Database Instance. List the ACL rules for a given Database Instance. The response is an array of ACL objects, each one representing an ACL that denies, allows or redirects traffic based on certain conditions.
652
- *
653
- * @param request - The request {@link ListInstanceACLRulesRequest}
654
- * @returns A Promise of ListInstanceACLRulesResponse
655
- */
656
- listInstanceACLRules = (request) => sdkClient.enrichForPagination("rules", this.pageOfListInstanceACLRules, request);
657
- /**
658
- * Add an ACL rule to a Database Instance. Add an additional ACL rule to a Database Instance.
659
- *
660
- * @param request - The request {@link AddInstanceACLRulesRequest}
661
- * @returns A Promise of AddInstanceACLRulesResponse
662
- */
663
- addInstanceACLRules = (request) => this.client.fetch(
664
- {
665
- body: JSON.stringify(
666
- marshalling_gen.marshalAddInstanceACLRulesRequest(request, this.client.settings)
667
- ),
668
- headers: jsonContentHeaders,
669
- method: "POST",
670
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/acls`
671
- },
672
- marshalling_gen.unmarshalAddInstanceACLRulesResponse
673
- );
674
- /**
675
- * Set ACL rules for a Database Instance. Replace all the ACL rules of a Database Instance.
676
- *
677
- * @param request - The request {@link SetInstanceACLRulesRequest}
678
- * @returns A Promise of SetInstanceACLRulesResponse
679
- */
680
- setInstanceACLRules = (request) => this.client.fetch(
681
- {
682
- body: JSON.stringify(
683
- marshalling_gen.marshalSetInstanceACLRulesRequest(request, this.client.settings)
684
- ),
685
- headers: jsonContentHeaders,
686
- method: "PUT",
687
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/acls`
688
- },
689
- marshalling_gen.unmarshalSetInstanceACLRulesResponse
690
- );
691
- /**
692
- * Delete ACL rules of a Database Instance. Delete one or more ACL rules of a Database Instance.
693
- *
694
- * @param request - The request {@link DeleteInstanceACLRulesRequest}
695
- * @returns A Promise of DeleteInstanceACLRulesResponse
696
- */
697
- deleteInstanceACLRules = (request) => this.client.fetch(
698
- {
699
- body: JSON.stringify(
700
- marshalling_gen.marshalDeleteInstanceACLRulesRequest(request, this.client.settings)
701
- ),
702
- headers: jsonContentHeaders,
703
- method: "DELETE",
704
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/acls`
705
- },
706
- marshalling_gen.unmarshalDeleteInstanceACLRulesResponse
707
- );
708
- pageOfListUsers = (request) => this.client.fetch(
709
- {
710
- method: "GET",
711
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/users`,
712
- urlParams: sdkClient.urlParams(
713
- ["name", request.name],
714
- ["order_by", request.orderBy],
715
- ["page", request.page],
716
- [
717
- "page_size",
718
- request.pageSize ?? this.client.settings.defaultPageSize
719
- ]
720
- )
721
- },
722
- marshalling_gen.unmarshalListUsersResponse
723
- );
724
- /**
725
- * List users of a Database Instance. List all users of a given Database Instance. By default, the users returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field.
726
- *
727
- * @param request - The request {@link ListUsersRequest}
728
- * @returns A Promise of ListUsersResponse
729
- */
730
- listUsers = (request) => sdkClient.enrichForPagination("users", this.pageOfListUsers, request);
731
- /**
732
- * Create a user for a Database Instance. Create a new user for a Database Instance. You must define the `name`, `password` and `is_admin` parameters.
733
- *
734
- * @param request - The request {@link CreateUserRequest}
735
- * @returns A Promise of User
736
- */
737
- createUser = (request) => this.client.fetch(
738
- {
739
- body: JSON.stringify(
740
- marshalling_gen.marshalCreateUserRequest(request, this.client.settings)
741
- ),
742
- headers: jsonContentHeaders,
743
- method: "POST",
744
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/users`
745
- },
746
- marshalling_gen.unmarshalUser
747
- );
748
- /**
749
- * Update a user on a Database Instance. Update the parameters of a user on a Database Instance. You can update the `password` and `is_admin` parameters, but you cannot change the name of the user.
750
- *
751
- * @param request - The request {@link UpdateUserRequest}
752
- * @returns A Promise of User
753
- */
754
- updateUser = (request) => this.client.fetch(
755
- {
756
- body: JSON.stringify(
757
- marshalling_gen.marshalUpdateUserRequest(request, this.client.settings)
758
- ),
759
- headers: jsonContentHeaders,
760
- method: "PATCH",
761
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/users/${sdkClient.validatePathParam("name", request.name)}`
762
- },
763
- marshalling_gen.unmarshalUser
764
- );
765
- /**
766
- * Delete a user on a Database Instance. Delete a given user on a Database Instance. You must specify, in the endpoint, the `region`, `instance_id` and `name` parameters of the user you want to delete.
767
- *
768
- * @param request - The request {@link DeleteUserRequest}
769
- */
770
- deleteUser = (request) => this.client.fetch({
771
- method: "DELETE",
772
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/users/${sdkClient.validatePathParam("name", request.name)}`
773
- });
774
- pageOfListDatabases = (request) => this.client.fetch(
775
- {
776
- method: "GET",
777
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/databases`,
778
- urlParams: sdkClient.urlParams(
779
- ["managed", request.managed],
780
- ["name", request.name],
781
- ["order_by", request.orderBy],
782
- ["owner", request.owner],
783
- ["page", request.page],
784
- [
785
- "page_size",
786
- request.pageSize ?? this.client.settings.defaultPageSize
787
- ],
788
- ["skip_size_retrieval", request.skipSizeRetrieval]
789
- )
790
- },
791
- marshalling_gen.unmarshalListDatabasesResponse
792
- );
793
- /**
794
- * List databases in a Database Instance. List all databases of a given Database Instance. By default, the databases returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `name`, `managed` and `owner`.
795
- *
796
- * @param request - The request {@link ListDatabasesRequest}
797
- * @returns A Promise of ListDatabasesResponse
798
- */
799
- listDatabases = (request) => sdkClient.enrichForPagination("databases", this.pageOfListDatabases, request);
800
- /**
801
- * Create a database in a Database Instance. Create a new database. You must define the `name` parameter in the request.
802
- *
803
- * @param request - The request {@link CreateDatabaseRequest}
804
- * @returns A Promise of Database
805
- */
806
- createDatabase = (request) => this.client.fetch(
807
- {
808
- body: JSON.stringify(
809
- marshalling_gen.marshalCreateDatabaseRequest(request, this.client.settings)
810
- ),
811
- headers: jsonContentHeaders,
812
- method: "POST",
813
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/databases`
814
- },
815
- marshalling_gen.unmarshalDatabase
816
- );
817
- /**
818
- * Delete a database in a Database Instance. Delete a given database on a Database Instance. You must specify, in the endpoint, the `region`, `instance_id` and `name` parameters of the database you want to delete.
819
- *
820
- * @param request - The request {@link DeleteDatabaseRequest}
821
- */
822
- deleteDatabase = (request) => this.client.fetch({
823
- method: "DELETE",
824
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/databases/${sdkClient.validatePathParam("name", request.name)}`
825
- });
826
- pageOfListPrivileges = (request) => this.client.fetch(
827
- {
828
- method: "GET",
829
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/privileges`,
830
- urlParams: sdkClient.urlParams(
831
- ["database_name", request.databaseName],
832
- ["order_by", request.orderBy],
833
- ["page", request.page],
834
- [
835
- "page_size",
836
- request.pageSize ?? this.client.settings.defaultPageSize
837
- ],
838
- ["user_name", request.userName]
839
- )
840
- },
841
- marshalling_gen.unmarshalListPrivilegesResponse
842
- );
843
- /**
844
- * List user privileges for a database. List privileges of a user on a database. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `database_name` and `user_name`.
845
- *
846
- * @param request - The request {@link ListPrivilegesRequest}
847
- * @returns A Promise of ListPrivilegesResponse
848
- */
849
- listPrivileges = (request) => sdkClient.enrichForPagination("privileges", this.pageOfListPrivileges, request);
850
- /**
851
- * Set user privileges for a database. Set the privileges of a user on a database. You must define `database_name`, `user_name` and `permission` in the request body.
852
- *
853
- * @param request - The request {@link SetPrivilegeRequest}
854
- * @returns A Promise of Privilege
855
- */
856
- setPrivilege = (request) => this.client.fetch(
857
- {
858
- body: JSON.stringify(
859
- marshalling_gen.marshalSetPrivilegeRequest(request, this.client.settings)
860
- ),
861
- headers: jsonContentHeaders,
862
- method: "PUT",
863
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/privileges`
864
- },
865
- marshalling_gen.unmarshalPrivilege
866
- );
867
- pageOfListSnapshots = (request = {}) => this.client.fetch(
868
- {
869
- method: "GET",
870
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots`,
871
- urlParams: sdkClient.urlParams(
872
- ["instance_id", request.instanceId],
873
- ["name", request.name],
874
- ["order_by", request.orderBy],
875
- ["organization_id", request.organizationId],
876
- ["page", request.page],
877
- [
878
- "page_size",
879
- request.pageSize ?? this.client.settings.defaultPageSize
880
- ],
881
- ["project_id", request.projectId]
882
- )
883
- },
884
- marshalling_gen.unmarshalListSnapshotsResponse
885
- );
886
- /**
887
- * List snapshots. List snapshots. You can include the `instance_id` or `project_id` in your query to get the list of snapshots for specific Database Instances and/or Projects. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
888
- *
889
- * @param request - The request {@link ListSnapshotsRequest}
890
- * @returns A Promise of ListSnapshotsResponse
891
- */
892
- listSnapshots = (request = {}) => sdkClient.enrichForPagination("snapshots", this.pageOfListSnapshots, request);
893
- /**
894
- * Get a Database Instance snapshot. Retrieve information about a given snapshot, specified by its `snapshot_id` and `region`. Full details about the snapshot, like size and expiration date, are returned in the response.
895
- *
896
- * @param request - The request {@link GetSnapshotRequest}
897
- * @returns A Promise of Snapshot
898
- */
899
- getSnapshot = (request) => this.client.fetch(
900
- {
901
- method: "GET",
902
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${sdkClient.validatePathParam("snapshotId", request.snapshotId)}`
903
- },
904
- marshalling_gen.unmarshalSnapshot
905
- );
906
- /**
907
- * Waits for {@link Snapshot} to be in a final state.
908
- *
909
- * @param request - The request {@link GetSnapshotRequest}
910
- * @param options - The waiting options
911
- * @returns A Promise of Snapshot
912
- */
913
- waitForSnapshot = (request, options) => sdkClient.waitForResource(
914
- options?.stop ?? ((res) => Promise.resolve(
915
- !content_gen.SNAPSHOT_TRANSIENT_STATUSES.includes(res.status)
916
- )),
917
- this.getSnapshot,
918
- request,
919
- options
920
- );
921
- /**
922
- * Create a Database Instance snapshot. Create a new snapshot of a Database Instance. You must define the `name` parameter in the request.
923
- *
924
- * @param request - The request {@link CreateSnapshotRequest}
925
- * @returns A Promise of Snapshot
926
- */
927
- createSnapshot = (request) => this.client.fetch(
928
- {
929
- body: JSON.stringify(
930
- marshalling_gen.marshalCreateSnapshotRequest(request, this.client.settings)
931
- ),
932
- headers: jsonContentHeaders,
933
- method: "POST",
934
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/snapshots`
935
- },
936
- marshalling_gen.unmarshalSnapshot
937
- );
938
- /**
939
- * Update a Database Instance snapshot. Update the parameters of a snapshot of a Database Instance. You can update the `name` and `expires_at` parameters.
940
- *
941
- * @param request - The request {@link UpdateSnapshotRequest}
942
- * @returns A Promise of Snapshot
943
- */
944
- updateSnapshot = (request) => this.client.fetch(
945
- {
946
- body: JSON.stringify(
947
- marshalling_gen.marshalUpdateSnapshotRequest(request, this.client.settings)
948
- ),
949
- headers: jsonContentHeaders,
950
- method: "PATCH",
951
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${sdkClient.validatePathParam("snapshotId", request.snapshotId)}`
952
- },
953
- marshalling_gen.unmarshalSnapshot
954
- );
955
- /**
956
- * Delete a Database Instance snapshot. Delete a given snapshot of a Database Instance. You must specify, in the endpoint, the `region` and `snapshot_id` parameters of the snapshot you want to delete.
957
- *
958
- * @param request - The request {@link DeleteSnapshotRequest}
959
- * @returns A Promise of Snapshot
960
- */
961
- deleteSnapshot = (request) => this.client.fetch(
962
- {
963
- method: "DELETE",
964
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${sdkClient.validatePathParam("snapshotId", request.snapshotId)}`
965
- },
966
- marshalling_gen.unmarshalSnapshot
967
- );
968
- /**
969
- * Create a new Database Instance from a snapshot. Restore a snapshot. When you restore a snapshot, a new Instance is created and billed to your account. Note that is possible to select a larger node type for your new Database Instance. However, the Block volume size will be the same as the size of the restored snapshot. All Instance settings will be restored if you chose a node type with the same or more memory size than the initial Instance. Settings will be reset to the default if your node type has less memory.
970
- *
971
- * @param request - The request {@link CreateInstanceFromSnapshotRequest}
972
- * @returns A Promise of Instance
973
- */
974
- createInstanceFromSnapshot = (request) => this.client.fetch(
975
- {
976
- body: JSON.stringify(
977
- marshalling_gen.marshalCreateInstanceFromSnapshotRequest(
978
- request,
979
- this.client.settings
980
- )
981
- ),
982
- headers: jsonContentHeaders,
983
- method: "POST",
984
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${sdkClient.validatePathParam("snapshotId", request.snapshotId)}/create-instance`
985
- },
986
- marshalling_gen.unmarshalInstance
987
- );
988
- /**
989
- * Create a new Database Instance endpoint. Create a new endpoint for a Database Instance. You can add `load_balancer` and `private_network` specifications to the body of the request.
990
- *
991
- * @param request - The request {@link CreateEndpointRequest}
992
- * @returns A Promise of Endpoint
993
- */
994
- createEndpoint = (request) => this.client.fetch(
995
- {
996
- body: JSON.stringify(
997
- marshalling_gen.marshalCreateEndpointRequest(request, this.client.settings)
998
- ),
999
- headers: jsonContentHeaders,
1000
- method: "POST",
1001
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/endpoints`
1002
- },
1003
- marshalling_gen.unmarshalEndpoint
1004
- );
1005
- /**
1006
- * Delete a Database Instance endpoint. Delete the endpoint of a Database Instance. You must specify the `region` and `endpoint_id` parameters of the endpoint you want to delete. Note that might need to update any environment configurations that point to the deleted endpoint.
1007
- *
1008
- * @param request - The request {@link DeleteEndpointRequest}
1009
- */
1010
- deleteEndpoint = (request) => this.client.fetch({
1011
- method: "DELETE",
1012
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${sdkClient.validatePathParam("endpointId", request.endpointId)}`
1013
- });
1014
- /**
1015
- * Get a Database Instance endpoint. Retrieve information about a Database Instance endpoint. Full details about the endpoint, like `ip`, `port`, `private_network` and `load_balancer` specifications are returned in the response.
1016
- *
1017
- * @param request - The request {@link GetEndpointRequest}
1018
- * @returns A Promise of Endpoint
1019
- */
1020
- getEndpoint = (request) => this.client.fetch(
1021
- {
1022
- method: "GET",
1023
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${sdkClient.validatePathParam("endpointId", request.endpointId)}`
1024
- },
1025
- marshalling_gen.unmarshalEndpoint
1026
- );
1027
- /**
1028
- * Migrate an existing instance endpoint to another instance.
1029
- *
1030
- * @param request - The request {@link MigrateEndpointRequest}
1031
- * @returns A Promise of Endpoint
1032
- */
1033
- migrateEndpoint = (request) => this.client.fetch(
1034
- {
1035
- body: JSON.stringify(
1036
- marshalling_gen.marshalMigrateEndpointRequest(request, this.client.settings)
1037
- ),
1038
- headers: jsonContentHeaders,
1039
- method: "POST",
1040
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${sdkClient.validatePathParam("endpointId", request.endpointId)}/migrate`
1041
- },
1042
- marshalling_gen.unmarshalEndpoint
1043
- );
1044
- /**
1045
- * Apply Database Instance maintenance. Apply maintenance tasks to your Database Instance. This will trigger pending maintenance tasks to start in your Database Instance and can generate service interruption. Maintenance tasks can be applied between `starts_at` and `stops_at` times, and are run directly by Scaleway at `forced_at` timestamp.
1046
- *
1047
- * @param request - The request {@link ApplyInstanceMaintenanceRequest}
1048
- * @returns A Promise of Maintenance
1049
- */
1050
- applyInstanceMaintenance = (request) => this.client.fetch(
1051
- {
1052
- body: "{}",
1053
- headers: jsonContentHeaders,
1054
- method: "POST",
1055
- path: `/rdb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${sdkClient.validatePathParam("instanceId", request.instanceId)}/apply-maintenance`
1056
- },
1057
- marshalling_gen.unmarshalMaintenance
1058
- );
1059
- }
1060
- exports.API = API;