@scaleway/sdk-mongodb 2.7.0 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/license.md +3 -0
- package/dist/metadata.gen.d.ts +6 -6
- package/dist/metadata.gen.js +6 -2
- package/dist/v1/api.gen.d.ts +3 -3
- package/dist/v1/api.gen.js +152 -326
- package/dist/v1/content.gen.js +3 -3
- package/dist/v1/marshalling.gen.js +40 -40
- package/dist/v1/metadata.gen.js +1 -1
- package/dist/v1/validation-rules.gen.js +17 -17
- package/dist/v1alpha1/api.gen.d.ts +2 -2
- package/dist/v1alpha1/api.gen.js +131 -274
- package/dist/v1alpha1/content.gen.js +2 -2
- package/dist/v1alpha1/marshalling.gen.js +36 -36
- package/dist/v1alpha1/metadata.gen.js +1 -1
- package/dist/v1alpha1/validation-rules.gen.js +14 -14
- package/package.json +15 -14
- package/LICENSE +0 -191
- package/dist/metadata.gen.json +0 -6
- package/dist/metadata2.gen.js +0 -8
package/dist/metadata.gen.d.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* This file is automatically generated
|
|
3
3
|
* PLEASE DO NOT EDIT HERE
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
name:
|
|
7
|
-
namespace:
|
|
8
|
-
displayName:
|
|
9
|
-
versions:
|
|
5
|
+
export declare const pkgMetadata: {
|
|
6
|
+
readonly name: "@scaleway/sdk-mongodb";
|
|
7
|
+
readonly namespace: "mongodb";
|
|
8
|
+
readonly displayName: "Mongodb";
|
|
9
|
+
readonly versions: readonly ["v1", "v1alpha1"];
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type Metadata = typeof pkgMetadata;
|
|
12
12
|
export default pkgMetadata;
|
package/dist/metadata.gen.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import metadata_gen_default from "./metadata2.gen.js";
|
|
2
1
|
//#region src/metadata.gen.ts
|
|
3
2
|
/**
|
|
4
3
|
* This file is automatically generated
|
|
5
4
|
* PLEASE DO NOT EDIT HERE
|
|
6
5
|
*/
|
|
7
|
-
|
|
6
|
+
const pkgMetadata = {
|
|
7
|
+
name: "@scaleway/sdk-mongodb",
|
|
8
|
+
namespace: "mongodb",
|
|
9
|
+
displayName: "Mongodb",
|
|
10
|
+
versions: ["v1", "v1alpha1"]
|
|
11
|
+
};
|
|
8
12
|
//#endregion
|
|
9
13
|
export { pkgMetadata as default, pkgMetadata };
|
package/dist/v1/api.gen.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export declare class API extends ParentAPI {
|
|
|
59
59
|
* @param options - The waiting options
|
|
60
60
|
* @returns A Promise of Instance
|
|
61
61
|
*/
|
|
62
|
-
waitForInstance: (request: Readonly<GetInstanceRequest>, options?: Readonly<WaitForOptions<Instance>>) => Promise<Instance>;
|
|
62
|
+
waitForInstance: (request: Readonly<GetInstanceRequest>, options?: Readonly<WaitForOptions<Instance>> | undefined) => Promise<Instance>;
|
|
63
63
|
/**
|
|
64
64
|
* Create a MongoDB® Database Instance. Create a new MongoDB® Database Instance.
|
|
65
65
|
*
|
|
@@ -116,7 +116,7 @@ export declare class API extends ParentAPI {
|
|
|
116
116
|
* @param options - The waiting options
|
|
117
117
|
* @returns A Promise of Snapshot
|
|
118
118
|
*/
|
|
119
|
-
waitForSnapshot: (request: Readonly<GetSnapshotRequest>, options?: Readonly<WaitForOptions<Snapshot>>) => Promise<Snapshot>;
|
|
119
|
+
waitForSnapshot: (request: Readonly<GetSnapshotRequest>, options?: Readonly<WaitForOptions<Snapshot>> | undefined) => Promise<Snapshot>;
|
|
120
120
|
/**
|
|
121
121
|
* Update a Database Instance snapshot. Update the parameters of a snapshot of a Database Instance. You can update the `name` and `expires_at` parameters.
|
|
122
122
|
*
|
|
@@ -236,7 +236,7 @@ export declare class API extends ParentAPI {
|
|
|
236
236
|
* @param options - The waiting options
|
|
237
237
|
* @returns A Promise of Maintenance
|
|
238
238
|
*/
|
|
239
|
-
waitForMaintenance: (request: Readonly<GetMaintenanceRequest>, options?: Readonly<WaitForOptions<Maintenance>>) => Promise<Maintenance>;
|
|
239
|
+
waitForMaintenance: (request: Readonly<GetMaintenanceRequest>, options?: Readonly<WaitForOptions<Maintenance>> | undefined) => Promise<Maintenance>;
|
|
240
240
|
/**
|
|
241
241
|
* Apply a maintenance of a MongoDB® Database Instance.. Apply a maintenance of a MongoDB® Database Instance.
|
|
242
242
|
*
|
package/dist/v1/api.gen.js
CHANGED
|
@@ -2,338 +2,164 @@ import { INSTANCE_TRANSIENT_STATUSES, MAINTENANCE_TRANSIENT_STATUSES, SNAPSHOT_T
|
|
|
2
2
|
import { marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalEndpoint, unmarshalInstance, unmarshalListDatabasesResponse, unmarshalListInstancesResponse, unmarshalListMaintenancesResponse, unmarshalListNodeTypesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalMaintenance, unmarshalSnapshot, unmarshalUser } from "./marshalling.gen.js";
|
|
3
3
|
import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
4
|
//#region src/v1/api.gen.ts
|
|
5
|
-
|
|
5
|
+
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
6
6
|
/**
|
|
7
7
|
* Managed MongoDB®.
|
|
8
8
|
|
|
9
9
|
This API allows you to manage your Managed Databases for MongoDB®.
|
|
10
10
|
*/
|
|
11
11
|
var API = class extends API$1 {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
* @returns A Promise of Snapshot
|
|
164
|
-
*/
|
|
165
|
-
updateSnapshot = (request) => this.client.fetch({
|
|
166
|
-
body: JSON.stringify(marshalUpdateSnapshotRequest(request, this.client.settings)),
|
|
167
|
-
headers: jsonContentHeaders,
|
|
168
|
-
method: "PATCH",
|
|
169
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
170
|
-
}, unmarshalSnapshot);
|
|
171
|
-
/**
|
|
172
|
-
* Restore a Database Instance snapshot. Restore a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to restore, the `instance_name` of the new Database Instance, `node_type` of the new Database Instance and `node_amount` of the new Database Instance.
|
|
173
|
-
*
|
|
174
|
-
* @param request - The request {@link RestoreSnapshotRequest}
|
|
175
|
-
* @returns A Promise of Instance
|
|
176
|
-
*/
|
|
177
|
-
restoreSnapshot = (request) => this.client.fetch({
|
|
178
|
-
body: JSON.stringify(marshalRestoreSnapshotRequest(request, this.client.settings)),
|
|
179
|
-
headers: jsonContentHeaders,
|
|
180
|
-
method: "POST",
|
|
181
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}/restore`
|
|
182
|
-
}, unmarshalInstance);
|
|
183
|
-
pageOfListSnapshots = (request = {}) => this.client.fetch({
|
|
184
|
-
method: "GET",
|
|
185
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots`,
|
|
186
|
-
urlParams: urlParams(["instance_id", request.instanceId], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
|
|
187
|
-
}, unmarshalListSnapshotsResponse);
|
|
188
|
-
/**
|
|
189
|
-
* List snapshots. List snapshots. You can include the `instance_id` or `project_id` in your query to get the list of snapshots for specific Database Instances and/or Projects. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
|
|
190
|
-
*
|
|
191
|
-
* @param request - The request {@link ListSnapshotsRequest}
|
|
192
|
-
* @returns A Promise of ListSnapshotsResponse
|
|
193
|
-
*/
|
|
194
|
-
listSnapshots = (request = {}) => enrichForPagination("snapshots", this.pageOfListSnapshots, request);
|
|
195
|
-
/**
|
|
196
|
-
* Delete a Database Instance snapshot. Delete a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to delete.
|
|
197
|
-
*
|
|
198
|
-
* @param request - The request {@link DeleteSnapshotRequest}
|
|
199
|
-
* @returns A Promise of Snapshot
|
|
200
|
-
*/
|
|
201
|
-
deleteSnapshot = (request) => this.client.fetch({
|
|
202
|
-
method: "DELETE",
|
|
203
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
204
|
-
}, unmarshalSnapshot);
|
|
205
|
-
pageOfListUsers = (request) => this.client.fetch({
|
|
206
|
-
method: "GET",
|
|
207
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/users`,
|
|
208
|
-
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
209
|
-
}, unmarshalListUsersResponse);
|
|
210
|
-
/**
|
|
211
|
-
* List users of a Database Instance. List all users of a given Database Instance.
|
|
212
|
-
*
|
|
213
|
-
* @param request - The request {@link ListUsersRequest}
|
|
214
|
-
* @returns A Promise of ListUsersResponse
|
|
215
|
-
*/
|
|
216
|
-
listUsers = (request) => enrichForPagination("users", this.pageOfListUsers, request);
|
|
217
|
-
/**
|
|
218
|
-
* Create an user on a Database Instance. Create an user on a Database Instance. You must define the `name`, `password` of the user and `instance_id` parameters in the request.
|
|
219
|
-
*
|
|
220
|
-
* @param request - The request {@link CreateUserRequest}
|
|
221
|
-
* @returns A Promise of User
|
|
222
|
-
*/
|
|
223
|
-
createUser = (request) => this.client.fetch({
|
|
224
|
-
body: JSON.stringify(marshalCreateUserRequest(request, this.client.settings)),
|
|
225
|
-
headers: jsonContentHeaders,
|
|
226
|
-
method: "POST",
|
|
227
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/users`
|
|
228
|
-
}, unmarshalUser);
|
|
229
|
-
/**
|
|
230
|
-
* Update a user on a Database Instance. Update the parameters of a user on a Database Instance. You can update the `password` parameter, but you cannot change the name of the user.
|
|
231
|
-
*
|
|
232
|
-
* @param request - The request {@link UpdateUserRequest}
|
|
233
|
-
* @returns A Promise of User
|
|
234
|
-
*/
|
|
235
|
-
updateUser = (request) => this.client.fetch({
|
|
236
|
-
body: JSON.stringify(marshalUpdateUserRequest(request, this.client.settings)),
|
|
237
|
-
headers: jsonContentHeaders,
|
|
238
|
-
method: "PATCH",
|
|
239
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/users/${validatePathParam("name", request.name)}`
|
|
240
|
-
}, unmarshalUser);
|
|
241
|
-
/**
|
|
242
|
-
* Delete a user on a Database Instance. Delete an existing user on a Database Instance.
|
|
243
|
-
*
|
|
244
|
-
* @param request - The request {@link DeleteUserRequest}
|
|
245
|
-
*/
|
|
246
|
-
deleteUser = (request) => this.client.fetch({
|
|
247
|
-
method: "DELETE",
|
|
248
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/users/${validatePathParam("name", request.name)}`
|
|
249
|
-
});
|
|
250
|
-
/**
|
|
251
|
-
* Apply user roles. Apply preset roles for a user in a Database Instance.
|
|
252
|
-
*
|
|
253
|
-
* @param request - The request {@link SetUserRoleRequest}
|
|
254
|
-
* @returns A Promise of User
|
|
255
|
-
*/
|
|
256
|
-
setUserRole = (request) => this.client.fetch({
|
|
257
|
-
body: JSON.stringify(marshalSetUserRoleRequest(request, this.client.settings)),
|
|
258
|
-
headers: jsonContentHeaders,
|
|
259
|
-
method: "PUT",
|
|
260
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/set-user-roles`
|
|
261
|
-
}, unmarshalUser);
|
|
262
|
-
pageOfListDatabases = (request) => this.client.fetch({
|
|
263
|
-
method: "GET",
|
|
264
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/databases`,
|
|
265
|
-
urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
266
|
-
}, unmarshalListDatabasesResponse);
|
|
267
|
-
/**
|
|
268
|
-
* List databases in a Database Instance. List all databases of a given Database Instance.
|
|
269
|
-
*
|
|
270
|
-
* @param request - The request {@link ListDatabasesRequest}
|
|
271
|
-
* @returns A Promise of ListDatabasesResponse
|
|
272
|
-
*/
|
|
273
|
-
listDatabases = (request) => enrichForPagination("databases", this.pageOfListDatabases, request);
|
|
274
|
-
/**
|
|
275
|
-
* Delete a Database Instance endpoint. Delete the endpoint of a Database Instance. You must specify the `endpoint_id` parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint.
|
|
276
|
-
*
|
|
277
|
-
* @param request - The request {@link DeleteEndpointRequest}
|
|
278
|
-
*/
|
|
279
|
-
deleteEndpoint = (request) => this.client.fetch({
|
|
280
|
-
method: "DELETE",
|
|
281
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
|
|
282
|
-
});
|
|
283
|
-
/**
|
|
284
|
-
* Create a new Instance endpoint. Create a new endpoint for a MongoDB® Database Instance. You can add `public_network` or `private_network` specifications to the body of the request.
|
|
285
|
-
*
|
|
286
|
-
* @param request - The request {@link CreateEndpointRequest}
|
|
287
|
-
* @returns A Promise of Endpoint
|
|
288
|
-
*/
|
|
289
|
-
createEndpoint = (request) => this.client.fetch({
|
|
290
|
-
body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)),
|
|
291
|
-
headers: jsonContentHeaders,
|
|
292
|
-
method: "POST",
|
|
293
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
|
|
294
|
-
}, unmarshalEndpoint);
|
|
295
|
-
pageOfListMaintenances = (request) => this.client.fetch({
|
|
296
|
-
method: "GET",
|
|
297
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/maintenances`,
|
|
298
|
-
urlParams: urlParams(["instance_id", request.instanceId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
299
|
-
}, unmarshalListMaintenancesResponse);
|
|
300
|
-
/**
|
|
301
|
-
* List all the maintenances of a MongoDB® Database Instance.. List all the maintenances of a MongoDB® Database Instance.
|
|
302
|
-
*
|
|
303
|
-
* @param request - The request {@link ListMaintenancesRequest}
|
|
304
|
-
* @returns A Promise of ListMaintenancesResponse
|
|
305
|
-
*/
|
|
306
|
-
listMaintenances = (request) => enrichForPagination("maintenances", this.pageOfListMaintenances, request);
|
|
307
|
-
/**
|
|
308
|
-
* Get a maintenance of a MongoDB® Database Instance.. Get a maintenance of a MongoDB® Database Instance.
|
|
309
|
-
*
|
|
310
|
-
* @param request - The request {@link GetMaintenanceRequest}
|
|
311
|
-
* @returns A Promise of Maintenance
|
|
312
|
-
*/
|
|
313
|
-
getMaintenance = (request) => this.client.fetch({
|
|
314
|
-
method: "GET",
|
|
315
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/maintenances/${validatePathParam("maintenanceId", request.maintenanceId)}`
|
|
316
|
-
}, unmarshalMaintenance);
|
|
317
|
-
/**
|
|
318
|
-
* Waits for {@link Maintenance} to be in a final state.
|
|
319
|
-
*
|
|
320
|
-
* @param request - The request {@link GetMaintenanceRequest}
|
|
321
|
-
* @param options - The waiting options
|
|
322
|
-
* @returns A Promise of Maintenance
|
|
323
|
-
*/
|
|
324
|
-
waitForMaintenance = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!MAINTENANCE_TRANSIENT_STATUSES.includes(res.status))), this.getMaintenance, request, options);
|
|
325
|
-
/**
|
|
326
|
-
* Apply a maintenance of a MongoDB® Database Instance.. Apply a maintenance of a MongoDB® Database Instance.
|
|
327
|
-
*
|
|
328
|
-
* @param request - The request {@link ApplyMaintenanceRequest}
|
|
329
|
-
* @returns A Promise of Maintenance
|
|
330
|
-
*/
|
|
331
|
-
applyMaintenance = (request) => this.client.fetch({
|
|
332
|
-
body: "{}",
|
|
333
|
-
headers: jsonContentHeaders,
|
|
334
|
-
method: "POST",
|
|
335
|
-
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/maintenances/${validatePathParam("maintenanceId", request.maintenanceId)}/apply`
|
|
336
|
-
}, unmarshalMaintenance);
|
|
12
|
+
constructor(..._args) {
|
|
13
|
+
super(..._args);
|
|
14
|
+
this.pageOfListNodeTypes = (request = {}) => this.client.fetch({
|
|
15
|
+
method: "GET",
|
|
16
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
|
|
17
|
+
urlParams: urlParams(["include_disabled", request.includeDisabled], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
18
|
+
}, unmarshalListNodeTypesResponse);
|
|
19
|
+
this.listNodeTypes = (request = {}) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
|
|
20
|
+
this.pageOfListVersions = (request = {}) => this.client.fetch({
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions`,
|
|
23
|
+
urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["version", request.version])
|
|
24
|
+
}, unmarshalListVersionsResponse);
|
|
25
|
+
this.listVersions = (request = {}) => enrichForPagination("versions", this.pageOfListVersions, request);
|
|
26
|
+
this.pageOfListInstances = (request = {}) => this.client.fetch({
|
|
27
|
+
method: "GET",
|
|
28
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances`,
|
|
29
|
+
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
|
|
30
|
+
}, unmarshalListInstancesResponse);
|
|
31
|
+
this.listInstances = (request = {}) => enrichForPagination("instances", this.pageOfListInstances, request);
|
|
32
|
+
this.getInstance = (request) => this.client.fetch({
|
|
33
|
+
method: "GET",
|
|
34
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}`
|
|
35
|
+
}, unmarshalInstance);
|
|
36
|
+
this.waitForInstance = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!INSTANCE_TRANSIENT_STATUSES.includes(res.status))), this.getInstance, request, options);
|
|
37
|
+
this.createInstance = (request) => this.client.fetch({
|
|
38
|
+
body: JSON.stringify(marshalCreateInstanceRequest(request, this.client.settings)),
|
|
39
|
+
headers: jsonContentHeaders,
|
|
40
|
+
method: "POST",
|
|
41
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances`
|
|
42
|
+
}, unmarshalInstance);
|
|
43
|
+
this.updateInstance = (request) => this.client.fetch({
|
|
44
|
+
body: JSON.stringify(marshalUpdateInstanceRequest(request, this.client.settings)),
|
|
45
|
+
headers: jsonContentHeaders,
|
|
46
|
+
method: "PATCH",
|
|
47
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}`
|
|
48
|
+
}, unmarshalInstance);
|
|
49
|
+
this.deleteInstance = (request) => this.client.fetch({
|
|
50
|
+
method: "DELETE",
|
|
51
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}`
|
|
52
|
+
}, unmarshalInstance);
|
|
53
|
+
this.upgradeInstance = (request) => this.client.fetch({
|
|
54
|
+
body: JSON.stringify(marshalUpgradeInstanceRequest(request, this.client.settings)),
|
|
55
|
+
headers: jsonContentHeaders,
|
|
56
|
+
method: "POST",
|
|
57
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/upgrade`
|
|
58
|
+
}, unmarshalInstance);
|
|
59
|
+
this.getInstanceCertificate = (request) => this.client.fetch({
|
|
60
|
+
method: "GET",
|
|
61
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/certificate`,
|
|
62
|
+
urlParams: urlParams(["dl", 1]),
|
|
63
|
+
responseType: "blob"
|
|
64
|
+
});
|
|
65
|
+
this.createSnapshot = (request) => this.client.fetch({
|
|
66
|
+
body: JSON.stringify(marshalCreateSnapshotRequest(request, this.client.settings)),
|
|
67
|
+
headers: jsonContentHeaders,
|
|
68
|
+
method: "POST",
|
|
69
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots`
|
|
70
|
+
}, unmarshalSnapshot);
|
|
71
|
+
this.getSnapshot = (request) => this.client.fetch({
|
|
72
|
+
method: "GET",
|
|
73
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
74
|
+
}, unmarshalSnapshot);
|
|
75
|
+
this.waitForSnapshot = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))), this.getSnapshot, request, options);
|
|
76
|
+
this.updateSnapshot = (request) => this.client.fetch({
|
|
77
|
+
body: JSON.stringify(marshalUpdateSnapshotRequest(request, this.client.settings)),
|
|
78
|
+
headers: jsonContentHeaders,
|
|
79
|
+
method: "PATCH",
|
|
80
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
81
|
+
}, unmarshalSnapshot);
|
|
82
|
+
this.restoreSnapshot = (request) => this.client.fetch({
|
|
83
|
+
body: JSON.stringify(marshalRestoreSnapshotRequest(request, this.client.settings)),
|
|
84
|
+
headers: jsonContentHeaders,
|
|
85
|
+
method: "POST",
|
|
86
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}/restore`
|
|
87
|
+
}, unmarshalInstance);
|
|
88
|
+
this.pageOfListSnapshots = (request = {}) => this.client.fetch({
|
|
89
|
+
method: "GET",
|
|
90
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots`,
|
|
91
|
+
urlParams: urlParams(["instance_id", request.instanceId], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
|
|
92
|
+
}, unmarshalListSnapshotsResponse);
|
|
93
|
+
this.listSnapshots = (request = {}) => enrichForPagination("snapshots", this.pageOfListSnapshots, request);
|
|
94
|
+
this.deleteSnapshot = (request) => this.client.fetch({
|
|
95
|
+
method: "DELETE",
|
|
96
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
97
|
+
}, unmarshalSnapshot);
|
|
98
|
+
this.pageOfListUsers = (request) => this.client.fetch({
|
|
99
|
+
method: "GET",
|
|
100
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/users`,
|
|
101
|
+
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
102
|
+
}, unmarshalListUsersResponse);
|
|
103
|
+
this.listUsers = (request) => enrichForPagination("users", this.pageOfListUsers, request);
|
|
104
|
+
this.createUser = (request) => this.client.fetch({
|
|
105
|
+
body: JSON.stringify(marshalCreateUserRequest(request, this.client.settings)),
|
|
106
|
+
headers: jsonContentHeaders,
|
|
107
|
+
method: "POST",
|
|
108
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/users`
|
|
109
|
+
}, unmarshalUser);
|
|
110
|
+
this.updateUser = (request) => this.client.fetch({
|
|
111
|
+
body: JSON.stringify(marshalUpdateUserRequest(request, this.client.settings)),
|
|
112
|
+
headers: jsonContentHeaders,
|
|
113
|
+
method: "PATCH",
|
|
114
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/users/${validatePathParam("name", request.name)}`
|
|
115
|
+
}, unmarshalUser);
|
|
116
|
+
this.deleteUser = (request) => this.client.fetch({
|
|
117
|
+
method: "DELETE",
|
|
118
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/users/${validatePathParam("name", request.name)}`
|
|
119
|
+
});
|
|
120
|
+
this.setUserRole = (request) => this.client.fetch({
|
|
121
|
+
body: JSON.stringify(marshalSetUserRoleRequest(request, this.client.settings)),
|
|
122
|
+
headers: jsonContentHeaders,
|
|
123
|
+
method: "PUT",
|
|
124
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/set-user-roles`
|
|
125
|
+
}, unmarshalUser);
|
|
126
|
+
this.pageOfListDatabases = (request) => this.client.fetch({
|
|
127
|
+
method: "GET",
|
|
128
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/databases`,
|
|
129
|
+
urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
130
|
+
}, unmarshalListDatabasesResponse);
|
|
131
|
+
this.listDatabases = (request) => enrichForPagination("databases", this.pageOfListDatabases, request);
|
|
132
|
+
this.deleteEndpoint = (request) => this.client.fetch({
|
|
133
|
+
method: "DELETE",
|
|
134
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
|
|
135
|
+
});
|
|
136
|
+
this.createEndpoint = (request) => this.client.fetch({
|
|
137
|
+
body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)),
|
|
138
|
+
headers: jsonContentHeaders,
|
|
139
|
+
method: "POST",
|
|
140
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
|
|
141
|
+
}, unmarshalEndpoint);
|
|
142
|
+
this.pageOfListMaintenances = (request) => this.client.fetch({
|
|
143
|
+
method: "GET",
|
|
144
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/maintenances`,
|
|
145
|
+
urlParams: urlParams(["instance_id", request.instanceId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
146
|
+
}, unmarshalListMaintenancesResponse);
|
|
147
|
+
this.listMaintenances = (request) => enrichForPagination("maintenances", this.pageOfListMaintenances, request);
|
|
148
|
+
this.getMaintenance = (request) => this.client.fetch({
|
|
149
|
+
method: "GET",
|
|
150
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/maintenances/${validatePathParam("maintenanceId", request.maintenanceId)}`
|
|
151
|
+
}, unmarshalMaintenance);
|
|
152
|
+
this.waitForMaintenance = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!MAINTENANCE_TRANSIENT_STATUSES.includes(res.status))), this.getMaintenance, request, options);
|
|
153
|
+
this.applyMaintenance = (request) => this.client.fetch({
|
|
154
|
+
body: "{}",
|
|
155
|
+
headers: jsonContentHeaders,
|
|
156
|
+
method: "POST",
|
|
157
|
+
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/maintenances/${validatePathParam("maintenanceId", request.maintenanceId)}/apply`
|
|
158
|
+
}, unmarshalMaintenance);
|
|
159
|
+
}
|
|
160
|
+
static {
|
|
161
|
+
this.LOCALITY = toApiLocality({ regions: ["fr-par"] });
|
|
162
|
+
}
|
|
337
163
|
};
|
|
338
164
|
//#endregion
|
|
339
165
|
export { API };
|
package/dist/v1/content.gen.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/v1/content.gen.ts
|
|
2
2
|
/** Lists transient statutes of the enum {@link InstanceStatus}. */
|
|
3
|
-
|
|
3
|
+
const INSTANCE_TRANSIENT_STATUSES = [
|
|
4
4
|
"provisioning",
|
|
5
5
|
"configuring",
|
|
6
6
|
"deleting",
|
|
@@ -8,9 +8,9 @@ var INSTANCE_TRANSIENT_STATUSES = [
|
|
|
8
8
|
"snapshotting"
|
|
9
9
|
];
|
|
10
10
|
/** Lists transient statutes of the enum {@link MaintenanceStatus}. */
|
|
11
|
-
|
|
11
|
+
const MAINTENANCE_TRANSIENT_STATUSES = ["ongoing"];
|
|
12
12
|
/** Lists transient statutes of the enum {@link SnapshotStatus}. */
|
|
13
|
-
|
|
13
|
+
const SNAPSHOT_TRANSIENT_STATUSES = [
|
|
14
14
|
"creating",
|
|
15
15
|
"restoring",
|
|
16
16
|
"deleting"
|