@scaleway/sdk 2.50.0 → 2.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +8 -0
- package/dist/api/baremetal/v1/marshalling.gen.cjs +3 -1
- package/dist/api/baremetal/v1/marshalling.gen.js +3 -1
- package/dist/api/baremetal/v1/types.gen.d.ts +4 -3
- package/dist/api/edge_services/v1alpha1/api.gen.cjs +27 -2
- package/dist/api/edge_services/v1alpha1/api.gen.d.ts +10 -3
- package/dist/api/edge_services/v1alpha1/api.gen.js +28 -3
- package/dist/api/edge_services/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/edge_services/v1alpha1/marshalling.gen.cjs +30 -0
- package/dist/api/edge_services/v1alpha1/marshalling.gen.d.ts +3 -1
- package/dist/api/edge_services/v1alpha1/marshalling.gen.js +30 -0
- package/dist/api/edge_services/v1alpha1/types.gen.d.ts +45 -9
- package/dist/api/iam/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/iam/v1alpha1/types.gen.d.ts +2 -0
- package/dist/api/index.gen.d.ts +2 -1
- package/dist/api/inference/v1beta1/validation-rules.gen.cjs +1 -1
- package/dist/api/inference/v1beta1/validation-rules.gen.js +1 -1
- package/dist/api/instance/v1/api.gen.cjs +0 -37
- package/dist/api/instance/v1/api.gen.d.ts +1 -21
- package/dist/api/instance/v1/api.gen.js +1 -38
- package/dist/api/instance/v1/index.gen.d.ts +1 -1
- package/dist/api/instance/v1/marshalling.gen.cjs +1 -28
- package/dist/api/instance/v1/marshalling.gen.d.ts +1 -3
- package/dist/api/instance/v1/marshalling.gen.js +1 -28
- package/dist/api/instance/v1/types.gen.d.ts +9 -53
- package/dist/api/instance/v1/types.private.gen.d.ts +1 -3
- package/dist/api/jobs/v1alpha1/validation-rules.gen.cjs +2 -2
- package/dist/api/jobs/v1alpha1/validation-rules.gen.js +2 -2
- package/dist/api/mongodb/index.gen.cjs +4 -0
- package/dist/api/mongodb/index.gen.d.ts +5 -0
- package/dist/api/mongodb/index.gen.js +4 -0
- package/dist/api/mongodb/v1alpha1/api.gen.cjs +385 -0
- package/dist/api/mongodb/v1alpha1/api.gen.d.ts +195 -0
- package/dist/api/mongodb/v1alpha1/api.gen.js +385 -0
- package/dist/api/mongodb/v1alpha1/content.gen.cjs +16 -0
- package/dist/api/mongodb/v1alpha1/content.gen.d.ts +5 -0
- package/dist/api/mongodb/v1alpha1/content.gen.js +16 -0
- package/dist/api/mongodb/v1alpha1/index.gen.cjs +9 -0
- package/dist/api/mongodb/v1alpha1/index.gen.d.ts +4 -0
- package/dist/api/mongodb/v1alpha1/index.gen.js +9 -0
- package/dist/api/mongodb/v1alpha1/marshalling.gen.cjs +326 -0
- package/dist/api/mongodb/v1alpha1/marshalling.gen.d.ts +19 -0
- package/dist/api/mongodb/v1alpha1/marshalling.gen.js +326 -0
- package/dist/api/mongodb/v1alpha1/types.gen.d.ts +461 -0
- package/dist/api/mongodb/v1alpha1/validation-rules.gen.cjs +147 -0
- package/dist/api/mongodb/v1alpha1/validation-rules.gen.d.ts +134 -0
- package/dist/api/mongodb/v1alpha1/validation-rules.gen.js +147 -0
- package/dist/api/webhosting/v1alpha1/types.gen.d.ts +1 -1
- package/dist/index.cjs +16 -14
- package/dist/index.js +16 -14
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const intervalRetrier = require("../../../internal/async/interval-retrier.cjs");
|
|
4
|
+
const api = require("../../../scw/api.cjs");
|
|
5
|
+
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
6
|
+
require("../../../vendor/base64/index.cjs");
|
|
7
|
+
const resourcePaginator = require("../../../scw/fetch/resource-paginator.cjs");
|
|
8
|
+
const content_gen = require("./content.gen.cjs");
|
|
9
|
+
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
10
|
+
const jsonContentHeaders = {
|
|
11
|
+
"Content-Type": "application/json; charset=utf-8"
|
|
12
|
+
};
|
|
13
|
+
class API extends api.API {
|
|
14
|
+
/** Lists the available regions of the API. */
|
|
15
|
+
static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"];
|
|
16
|
+
pageOfListNodeTypes = (request = {}) => this.client.fetch(
|
|
17
|
+
{
|
|
18
|
+
method: "GET",
|
|
19
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
|
|
20
|
+
urlParams: marshalling.urlParams(
|
|
21
|
+
["include_disabled_types", request.includeDisabledTypes],
|
|
22
|
+
["page", request.page],
|
|
23
|
+
[
|
|
24
|
+
"page_size",
|
|
25
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
26
|
+
]
|
|
27
|
+
)
|
|
28
|
+
},
|
|
29
|
+
marshalling_gen.unmarshalListNodeTypesResponse
|
|
30
|
+
);
|
|
31
|
+
/**
|
|
32
|
+
* List available node types.
|
|
33
|
+
*
|
|
34
|
+
* @param request - The request {@link ListNodeTypesRequest}
|
|
35
|
+
* @returns A Promise of ListNodeTypesResponse
|
|
36
|
+
*/
|
|
37
|
+
listNodeTypes = (request = {}) => resourcePaginator.enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
|
|
38
|
+
pageOfListVersions = (request = {}) => this.client.fetch(
|
|
39
|
+
{
|
|
40
|
+
method: "GET",
|
|
41
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions`,
|
|
42
|
+
urlParams: marshalling.urlParams(
|
|
43
|
+
["page", request.page],
|
|
44
|
+
[
|
|
45
|
+
"page_size",
|
|
46
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
47
|
+
],
|
|
48
|
+
["version", request.version]
|
|
49
|
+
)
|
|
50
|
+
},
|
|
51
|
+
marshalling_gen.unmarshalListVersionsResponse
|
|
52
|
+
);
|
|
53
|
+
/**
|
|
54
|
+
* List available MongoDB™ versions.
|
|
55
|
+
*
|
|
56
|
+
* @param request - The request {@link ListVersionsRequest}
|
|
57
|
+
* @returns A Promise of ListVersionsResponse
|
|
58
|
+
*/
|
|
59
|
+
listVersions = (request = {}) => resourcePaginator.enrichForPagination("versions", this.pageOfListVersions, request);
|
|
60
|
+
pageOfListInstances = (request = {}) => this.client.fetch(
|
|
61
|
+
{
|
|
62
|
+
method: "GET",
|
|
63
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances`,
|
|
64
|
+
urlParams: marshalling.urlParams(
|
|
65
|
+
["name", request.name],
|
|
66
|
+
["order_by", request.orderBy],
|
|
67
|
+
[
|
|
68
|
+
"organization_id",
|
|
69
|
+
request.organizationId ?? this.client.settings.defaultOrganizationId
|
|
70
|
+
],
|
|
71
|
+
["page", request.page],
|
|
72
|
+
[
|
|
73
|
+
"page_size",
|
|
74
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"project_id",
|
|
78
|
+
request.projectId ?? this.client.settings.defaultProjectId
|
|
79
|
+
],
|
|
80
|
+
["tags", request.tags]
|
|
81
|
+
)
|
|
82
|
+
},
|
|
83
|
+
marshalling_gen.unmarshalListInstancesResponse
|
|
84
|
+
);
|
|
85
|
+
/**
|
|
86
|
+
* List MongoDB™ Database Instances. List all MongoDB™ Database Instances in
|
|
87
|
+
* the specified region, for a given Scaleway Project. By default, the
|
|
88
|
+
* MongoDB™ Database Instances returned in the list are ordered by creation
|
|
89
|
+
* date in ascending order, though this can be modified via the order_by
|
|
90
|
+
* field. You can define additional parameters for your query, such as `tags`
|
|
91
|
+
* and `name`. For the `name` parameter, the value you include will be checked
|
|
92
|
+
* against the whole name string to see if it includes the string you put in
|
|
93
|
+
* the parameter.
|
|
94
|
+
*
|
|
95
|
+
* @param request - The request {@link ListInstancesRequest}
|
|
96
|
+
* @returns A Promise of ListInstancesResponse
|
|
97
|
+
*/
|
|
98
|
+
listInstances = (request = {}) => resourcePaginator.enrichForPagination("instances", this.pageOfListInstances, request);
|
|
99
|
+
/**
|
|
100
|
+
* Get a MongoDB™ Database Instance. Retrieve information about a given
|
|
101
|
+
* MongoDB™ Database Instance, specified by the `region` and `instance_id`
|
|
102
|
+
* parameters. Its full details, including name, status, IP address and port,
|
|
103
|
+
* are returned in the response object.
|
|
104
|
+
*
|
|
105
|
+
* @param request - The request {@link GetInstanceRequest}
|
|
106
|
+
* @returns A Promise of Instance
|
|
107
|
+
*/
|
|
108
|
+
getInstance = (request) => this.client.fetch(
|
|
109
|
+
{
|
|
110
|
+
method: "GET",
|
|
111
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}`
|
|
112
|
+
},
|
|
113
|
+
marshalling_gen.unmarshalInstance
|
|
114
|
+
);
|
|
115
|
+
/**
|
|
116
|
+
* Waits for {@link Instance} to be in a final state.
|
|
117
|
+
*
|
|
118
|
+
* @param request - The request {@link GetInstanceRequest}
|
|
119
|
+
* @param options - The waiting options
|
|
120
|
+
* @returns A Promise of Instance
|
|
121
|
+
*/
|
|
122
|
+
waitForInstance = (request, options) => intervalRetrier.waitForResource(
|
|
123
|
+
options?.stop ?? ((res) => Promise.resolve(!content_gen.INSTANCE_TRANSIENT_STATUSES.includes(res.status))),
|
|
124
|
+
this.getInstance,
|
|
125
|
+
request,
|
|
126
|
+
options
|
|
127
|
+
);
|
|
128
|
+
/**
|
|
129
|
+
* Create a MongoDB™ Database Instance. Create a new MongoDB™ Database
|
|
130
|
+
* Instance.
|
|
131
|
+
*
|
|
132
|
+
* @param request - The request {@link CreateInstanceRequest}
|
|
133
|
+
* @returns A Promise of Instance
|
|
134
|
+
*/
|
|
135
|
+
createInstance = (request) => this.client.fetch(
|
|
136
|
+
{
|
|
137
|
+
body: JSON.stringify(
|
|
138
|
+
marshalling_gen.marshalCreateInstanceRequest(request, this.client.settings)
|
|
139
|
+
),
|
|
140
|
+
headers: jsonContentHeaders,
|
|
141
|
+
method: "POST",
|
|
142
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances`
|
|
143
|
+
},
|
|
144
|
+
marshalling_gen.unmarshalInstance
|
|
145
|
+
);
|
|
146
|
+
/**
|
|
147
|
+
* Update a MongoDB™ Database Instance. Update the parameters of a MongoDB™
|
|
148
|
+
* Database Instance.
|
|
149
|
+
*
|
|
150
|
+
* @param request - The request {@link UpdateInstanceRequest}
|
|
151
|
+
* @returns A Promise of Instance
|
|
152
|
+
*/
|
|
153
|
+
updateInstance = (request) => this.client.fetch(
|
|
154
|
+
{
|
|
155
|
+
body: JSON.stringify(
|
|
156
|
+
marshalling_gen.marshalUpdateInstanceRequest(request, this.client.settings)
|
|
157
|
+
),
|
|
158
|
+
headers: jsonContentHeaders,
|
|
159
|
+
method: "PATCH",
|
|
160
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}`
|
|
161
|
+
},
|
|
162
|
+
marshalling_gen.unmarshalInstance
|
|
163
|
+
);
|
|
164
|
+
/**
|
|
165
|
+
* Delete a MongoDB™ Database Instance. Delete a given MongoDB™ Database
|
|
166
|
+
* Instance, specified by the `region` and `instance_id` parameters. Deleting
|
|
167
|
+
* a MongoDB™ Database Instance is permanent, and cannot be undone. Note that
|
|
168
|
+
* upon deletion all your data will be lost.
|
|
169
|
+
*
|
|
170
|
+
* @param request - The request {@link DeleteInstanceRequest}
|
|
171
|
+
* @returns A Promise of Instance
|
|
172
|
+
*/
|
|
173
|
+
deleteInstance = (request) => this.client.fetch(
|
|
174
|
+
{
|
|
175
|
+
method: "DELETE",
|
|
176
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}`
|
|
177
|
+
},
|
|
178
|
+
marshalling_gen.unmarshalInstance
|
|
179
|
+
);
|
|
180
|
+
/**
|
|
181
|
+
* Upgrade a Database Instance. Upgrade your current Database Instance
|
|
182
|
+
* specifications like volume size.
|
|
183
|
+
*
|
|
184
|
+
* @param request - The request {@link UpgradeInstanceRequest}
|
|
185
|
+
* @returns A Promise of Instance
|
|
186
|
+
*/
|
|
187
|
+
upgradeInstance = (request) => this.client.fetch(
|
|
188
|
+
{
|
|
189
|
+
body: JSON.stringify(
|
|
190
|
+
marshalling_gen.marshalUpgradeInstanceRequest(request, this.client.settings)
|
|
191
|
+
),
|
|
192
|
+
headers: jsonContentHeaders,
|
|
193
|
+
method: "POST",
|
|
194
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/upgrade`
|
|
195
|
+
},
|
|
196
|
+
marshalling_gen.unmarshalInstance
|
|
197
|
+
);
|
|
198
|
+
/**
|
|
199
|
+
* Get the certificate of a Database Instance. Retrieve the certificate of a
|
|
200
|
+
* given Database Instance, specified by the `instance_id` parameter.
|
|
201
|
+
*
|
|
202
|
+
* @param request - The request {@link GetInstanceCertificateRequest}
|
|
203
|
+
* @returns A Promise of Blob
|
|
204
|
+
*/
|
|
205
|
+
getInstanceCertificate = (request) => this.client.fetch({
|
|
206
|
+
method: "GET",
|
|
207
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/certificate`,
|
|
208
|
+
urlParams: marshalling.urlParams(["dl", 1]),
|
|
209
|
+
responseType: "blob"
|
|
210
|
+
});
|
|
211
|
+
/**
|
|
212
|
+
* Create a Database Instance snapshot. Create a new snapshot of a Database
|
|
213
|
+
* Instance. You must define the `name` and `instance_id` parameters in the
|
|
214
|
+
* request.
|
|
215
|
+
*
|
|
216
|
+
* @param request - The request {@link CreateSnapshotRequest}
|
|
217
|
+
* @returns A Promise of Snapshot
|
|
218
|
+
*/
|
|
219
|
+
createSnapshot = (request) => this.client.fetch(
|
|
220
|
+
{
|
|
221
|
+
body: JSON.stringify(
|
|
222
|
+
marshalling_gen.marshalCreateSnapshotRequest(request, this.client.settings)
|
|
223
|
+
),
|
|
224
|
+
headers: jsonContentHeaders,
|
|
225
|
+
method: "POST",
|
|
226
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/snapshots`
|
|
227
|
+
},
|
|
228
|
+
marshalling_gen.unmarshalSnapshot
|
|
229
|
+
);
|
|
230
|
+
/**
|
|
231
|
+
* Get a Database Instance snapshot. Retrieve information about a given
|
|
232
|
+
* snapshot of a Database Instance. You must specify, in the endpoint, the
|
|
233
|
+
* `snapshot_id` parameter of the snapshot you want to retrieve.
|
|
234
|
+
*
|
|
235
|
+
* @param request - The request {@link GetSnapshotRequest}
|
|
236
|
+
* @returns A Promise of Snapshot
|
|
237
|
+
*/
|
|
238
|
+
getSnapshot = (request) => this.client.fetch(
|
|
239
|
+
{
|
|
240
|
+
method: "GET",
|
|
241
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}`
|
|
242
|
+
},
|
|
243
|
+
marshalling_gen.unmarshalSnapshot
|
|
244
|
+
);
|
|
245
|
+
/**
|
|
246
|
+
* Waits for {@link Snapshot} to be in a final state.
|
|
247
|
+
*
|
|
248
|
+
* @param request - The request {@link GetSnapshotRequest}
|
|
249
|
+
* @param options - The waiting options
|
|
250
|
+
* @returns A Promise of Snapshot
|
|
251
|
+
*/
|
|
252
|
+
waitForSnapshot = (request, options) => intervalRetrier.waitForResource(
|
|
253
|
+
options?.stop ?? ((res) => Promise.resolve(!content_gen.SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))),
|
|
254
|
+
this.getSnapshot,
|
|
255
|
+
request,
|
|
256
|
+
options
|
|
257
|
+
);
|
|
258
|
+
updateSnapshot = (request) => this.client.fetch(
|
|
259
|
+
{
|
|
260
|
+
body: JSON.stringify(
|
|
261
|
+
marshalling_gen.marshalUpdateSnapshotRequest(request, this.client.settings)
|
|
262
|
+
),
|
|
263
|
+
headers: jsonContentHeaders,
|
|
264
|
+
method: "POST",
|
|
265
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}`
|
|
266
|
+
},
|
|
267
|
+
marshalling_gen.unmarshalSnapshot
|
|
268
|
+
);
|
|
269
|
+
/**
|
|
270
|
+
* Restore a Database Instance snapshot. Restore a given snapshot of a
|
|
271
|
+
* Database Instance. You must specify, in the endpoint, the `snapshot_id`
|
|
272
|
+
* parameter of the snapshot you want to restore, the `instance_name` of the
|
|
273
|
+
* new Database Instance, `node_type` of the new Database Instance and
|
|
274
|
+
* `node_number` of the new Database Instance.
|
|
275
|
+
*
|
|
276
|
+
* @param request - The request {@link RestoreSnapshotRequest}
|
|
277
|
+
* @returns A Promise of Instance
|
|
278
|
+
*/
|
|
279
|
+
restoreSnapshot = (request) => this.client.fetch(
|
|
280
|
+
{
|
|
281
|
+
body: JSON.stringify(
|
|
282
|
+
marshalling_gen.marshalRestoreSnapshotRequest(request, this.client.settings)
|
|
283
|
+
),
|
|
284
|
+
headers: jsonContentHeaders,
|
|
285
|
+
method: "POST",
|
|
286
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}/restore`
|
|
287
|
+
},
|
|
288
|
+
marshalling_gen.unmarshalInstance
|
|
289
|
+
);
|
|
290
|
+
pageOfListSnapshots = (request = {}) => this.client.fetch(
|
|
291
|
+
{
|
|
292
|
+
method: "GET",
|
|
293
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots`,
|
|
294
|
+
urlParams: marshalling.urlParams(
|
|
295
|
+
["instance_id", request.instanceId],
|
|
296
|
+
["name", request.name],
|
|
297
|
+
["order_by", request.orderBy],
|
|
298
|
+
[
|
|
299
|
+
"organization_id",
|
|
300
|
+
request.organizationId ?? this.client.settings.defaultOrganizationId
|
|
301
|
+
],
|
|
302
|
+
["page", request.page],
|
|
303
|
+
[
|
|
304
|
+
"page_size",
|
|
305
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
306
|
+
],
|
|
307
|
+
[
|
|
308
|
+
"project_id",
|
|
309
|
+
request.projectId ?? this.client.settings.defaultProjectId
|
|
310
|
+
]
|
|
311
|
+
)
|
|
312
|
+
},
|
|
313
|
+
marshalling_gen.unmarshalListSnapshotsResponse
|
|
314
|
+
);
|
|
315
|
+
/**
|
|
316
|
+
* List snapshots. List snapshots. You can include the `instance_id` or
|
|
317
|
+
* `project_id` in your query to get the list of snapshots for specific
|
|
318
|
+
* Database Instances and/or Projects. By default, the details returned in the
|
|
319
|
+
* list are ordered by creation date in ascending order, though this can be
|
|
320
|
+
* modified via the `order_by` field.
|
|
321
|
+
*
|
|
322
|
+
* @param request - The request {@link ListSnapshotsRequest}
|
|
323
|
+
* @returns A Promise of ListSnapshotsResponse
|
|
324
|
+
*/
|
|
325
|
+
listSnapshots = (request = {}) => resourcePaginator.enrichForPagination("snapshots", this.pageOfListSnapshots, request);
|
|
326
|
+
/**
|
|
327
|
+
* Delete a Database Instance snapshot. Delete a given snapshot of a Database
|
|
328
|
+
* Instance. You must specify, in the endpoint, the `snapshot_id` parameter of
|
|
329
|
+
* the snapshot you want to delete.
|
|
330
|
+
*
|
|
331
|
+
* @param request - The request {@link DeleteSnapshotRequest}
|
|
332
|
+
* @returns A Promise of Snapshot
|
|
333
|
+
*/
|
|
334
|
+
deleteSnapshot = (request) => this.client.fetch(
|
|
335
|
+
{
|
|
336
|
+
method: "DELETE",
|
|
337
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}`
|
|
338
|
+
},
|
|
339
|
+
marshalling_gen.unmarshalSnapshot
|
|
340
|
+
);
|
|
341
|
+
pageOfListUsers = (request) => this.client.fetch(
|
|
342
|
+
{
|
|
343
|
+
method: "GET",
|
|
344
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/users`,
|
|
345
|
+
urlParams: marshalling.urlParams(
|
|
346
|
+
["name", request.name],
|
|
347
|
+
["order_by", request.orderBy],
|
|
348
|
+
["page", request.page],
|
|
349
|
+
[
|
|
350
|
+
"page_size",
|
|
351
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
352
|
+
]
|
|
353
|
+
)
|
|
354
|
+
},
|
|
355
|
+
marshalling_gen.unmarshalListUsersResponse
|
|
356
|
+
);
|
|
357
|
+
/**
|
|
358
|
+
* List users of a Database Instance. List all users of a given Database
|
|
359
|
+
* Instance.
|
|
360
|
+
*
|
|
361
|
+
* @param request - The request {@link ListUsersRequest}
|
|
362
|
+
* @returns A Promise of ListUsersResponse
|
|
363
|
+
*/
|
|
364
|
+
listUsers = (request) => resourcePaginator.enrichForPagination("users", this.pageOfListUsers, request);
|
|
365
|
+
/**
|
|
366
|
+
* Update a user on a Database Instance. Update the parameters of a user on a
|
|
367
|
+
* Database Instance. You can update the `password` parameter, but you cannot
|
|
368
|
+
* change the name of the user.
|
|
369
|
+
*
|
|
370
|
+
* @param request - The request {@link UpdateUserRequest}
|
|
371
|
+
* @returns A Promise of User
|
|
372
|
+
*/
|
|
373
|
+
updateUser = (request) => this.client.fetch(
|
|
374
|
+
{
|
|
375
|
+
body: JSON.stringify(
|
|
376
|
+
marshalling_gen.marshalUpdateUserRequest(request, this.client.settings)
|
|
377
|
+
),
|
|
378
|
+
headers: jsonContentHeaders,
|
|
379
|
+
method: "PATCH",
|
|
380
|
+
path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/users/${marshalling.validatePathParam("name", request.name)}`
|
|
381
|
+
},
|
|
382
|
+
marshalling_gen.unmarshalUser
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
exports.API = API;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { API as ParentAPI } from '../../../bridge';
|
|
2
|
+
import type { Region, WaitForOptions } from '../../../bridge';
|
|
3
|
+
import type { CreateInstanceRequest, CreateSnapshotRequest, DeleteInstanceRequest, DeleteSnapshotRequest, GetInstanceCertificateRequest, GetInstanceRequest, GetSnapshotRequest, Instance, ListInstancesRequest, ListInstancesResponse, ListNodeTypesRequest, ListNodeTypesResponse, ListSnapshotsRequest, ListSnapshotsResponse, ListUsersRequest, ListUsersResponse, ListVersionsRequest, ListVersionsResponse, RestoreSnapshotRequest, Snapshot, UpdateInstanceRequest, UpdateSnapshotRequest, UpdateUserRequest, UpgradeInstanceRequest, User } from './types.gen';
|
|
4
|
+
/**
|
|
5
|
+
* Managed Database for MongoDB.
|
|
6
|
+
*
|
|
7
|
+
* This API allows you to manage your Managed Databases for MongoDB.
|
|
8
|
+
*/
|
|
9
|
+
export declare class API extends ParentAPI {
|
|
10
|
+
/** Lists the available regions of the API. */
|
|
11
|
+
static readonly LOCALITIES: Region[];
|
|
12
|
+
protected pageOfListNodeTypes: (request?: Readonly<ListNodeTypesRequest>) => Promise<ListNodeTypesResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* List available node types.
|
|
15
|
+
*
|
|
16
|
+
* @param request - The request {@link ListNodeTypesRequest}
|
|
17
|
+
* @returns A Promise of ListNodeTypesResponse
|
|
18
|
+
*/
|
|
19
|
+
listNodeTypes: (request?: Readonly<ListNodeTypesRequest>) => Promise<ListNodeTypesResponse> & {
|
|
20
|
+
all: () => Promise<import("./types.gen").NodeType[]>;
|
|
21
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").NodeType[], void, void>;
|
|
22
|
+
};
|
|
23
|
+
protected pageOfListVersions: (request?: Readonly<ListVersionsRequest>) => Promise<ListVersionsResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* List available MongoDB™ versions.
|
|
26
|
+
*
|
|
27
|
+
* @param request - The request {@link ListVersionsRequest}
|
|
28
|
+
* @returns A Promise of ListVersionsResponse
|
|
29
|
+
*/
|
|
30
|
+
listVersions: (request?: Readonly<ListVersionsRequest>) => Promise<ListVersionsResponse> & {
|
|
31
|
+
all: () => Promise<import("./types.gen").Version[]>;
|
|
32
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").Version[], void, void>;
|
|
33
|
+
};
|
|
34
|
+
protected pageOfListInstances: (request?: Readonly<ListInstancesRequest>) => Promise<ListInstancesResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* List MongoDB™ Database Instances. List all MongoDB™ Database Instances in
|
|
37
|
+
* the specified region, for a given Scaleway Project. By default, the
|
|
38
|
+
* MongoDB™ Database Instances returned in the list are ordered by creation
|
|
39
|
+
* date in ascending order, though this can be modified via the order_by
|
|
40
|
+
* field. You can define additional parameters for your query, such as `tags`
|
|
41
|
+
* and `name`. For the `name` parameter, the value you include will be checked
|
|
42
|
+
* against the whole name string to see if it includes the string you put in
|
|
43
|
+
* the parameter.
|
|
44
|
+
*
|
|
45
|
+
* @param request - The request {@link ListInstancesRequest}
|
|
46
|
+
* @returns A Promise of ListInstancesResponse
|
|
47
|
+
*/
|
|
48
|
+
listInstances: (request?: Readonly<ListInstancesRequest>) => Promise<ListInstancesResponse> & {
|
|
49
|
+
all: () => Promise<Instance[]>;
|
|
50
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Instance[], void, void>;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Get a MongoDB™ Database Instance. Retrieve information about a given
|
|
54
|
+
* MongoDB™ Database Instance, specified by the `region` and `instance_id`
|
|
55
|
+
* parameters. Its full details, including name, status, IP address and port,
|
|
56
|
+
* are returned in the response object.
|
|
57
|
+
*
|
|
58
|
+
* @param request - The request {@link GetInstanceRequest}
|
|
59
|
+
* @returns A Promise of Instance
|
|
60
|
+
*/
|
|
61
|
+
getInstance: (request: Readonly<GetInstanceRequest>) => Promise<Instance>;
|
|
62
|
+
/**
|
|
63
|
+
* Waits for {@link Instance} to be in a final state.
|
|
64
|
+
*
|
|
65
|
+
* @param request - The request {@link GetInstanceRequest}
|
|
66
|
+
* @param options - The waiting options
|
|
67
|
+
* @returns A Promise of Instance
|
|
68
|
+
*/
|
|
69
|
+
waitForInstance: (request: Readonly<GetInstanceRequest>, options?: Readonly<WaitForOptions<Instance>>) => Promise<Instance>;
|
|
70
|
+
/**
|
|
71
|
+
* Create a MongoDB™ Database Instance. Create a new MongoDB™ Database
|
|
72
|
+
* Instance.
|
|
73
|
+
*
|
|
74
|
+
* @param request - The request {@link CreateInstanceRequest}
|
|
75
|
+
* @returns A Promise of Instance
|
|
76
|
+
*/
|
|
77
|
+
createInstance: (request: Readonly<CreateInstanceRequest>) => Promise<Instance>;
|
|
78
|
+
/**
|
|
79
|
+
* Update a MongoDB™ Database Instance. Update the parameters of a MongoDB™
|
|
80
|
+
* Database Instance.
|
|
81
|
+
*
|
|
82
|
+
* @param request - The request {@link UpdateInstanceRequest}
|
|
83
|
+
* @returns A Promise of Instance
|
|
84
|
+
*/
|
|
85
|
+
updateInstance: (request: Readonly<UpdateInstanceRequest>) => Promise<Instance>;
|
|
86
|
+
/**
|
|
87
|
+
* Delete a MongoDB™ Database Instance. Delete a given MongoDB™ Database
|
|
88
|
+
* Instance, specified by the `region` and `instance_id` parameters. Deleting
|
|
89
|
+
* a MongoDB™ Database Instance is permanent, and cannot be undone. Note that
|
|
90
|
+
* upon deletion all your data will be lost.
|
|
91
|
+
*
|
|
92
|
+
* @param request - The request {@link DeleteInstanceRequest}
|
|
93
|
+
* @returns A Promise of Instance
|
|
94
|
+
*/
|
|
95
|
+
deleteInstance: (request: Readonly<DeleteInstanceRequest>) => Promise<Instance>;
|
|
96
|
+
/**
|
|
97
|
+
* Upgrade a Database Instance. Upgrade your current Database Instance
|
|
98
|
+
* specifications like volume size.
|
|
99
|
+
*
|
|
100
|
+
* @param request - The request {@link UpgradeInstanceRequest}
|
|
101
|
+
* @returns A Promise of Instance
|
|
102
|
+
*/
|
|
103
|
+
upgradeInstance: (request: Readonly<UpgradeInstanceRequest>) => Promise<Instance>;
|
|
104
|
+
/**
|
|
105
|
+
* Get the certificate of a Database Instance. Retrieve the certificate of a
|
|
106
|
+
* given Database Instance, specified by the `instance_id` parameter.
|
|
107
|
+
*
|
|
108
|
+
* @param request - The request {@link GetInstanceCertificateRequest}
|
|
109
|
+
* @returns A Promise of Blob
|
|
110
|
+
*/
|
|
111
|
+
getInstanceCertificate: (request: Readonly<GetInstanceCertificateRequest>) => Promise<Blob>;
|
|
112
|
+
/**
|
|
113
|
+
* Create a Database Instance snapshot. Create a new snapshot of a Database
|
|
114
|
+
* Instance. You must define the `name` and `instance_id` parameters in the
|
|
115
|
+
* request.
|
|
116
|
+
*
|
|
117
|
+
* @param request - The request {@link CreateSnapshotRequest}
|
|
118
|
+
* @returns A Promise of Snapshot
|
|
119
|
+
*/
|
|
120
|
+
createSnapshot: (request: Readonly<CreateSnapshotRequest>) => Promise<Snapshot>;
|
|
121
|
+
/**
|
|
122
|
+
* Get a Database Instance snapshot. Retrieve information about a given
|
|
123
|
+
* snapshot of a Database Instance. You must specify, in the endpoint, the
|
|
124
|
+
* `snapshot_id` parameter of the snapshot you want to retrieve.
|
|
125
|
+
*
|
|
126
|
+
* @param request - The request {@link GetSnapshotRequest}
|
|
127
|
+
* @returns A Promise of Snapshot
|
|
128
|
+
*/
|
|
129
|
+
getSnapshot: (request: Readonly<GetSnapshotRequest>) => Promise<Snapshot>;
|
|
130
|
+
/**
|
|
131
|
+
* Waits for {@link Snapshot} to be in a final state.
|
|
132
|
+
*
|
|
133
|
+
* @param request - The request {@link GetSnapshotRequest}
|
|
134
|
+
* @param options - The waiting options
|
|
135
|
+
* @returns A Promise of Snapshot
|
|
136
|
+
*/
|
|
137
|
+
waitForSnapshot: (request: Readonly<GetSnapshotRequest>, options?: Readonly<WaitForOptions<Snapshot>>) => Promise<Snapshot>;
|
|
138
|
+
updateSnapshot: (request: Readonly<UpdateSnapshotRequest>) => Promise<Snapshot>;
|
|
139
|
+
/**
|
|
140
|
+
* Restore a Database Instance snapshot. Restore a given snapshot of a
|
|
141
|
+
* Database Instance. You must specify, in the endpoint, the `snapshot_id`
|
|
142
|
+
* parameter of the snapshot you want to restore, the `instance_name` of the
|
|
143
|
+
* new Database Instance, `node_type` of the new Database Instance and
|
|
144
|
+
* `node_number` of the new Database Instance.
|
|
145
|
+
*
|
|
146
|
+
* @param request - The request {@link RestoreSnapshotRequest}
|
|
147
|
+
* @returns A Promise of Instance
|
|
148
|
+
*/
|
|
149
|
+
restoreSnapshot: (request: Readonly<RestoreSnapshotRequest>) => Promise<Instance>;
|
|
150
|
+
protected pageOfListSnapshots: (request?: Readonly<ListSnapshotsRequest>) => Promise<ListSnapshotsResponse>;
|
|
151
|
+
/**
|
|
152
|
+
* List snapshots. List snapshots. You can include the `instance_id` or
|
|
153
|
+
* `project_id` in your query to get the list of snapshots for specific
|
|
154
|
+
* Database Instances and/or Projects. By default, the details returned in the
|
|
155
|
+
* list are ordered by creation date in ascending order, though this can be
|
|
156
|
+
* modified via the `order_by` field.
|
|
157
|
+
*
|
|
158
|
+
* @param request - The request {@link ListSnapshotsRequest}
|
|
159
|
+
* @returns A Promise of ListSnapshotsResponse
|
|
160
|
+
*/
|
|
161
|
+
listSnapshots: (request?: Readonly<ListSnapshotsRequest>) => Promise<ListSnapshotsResponse> & {
|
|
162
|
+
all: () => Promise<Snapshot[]>;
|
|
163
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Snapshot[], void, void>;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Delete a Database Instance snapshot. Delete a given snapshot of a Database
|
|
167
|
+
* Instance. You must specify, in the endpoint, the `snapshot_id` parameter of
|
|
168
|
+
* the snapshot you want to delete.
|
|
169
|
+
*
|
|
170
|
+
* @param request - The request {@link DeleteSnapshotRequest}
|
|
171
|
+
* @returns A Promise of Snapshot
|
|
172
|
+
*/
|
|
173
|
+
deleteSnapshot: (request: Readonly<DeleteSnapshotRequest>) => Promise<Snapshot>;
|
|
174
|
+
protected pageOfListUsers: (request: Readonly<ListUsersRequest>) => Promise<ListUsersResponse>;
|
|
175
|
+
/**
|
|
176
|
+
* List users of a Database Instance. List all users of a given Database
|
|
177
|
+
* Instance.
|
|
178
|
+
*
|
|
179
|
+
* @param request - The request {@link ListUsersRequest}
|
|
180
|
+
* @returns A Promise of ListUsersResponse
|
|
181
|
+
*/
|
|
182
|
+
listUsers: (request: Readonly<ListUsersRequest>) => Promise<ListUsersResponse> & {
|
|
183
|
+
all: () => Promise<User[]>;
|
|
184
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<User[], void, void>;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Update a user on a Database Instance. Update the parameters of a user on a
|
|
188
|
+
* Database Instance. You can update the `password` parameter, but you cannot
|
|
189
|
+
* change the name of the user.
|
|
190
|
+
*
|
|
191
|
+
* @param request - The request {@link UpdateUserRequest}
|
|
192
|
+
* @returns A Promise of User
|
|
193
|
+
*/
|
|
194
|
+
updateUser: (request: Readonly<UpdateUserRequest>) => Promise<User>;
|
|
195
|
+
}
|