@scaleway/sdk 2.24.0 → 2.25.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.
@@ -1,2 +1,4 @@
1
- import * as index_gen from './v1beta1/index.gen.js';
2
- export { index_gen as v1beta1 };
1
+ import * as index_gen from './v1/index.gen.js';
2
+ export { index_gen as v1 };
3
+ import * as index_gen$1 from './v1beta1/index.gen.js';
4
+ export { index_gen$1 as v1beta1 };
@@ -0,0 +1,456 @@
1
+ import { API as API$1 } from '../../../scw/api.js';
2
+ import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
3
+ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
+ import { unmarshalGrafana, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalGlobalApiCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalGlobalApiResetGrafanaUserPasswordRequest, unmarshalListGrafanaProductDashboardsResponse, unmarshalGrafanaProductDashboard, unmarshalListPlansResponse, marshalGlobalApiSelectPlanRequest, unmarshalPlan, marshalRegionalApiCreateDataSourceRequest, unmarshalDataSource, unmarshalListDataSourcesResponse, unmarshalUsageOverview, marshalRegionalApiCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, unmarshalAlertManager, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiDisableAlertManagerRequest, marshalRegionalApiCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalRegionalApiDeleteContactPointRequest, marshalRegionalApiEnableManagedAlertsRequest, marshalRegionalApiDisableManagedAlertsRequest, marshalRegionalApiTriggerTestAlertRequest } from './marshalling.gen.js';
5
+
6
+ // This file was automatically generated. DO NOT EDIT.
7
+ // If you have any remark or suggestion do not hesitate to open an issue.
8
+ const jsonContentHeaders = {
9
+ 'Content-Type': 'application/json; charset=utf-8'
10
+ };
11
+
12
+ /**
13
+ * Cockpit Global API.
14
+ *
15
+ * The Cockpit Global API allows you to manage your Cockpit's Grafana and plans.
16
+ */
17
+ class GlobalAPI extends API$1 {
18
+ /**
19
+ * Get your Cockpit's Grafana. Retrieve information on your Cockpit's Grafana,
20
+ * specified by the ID of the Project the Cockpit belongs to. The output
21
+ * returned displays the URL to access your Cockpit's Grafana.
22
+ *
23
+ * @param request - The request {@link GlobalApiGetGrafanaRequest}
24
+ * @returns A Promise of Grafana
25
+ */
26
+ getGrafana = (request = {}) => this.client.fetch({
27
+ method: 'GET',
28
+ path: `/cockpit/v1/grafana`,
29
+ urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])
30
+ }, unmarshalGrafana);
31
+
32
+ /**
33
+ * Synchronize Grafana data sources. Trigger the synchronization of all your
34
+ * data sources and the alert manager in the relevant regions. The alert
35
+ * manager will only be synchronized if you have enabled it.
36
+ *
37
+ * @param request - The request {@link GlobalApiSyncGrafanaDataSourcesRequest}
38
+ */
39
+ syncGrafanaDataSources = (request = {}) => this.client.fetch({
40
+ body: JSON.stringify(marshalGlobalApiSyncGrafanaDataSourcesRequest(request, this.client.settings)),
41
+ headers: jsonContentHeaders,
42
+ method: 'POST',
43
+ path: `/cockpit/v1/grafana/sync-data-sources`
44
+ });
45
+
46
+ /**
47
+ * Create a Grafana user. Create a Grafana user to connect to your Cockpit's
48
+ * Grafana. Upon creation, your user password displays only once, so make sure
49
+ * that you save it. Each Grafana user is associated with a role: viewer or
50
+ * editor. A viewer can only view dashboards, whereas an editor can create and
51
+ * edit dashboards. Note that the `admin` username is not available for
52
+ * creation.
53
+ *
54
+ * @param request - The request {@link GlobalApiCreateGrafanaUserRequest}
55
+ * @returns A Promise of GrafanaUser
56
+ */
57
+ createGrafanaUser = request => this.client.fetch({
58
+ body: JSON.stringify(marshalGlobalApiCreateGrafanaUserRequest(request, this.client.settings)),
59
+ headers: jsonContentHeaders,
60
+ method: 'POST',
61
+ path: `/cockpit/v1/grafana/users`
62
+ }, unmarshalGrafanaUser);
63
+ pageOfListGrafanaUsers = (request = {}) => this.client.fetch({
64
+ method: 'GET',
65
+ path: `/cockpit/v1/grafana/users`,
66
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])
67
+ }, unmarshalListGrafanaUsersResponse);
68
+
69
+ /**
70
+ * List Grafana users. List all Grafana users created in your Cockpit's
71
+ * Grafana. By default, the Grafana users returned in the list are ordered in
72
+ * ascending order.
73
+ *
74
+ * @param request - The request {@link GlobalApiListGrafanaUsersRequest}
75
+ * @returns A Promise of ListGrafanaUsersResponse
76
+ */
77
+ listGrafanaUsers = (request = {}) => enrichForPagination('grafanaUsers', this.pageOfListGrafanaUsers, request);
78
+
79
+ /**
80
+ * Delete a Grafana user. Delete a Grafana user from your Cockpit's Grafana,
81
+ * specified by the ID of the Project the Cockpit belongs to, and the ID of
82
+ * the Grafana user.
83
+ *
84
+ * @param request - The request {@link GlobalApiDeleteGrafanaUserRequest}
85
+ */
86
+ deleteGrafanaUser = request => this.client.fetch({
87
+ method: 'DELETE',
88
+ path: `/cockpit/v1/grafana/users/${validatePathParam('grafanaUserId', request.grafanaUserId)}`,
89
+ urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])
90
+ });
91
+
92
+ /**
93
+ * Reset a Grafana user password. Reset the password of a Grafana user,
94
+ * specified by the ID of the Project the Cockpit belongs to, and the ID of
95
+ * the Grafana user. A new password regenerates and only displays once. Make
96
+ * sure that you save it.
97
+ *
98
+ * @param request - The request
99
+ * {@link GlobalApiResetGrafanaUserPasswordRequest}
100
+ * @returns A Promise of GrafanaUser
101
+ */
102
+ resetGrafanaUserPassword = request => this.client.fetch({
103
+ body: JSON.stringify(marshalGlobalApiResetGrafanaUserPasswordRequest(request, this.client.settings)),
104
+ headers: jsonContentHeaders,
105
+ method: 'POST',
106
+ path: `/cockpit/v1/grafana/users/${validatePathParam('grafanaUserId', request.grafanaUserId)}/reset-password`
107
+ }, unmarshalGrafanaUser);
108
+ pageOfListGrafanaProductDashboards = (request = {}) => this.client.fetch({
109
+ method: 'GET',
110
+ path: `/cockpit/v1/grafana/product-dashboards`,
111
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['tags', request.tags])
112
+ }, unmarshalListGrafanaProductDashboardsResponse);
113
+
114
+ /**
115
+ * List Scaleway resources dashboards. Retrieve a list of available dashboards
116
+ * in Grafana, for all Scaleway resources which are integrated with Cockpit.
117
+ *
118
+ * @param request - The request
119
+ * {@link GlobalApiListGrafanaProductDashboardsRequest}
120
+ * @returns A Promise of ListGrafanaProductDashboardsResponse
121
+ */
122
+ listGrafanaProductDashboards = (request = {}) => enrichForPagination('dashboards', this.pageOfListGrafanaProductDashboards, request);
123
+
124
+ /**
125
+ * Get Scaleway resource dashboard. Retrieve information about the dashboard
126
+ * of a Scaleway resource in Grafana, specified by the ID of the Project the
127
+ * Cockpit belongs to, and the name of the dashboard.
128
+ *
129
+ * @param request - The request
130
+ * {@link GlobalApiGetGrafanaProductDashboardRequest}
131
+ * @returns A Promise of GrafanaProductDashboard
132
+ */
133
+ getGrafanaProductDashboard = request => this.client.fetch({
134
+ method: 'GET',
135
+ path: `/cockpit/v1/grafana/product-dashboards/${validatePathParam('dashboardName', request.dashboardName)}`,
136
+ urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])
137
+ }, unmarshalGrafanaProductDashboard);
138
+ pageOfListPlans = (request = {}) => this.client.fetch({
139
+ method: 'GET',
140
+ path: `/cockpit/v1/plans`,
141
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
142
+ }, unmarshalListPlansResponse);
143
+
144
+ /**
145
+ * List plan types. Retrieve a list of available pricing plan types.
146
+ *
147
+ * @param request - The request {@link GlobalApiListPlansRequest}
148
+ * @returns A Promise of ListPlansResponse
149
+ */
150
+ listPlans = (request = {}) => enrichForPagination('plans', this.pageOfListPlans, request);
151
+
152
+ /**
153
+ * Apply a pricing plan. Apply a pricing plan on a given Project. You must
154
+ * specify the ID of the pricing plan type. Note that you will be billed for
155
+ * the plan you apply.
156
+ *
157
+ * @param request - The request {@link GlobalApiSelectPlanRequest}
158
+ * @returns A Promise of Plan
159
+ */
160
+ selectPlan = (request = {}) => this.client.fetch({
161
+ body: JSON.stringify(marshalGlobalApiSelectPlanRequest(request, this.client.settings)),
162
+ headers: jsonContentHeaders,
163
+ method: 'PATCH',
164
+ path: `/cockpit/v1/plans`
165
+ }, unmarshalPlan);
166
+
167
+ /**
168
+ * Get current plan. Retrieve a pricing plan for the given Project, specified
169
+ * by the ID of the Project.
170
+ *
171
+ * @param request - The request {@link GlobalApiGetCurrentPlanRequest}
172
+ * @returns A Promise of Plan
173
+ */
174
+ getCurrentPlan = (request = {}) => this.client.fetch({
175
+ method: 'GET',
176
+ path: `/cockpit/v1/current-plan`,
177
+ urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])
178
+ }, unmarshalPlan);
179
+ }
180
+
181
+ /**
182
+ * Cockpit Regional API.
183
+ *
184
+ * The Cockpit Regional API allows you to create data sources and tokens to
185
+ * store and query data types such as metrics, logs, and traces. You can also
186
+ * push your data into Cockpit, and send alerts to your contact points when your
187
+ * resources may require your attention, using the regional Alert manager.
188
+ */
189
+ class RegionalAPI extends API$1 {
190
+ /** Lists the available regions of the API. */
191
+ static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
192
+
193
+ /**
194
+ * Create a data source. You must specify the data source type upon creation.
195
+ * Available data source types include:
196
+ *
197
+ * - Metrics
198
+ * - Logs
199
+ * - Traces The name of the data source will then be used as reference to name
200
+ * the associated Grafana data source.
201
+ *
202
+ * @param request - The request {@link RegionalApiCreateDataSourceRequest}
203
+ * @returns A Promise of DataSource
204
+ */
205
+ createDataSource = request => this.client.fetch({
206
+ body: JSON.stringify(marshalRegionalApiCreateDataSourceRequest(request, this.client.settings)),
207
+ headers: jsonContentHeaders,
208
+ method: 'POST',
209
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/data-sources`
210
+ }, unmarshalDataSource);
211
+
212
+ /**
213
+ * Get a data source. Retrieve information about a given data source,
214
+ * specified by the data source ID. The data source's information such as its
215
+ * name, type, URL, origin, and retention period, is returned.
216
+ *
217
+ * @param request - The request {@link RegionalApiGetDataSourceRequest}
218
+ * @returns A Promise of DataSource
219
+ */
220
+ getDataSource = request => this.client.fetch({
221
+ method: 'GET',
222
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/data-sources/${validatePathParam('dataSourceId', request.dataSourceId)}`
223
+ }, unmarshalDataSource);
224
+
225
+ /**
226
+ * Delete a data source. Delete a given data source, specified by the data
227
+ * source ID. Note that deleting a data source is irreversible, and cannot be
228
+ * undone.
229
+ *
230
+ * @param request - The request {@link RegionalApiDeleteDataSourceRequest}
231
+ */
232
+ deleteDataSource = request => this.client.fetch({
233
+ method: 'DELETE',
234
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/data-sources/${validatePathParam('dataSourceId', request.dataSourceId)}`
235
+ });
236
+ pageOfListDataSources = (request = {}) => this.client.fetch({
237
+ method: 'GET',
238
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/data-sources`,
239
+ urlParams: urlParams(['order_by', request.orderBy], ['origin', request.origin], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['types', request.types])
240
+ }, unmarshalListDataSourcesResponse);
241
+
242
+ /**
243
+ * List data sources. Retrieve the list of data sources available in the
244
+ * specified region. By default, the data sources returned in the list are
245
+ * ordered by creation date, in ascending order. You can list data sources by
246
+ * Project, type and origin.
247
+ *
248
+ * @param request - The request {@link RegionalApiListDataSourcesRequest}
249
+ * @returns A Promise of ListDataSourcesResponse
250
+ */
251
+ listDataSources = (request = {}) => enrichForPagination('dataSources', this.pageOfListDataSources, request);
252
+
253
+ /**
254
+ * Get data source usage overview. Retrieve the data source usage overview per
255
+ * type for the specified Project.
256
+ *
257
+ * @param request - The request {@link RegionalApiGetUsageOverviewRequest}
258
+ * @returns A Promise of UsageOverview
259
+ */
260
+ getUsageOverview = (request = {}) => this.client.fetch({
261
+ method: 'GET',
262
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/usage-overview`,
263
+ urlParams: urlParams(['interval', request.interval], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])
264
+ }, unmarshalUsageOverview);
265
+
266
+ /**
267
+ * Create a token. Give your token the relevant scopes to ensure it has the
268
+ * right permissions to interact with your data sources and the Alert manager.
269
+ * Make sure that you create your token in the same regions as the data
270
+ * sources you want to use it for. Upon creation, your token's secret key
271
+ * display only once. Make sure that you save it.
272
+ *
273
+ * @param request - The request {@link RegionalApiCreateTokenRequest}
274
+ * @returns A Promise of Token
275
+ */
276
+ createToken = request => this.client.fetch({
277
+ body: JSON.stringify(marshalRegionalApiCreateTokenRequest(request, this.client.settings)),
278
+ headers: jsonContentHeaders,
279
+ method: 'POST',
280
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens`
281
+ }, unmarshalToken);
282
+ pageOfListTokens = (request = {}) => this.client.fetch({
283
+ method: 'GET',
284
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens`,
285
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['token_scopes', request.tokenScopes])
286
+ }, unmarshalListTokensResponse);
287
+
288
+ /**
289
+ * List tokens. Retrieve a list of all tokens in the specified region. By
290
+ * default, tokens returned in the list are ordered by creation date, in
291
+ * ascending order. You can filter tokens by Project ID and token scopes.
292
+ *
293
+ * @param request - The request {@link RegionalApiListTokensRequest}
294
+ * @returns A Promise of ListTokensResponse
295
+ */
296
+ listTokens = (request = {}) => enrichForPagination('tokens', this.pageOfListTokens, request);
297
+
298
+ /**
299
+ * Get a token. Retrieve information about a given token, specified by the
300
+ * token ID. The token's information such as its scopes, is returned.
301
+ *
302
+ * @param request - The request {@link RegionalApiGetTokenRequest}
303
+ * @returns A Promise of Token
304
+ */
305
+ getToken = request => this.client.fetch({
306
+ method: 'GET',
307
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`
308
+ }, unmarshalToken);
309
+
310
+ /**
311
+ * Delete a token. Delete a given token, specified by the token ID. Deleting a
312
+ * token is irreversible and cannot be undone.
313
+ *
314
+ * @param request - The request {@link RegionalApiDeleteTokenRequest}
315
+ */
316
+ deleteToken = request => this.client.fetch({
317
+ method: 'DELETE',
318
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`
319
+ });
320
+
321
+ /**
322
+ * Get the Alert manager. Retrieve information about the Alert manager which
323
+ * is unique per Project and region. By default the Alert manager is disabled.
324
+ * The output returned displays a URL to access the Alert manager, and whether
325
+ * the Alert manager and managed alerts are enabled.
326
+ *
327
+ * @param request - The request {@link RegionalApiGetAlertManagerRequest}
328
+ * @returns A Promise of AlertManager
329
+ */
330
+ getAlertManager = (request = {}) => this.client.fetch({
331
+ method: 'GET',
332
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager`,
333
+ urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])
334
+ }, unmarshalAlertManager);
335
+
336
+ /**
337
+ * Enable the Alert manager. Enabling the Alert manager allows you to enable
338
+ * managed alerts and create contact points in the specified Project and
339
+ * region, to be notified when your Scaleway resources may require your
340
+ * attention.
341
+ *
342
+ * @param request - The request {@link RegionalApiEnableAlertManagerRequest}
343
+ * @returns A Promise of AlertManager
344
+ */
345
+ enableAlertManager = (request = {}) => this.client.fetch({
346
+ body: JSON.stringify(marshalRegionalApiEnableAlertManagerRequest(request, this.client.settings)),
347
+ headers: jsonContentHeaders,
348
+ method: 'POST',
349
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/enable`
350
+ }, unmarshalAlertManager);
351
+
352
+ /**
353
+ * Disable the Alert manager. Disabling the Alert manager deletes the contact
354
+ * points you have created and disables managed alerts in the specified
355
+ * Project and region.
356
+ *
357
+ * @param request - The request {@link RegionalApiDisableAlertManagerRequest}
358
+ * @returns A Promise of AlertManager
359
+ */
360
+ disableAlertManager = (request = {}) => this.client.fetch({
361
+ body: JSON.stringify(marshalRegionalApiDisableAlertManagerRequest(request, this.client.settings)),
362
+ headers: jsonContentHeaders,
363
+ method: 'POST',
364
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/disable`
365
+ }, unmarshalAlertManager);
366
+
367
+ /**
368
+ * Create a contact point. Contact points are email addresses associated with
369
+ * the default receiver, that the Alert manager sends alerts to. The source of
370
+ * the alerts are data sources within the same Project and region as the Alert
371
+ * manager. If you need to receive alerts for other receivers, you can create
372
+ * additional contact points and receivers in Grafana. Make sure that you
373
+ * select the Scaleway Alert manager.
374
+ *
375
+ * @param request - The request {@link RegionalApiCreateContactPointRequest}
376
+ * @returns A Promise of ContactPoint
377
+ */
378
+ createContactPoint = (request = {}) => this.client.fetch({
379
+ body: JSON.stringify(marshalRegionalApiCreateContactPointRequest(request, this.client.settings)),
380
+ headers: jsonContentHeaders,
381
+ method: 'POST',
382
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points`
383
+ }, unmarshalContactPoint);
384
+ pageOfListContactPoints = (request = {}) => this.client.fetch({
385
+ method: 'GET',
386
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points`,
387
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])
388
+ }, unmarshalListContactPointsResponse);
389
+
390
+ /**
391
+ * List contact points. Retrieve a list of contact points for the specified
392
+ * Project. The response lists all contact points and receivers created in
393
+ * Grafana or via the API.
394
+ *
395
+ * @param request - The request {@link RegionalApiListContactPointsRequest}
396
+ * @returns A Promise of ListContactPointsResponse
397
+ */
398
+ listContactPoints = (request = {}) => enrichForPagination('contactPoints', this.pageOfListContactPoints, request);
399
+
400
+ /**
401
+ * Delete a contact point. Delete a contact point associated with the default
402
+ * receiver.
403
+ *
404
+ * @param request - The request {@link RegionalApiDeleteContactPointRequest}
405
+ */
406
+ deleteContactPoint = (request = {}) => this.client.fetch({
407
+ body: JSON.stringify(marshalRegionalApiDeleteContactPointRequest(request, this.client.settings)),
408
+ headers: jsonContentHeaders,
409
+ method: 'POST',
410
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points/delete`
411
+ });
412
+
413
+ /**
414
+ * Enable managed alerts. Enable the sending of managed alerts for the
415
+ * specified Project. Managed alerts are predefined alerts that apply to
416
+ * Scaleway recources integrated with Cockpit by default.
417
+ *
418
+ * @param request - The request {@link RegionalApiEnableManagedAlertsRequest}
419
+ * @returns A Promise of AlertManager
420
+ */
421
+ enableManagedAlerts = (request = {}) => this.client.fetch({
422
+ body: JSON.stringify(marshalRegionalApiEnableManagedAlertsRequest(request, this.client.settings)),
423
+ headers: jsonContentHeaders,
424
+ method: 'POST',
425
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/managed-alerts/enable`
426
+ }, unmarshalAlertManager);
427
+
428
+ /**
429
+ * Disable managed alerts. Disable the sending of managed alerts for the
430
+ * specified Project.
431
+ *
432
+ * @param request - The request {@link RegionalApiDisableManagedAlertsRequest}
433
+ * @returns A Promise of AlertManager
434
+ */
435
+ disableManagedAlerts = (request = {}) => this.client.fetch({
436
+ body: JSON.stringify(marshalRegionalApiDisableManagedAlertsRequest(request, this.client.settings)),
437
+ headers: jsonContentHeaders,
438
+ method: 'POST',
439
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/managed-alerts/disable`
440
+ }, unmarshalAlertManager);
441
+
442
+ /**
443
+ * Trigger a test alert. Send a test alert to the Alert manager to make sure
444
+ * your contact points get notified.
445
+ *
446
+ * @param request - The request {@link RegionalApiTriggerTestAlertRequest}
447
+ */
448
+ triggerTestAlert = (request = {}) => this.client.fetch({
449
+ body: JSON.stringify(marshalRegionalApiTriggerTestAlertRequest(request, this.client.settings)),
450
+ headers: jsonContentHeaders,
451
+ method: 'POST',
452
+ path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/trigger-test-alert`
453
+ });
454
+ }
455
+
456
+ export { GlobalAPI, RegionalAPI };
@@ -0,0 +1,6 @@
1
+ export { GlobalAPI, RegionalAPI } from './api.gen.js';
2
+ import * as validationRules_gen from './validation-rules.gen.js';
3
+ export { validationRules_gen as ValidationRules };
4
+
5
+ // This file was automatically generated. DO NOT EDIT.
6
+ // If you have any remark or suggestion do not hesitate to open an issue.