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