@scaleway/sdk-mongodb 2.7.0 → 2.8.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/.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 +8 -6
- package/LICENSE +0 -191
- package/dist/metadata.gen.json +0 -6
- package/dist/metadata2.gen.js +0 -8
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -2,286 +2,143 @@ import { INSTANCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES } from "./cont
|
|
|
2
2
|
import { marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalEndpoint, unmarshalInstance, unmarshalListInstancesResponse, unmarshalListNodeTypesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, 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/v1alpha1/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
|
-
* Get a Database Instance snapshot. Retrieve information about a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to retrieve.
|
|
143
|
-
*
|
|
144
|
-
* @param request - The request {@link GetSnapshotRequest}
|
|
145
|
-
* @returns A Promise of Snapshot
|
|
146
|
-
*/
|
|
147
|
-
getSnapshot = (request) => this.client.fetch({
|
|
148
|
-
method: "GET",
|
|
149
|
-
path: `/mongodb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
150
|
-
}, unmarshalSnapshot);
|
|
151
|
-
/**
|
|
152
|
-
* Waits for {@link Snapshot} to be in a final state.
|
|
153
|
-
*
|
|
154
|
-
* @param request - The request {@link GetSnapshotRequest}
|
|
155
|
-
* @param options - The waiting options
|
|
156
|
-
* @returns A Promise of Snapshot
|
|
157
|
-
*/
|
|
158
|
-
waitForSnapshot = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))), this.getSnapshot, request, options);
|
|
159
|
-
/**
|
|
160
|
-
* Update a Database Instance snapshot. Update the parameters of a snapshot of a Database Instance. You can update the `name` and `expires_at` parameters.
|
|
161
|
-
*
|
|
162
|
-
* @param request - The request {@link UpdateSnapshotRequest}
|
|
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: "POST",
|
|
169
|
-
path: `/mongodb/v1alpha1/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_number` 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/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/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
|
-
body: "{}",
|
|
248
|
-
headers: jsonContentHeaders,
|
|
249
|
-
method: "DELETE",
|
|
250
|
-
path: `/mongodb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/users/${validatePathParam("name", request.name)}`
|
|
251
|
-
});
|
|
252
|
-
/**
|
|
253
|
-
* Apply user roles. Apply preset roles for a user in a Database Instance.
|
|
254
|
-
*
|
|
255
|
-
* @param request - The request {@link SetUserRoleRequest}
|
|
256
|
-
* @returns A Promise of User
|
|
257
|
-
*/
|
|
258
|
-
setUserRole = (request) => this.client.fetch({
|
|
259
|
-
body: JSON.stringify(marshalSetUserRoleRequest(request, this.client.settings)),
|
|
260
|
-
headers: jsonContentHeaders,
|
|
261
|
-
method: "PUT",
|
|
262
|
-
path: `/mongodb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/roles`
|
|
263
|
-
}, unmarshalUser);
|
|
264
|
-
/**
|
|
265
|
-
* 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.
|
|
266
|
-
*
|
|
267
|
-
* @param request - The request {@link DeleteEndpointRequest}
|
|
268
|
-
*/
|
|
269
|
-
deleteEndpoint = (request) => this.client.fetch({
|
|
270
|
-
method: "DELETE",
|
|
271
|
-
path: `/mongodb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
|
|
272
|
-
});
|
|
273
|
-
/**
|
|
274
|
-
* 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.
|
|
275
|
-
*
|
|
276
|
-
* @param request - The request {@link CreateEndpointRequest}
|
|
277
|
-
* @returns A Promise of Endpoint
|
|
278
|
-
*/
|
|
279
|
-
createEndpoint = (request) => this.client.fetch({
|
|
280
|
-
body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)),
|
|
281
|
-
headers: jsonContentHeaders,
|
|
282
|
-
method: "POST",
|
|
283
|
-
path: `/mongodb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
|
|
284
|
-
}, unmarshalEndpoint);
|
|
12
|
+
constructor(..._args) {
|
|
13
|
+
super(..._args);
|
|
14
|
+
this.pageOfListNodeTypes = (request = {}) => this.client.fetch({
|
|
15
|
+
method: "GET",
|
|
16
|
+
path: `/mongodb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
|
|
17
|
+
urlParams: urlParams(["include_disabled_types", request.includeDisabledTypes], ["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/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/snapshots`
|
|
70
|
+
}, unmarshalSnapshot);
|
|
71
|
+
this.getSnapshot = (request) => this.client.fetch({
|
|
72
|
+
method: "GET",
|
|
73
|
+
path: `/mongodb/v1alpha1/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: "POST",
|
|
80
|
+
path: `/mongodb/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/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/v1alpha1/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
|
+
body: "{}",
|
|
118
|
+
headers: jsonContentHeaders,
|
|
119
|
+
method: "DELETE",
|
|
120
|
+
path: `/mongodb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/users/${validatePathParam("name", request.name)}`
|
|
121
|
+
});
|
|
122
|
+
this.setUserRole = (request) => this.client.fetch({
|
|
123
|
+
body: JSON.stringify(marshalSetUserRoleRequest(request, this.client.settings)),
|
|
124
|
+
headers: jsonContentHeaders,
|
|
125
|
+
method: "PUT",
|
|
126
|
+
path: `/mongodb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam("instanceId", request.instanceId)}/roles`
|
|
127
|
+
}, unmarshalUser);
|
|
128
|
+
this.deleteEndpoint = (request) => this.client.fetch({
|
|
129
|
+
method: "DELETE",
|
|
130
|
+
path: `/mongodb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
|
|
131
|
+
});
|
|
132
|
+
this.createEndpoint = (request) => this.client.fetch({
|
|
133
|
+
body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)),
|
|
134
|
+
headers: jsonContentHeaders,
|
|
135
|
+
method: "POST",
|
|
136
|
+
path: `/mongodb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
|
|
137
|
+
}, unmarshalEndpoint);
|
|
138
|
+
}
|
|
139
|
+
static {
|
|
140
|
+
this.LOCALITY = toApiLocality({ regions: ["fr-par"] });
|
|
141
|
+
}
|
|
285
142
|
};
|
|
286
143
|
//#endregion
|
|
287
144
|
export { API };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/v1alpha1/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,7 +8,7 @@ var INSTANCE_TRANSIENT_STATUSES = [
|
|
|
8
8
|
"snapshotting"
|
|
9
9
|
];
|
|
10
10
|
/** Lists transient statutes of the enum {@link SnapshotStatus}. */
|
|
11
|
-
|
|
11
|
+
const SNAPSHOT_TRANSIENT_STATUSES = [
|
|
12
12
|
"creating",
|
|
13
13
|
"restoring",
|
|
14
14
|
"deleting"
|