@scaleway/sdk-cockpit 1.6.0 → 2.1.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.
@@ -1,667 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const marshalling_gen = require("./marshalling.gen.cjs");
5
- const jsonContentHeaders = {
6
- "Content-Type": "application/json; charset=utf-8"
7
- };
8
- class GlobalAPI extends sdkClient.API {
9
- /**
10
- * Get your Cockpit's Grafana. Retrieve information on your Cockpit's Grafana, specified by the ID of the Project the Cockpit belongs to.
11
- The output returned displays the URL to access your Cockpit's Grafana.
12
- *
13
- * @param request - The request {@link GlobalApiGetGrafanaRequest}
14
- * @returns A Promise of Grafana
15
- */
16
- getGrafana = (request = {}) => this.client.fetch(
17
- {
18
- method: "GET",
19
- path: `/cockpit/v1/grafana`,
20
- urlParams: sdkClient.urlParams([
21
- "project_id",
22
- request.projectId ?? this.client.settings.defaultProjectId
23
- ])
24
- },
25
- marshalling_gen.unmarshalGrafana
26
- );
27
- /**
28
- * Synchronize Grafana data sources. Trigger the synchronization of all your data sources and the alert manager in the relevant regions. The alert manager will only be synchronized if you have enabled it.
29
- *
30
- * @param request - The request {@link GlobalApiSyncGrafanaDataSourcesRequest}
31
- */
32
- syncGrafanaDataSources = (request = {}) => this.client.fetch({
33
- body: JSON.stringify(
34
- marshalling_gen.marshalGlobalApiSyncGrafanaDataSourcesRequest(
35
- request,
36
- this.client.settings
37
- )
38
- ),
39
- headers: jsonContentHeaders,
40
- method: "POST",
41
- path: `/cockpit/v1/grafana/sync-data-sources`
42
- });
43
- /**
44
- * Create a Grafana user. Create a Grafana user to connect to your Cockpit's Grafana. Upon creation, your user password displays only once, so make sure that you save it.
45
- Each Grafana user is associated with a role: viewer or editor. A viewer can only view dashboards, whereas an editor can create and edit dashboards. Note that the `admin` username is not available for creation.
46
- *
47
- * @param request - The request {@link GlobalApiCreateGrafanaUserRequest}
48
- * @returns A Promise of GrafanaUser
49
- */
50
- createGrafanaUser = (request) => this.client.fetch(
51
- {
52
- body: JSON.stringify(
53
- marshalling_gen.marshalGlobalApiCreateGrafanaUserRequest(
54
- request,
55
- this.client.settings
56
- )
57
- ),
58
- headers: jsonContentHeaders,
59
- method: "POST",
60
- path: `/cockpit/v1/grafana/users`
61
- },
62
- marshalling_gen.unmarshalGrafanaUser
63
- );
64
- pageOfListGrafanaUsers = (request = {}) => this.client.fetch(
65
- {
66
- method: "GET",
67
- path: `/cockpit/v1/grafana/users`,
68
- urlParams: sdkClient.urlParams(
69
- ["order_by", request.orderBy],
70
- ["page", request.page],
71
- [
72
- "page_size",
73
- request.pageSize ?? this.client.settings.defaultPageSize
74
- ],
75
- [
76
- "project_id",
77
- request.projectId ?? this.client.settings.defaultProjectId
78
- ]
79
- )
80
- },
81
- marshalling_gen.unmarshalListGrafanaUsersResponse
82
- );
83
- /**
84
- * List Grafana users. List all Grafana users created in your Cockpit's Grafana. By default, the Grafana users returned in the list are ordered in ascending order.
85
- *
86
- * @param request - The request {@link GlobalApiListGrafanaUsersRequest}
87
- * @returns A Promise of ListGrafanaUsersResponse
88
- */
89
- listGrafanaUsers = (request = {}) => sdkClient.enrichForPagination("grafanaUsers", this.pageOfListGrafanaUsers, request);
90
- /**
91
- * Delete a Grafana user. Delete a Grafana user from your Cockpit's Grafana, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.
92
- *
93
- * @param request - The request {@link GlobalApiDeleteGrafanaUserRequest}
94
- */
95
- deleteGrafanaUser = (request) => this.client.fetch({
96
- method: "DELETE",
97
- path: `/cockpit/v1/grafana/users/${sdkClient.validatePathParam("grafanaUserId", request.grafanaUserId)}`,
98
- urlParams: sdkClient.urlParams([
99
- "project_id",
100
- request.projectId ?? this.client.settings.defaultProjectId
101
- ])
102
- });
103
- /**
104
- * Reset a Grafana user password. Reset the password of a Grafana user, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.
105
- A new password regenerates and only displays once. Make sure that you save it.
106
- *
107
- * @param request - The request {@link GlobalApiResetGrafanaUserPasswordRequest}
108
- * @returns A Promise of GrafanaUser
109
- */
110
- resetGrafanaUserPassword = (request) => this.client.fetch(
111
- {
112
- body: JSON.stringify(
113
- marshalling_gen.marshalGlobalApiResetGrafanaUserPasswordRequest(
114
- request,
115
- this.client.settings
116
- )
117
- ),
118
- headers: jsonContentHeaders,
119
- method: "POST",
120
- path: `/cockpit/v1/grafana/users/${sdkClient.validatePathParam("grafanaUserId", request.grafanaUserId)}/reset-password`
121
- },
122
- marshalling_gen.unmarshalGrafanaUser
123
- );
124
- pageOfListGrafanaProductDashboards = (request = {}) => this.client.fetch(
125
- {
126
- method: "GET",
127
- path: `/cockpit/v1/grafana/product-dashboards`,
128
- urlParams: sdkClient.urlParams(
129
- ["page", request.page],
130
- [
131
- "page_size",
132
- request.pageSize ?? this.client.settings.defaultPageSize
133
- ],
134
- [
135
- "project_id",
136
- request.projectId ?? this.client.settings.defaultProjectId
137
- ],
138
- ["tags", request.tags]
139
- )
140
- },
141
- marshalling_gen.unmarshalListGrafanaProductDashboardsResponse
142
- );
143
- /**
144
- * List Scaleway resources dashboards. Retrieve a list of available dashboards in Grafana, for all Scaleway resources which are integrated with Cockpit.
145
- *
146
- * @param request - The request {@link GlobalApiListGrafanaProductDashboardsRequest}
147
- * @returns A Promise of ListGrafanaProductDashboardsResponse
148
- */
149
- listGrafanaProductDashboards = (request = {}) => sdkClient.enrichForPagination(
150
- "dashboards",
151
- this.pageOfListGrafanaProductDashboards,
152
- request
153
- );
154
- /**
155
- * Get Scaleway resource dashboard. Retrieve information about the dashboard of a Scaleway resource in Grafana, specified by the ID of the Project the Cockpit belongs to, and the name of the dashboard.
156
- *
157
- * @param request - The request {@link GlobalApiGetGrafanaProductDashboardRequest}
158
- * @returns A Promise of GrafanaProductDashboard
159
- */
160
- getGrafanaProductDashboard = (request) => this.client.fetch(
161
- {
162
- method: "GET",
163
- path: `/cockpit/v1/grafana/product-dashboards/${sdkClient.validatePathParam("dashboardName", request.dashboardName)}`,
164
- urlParams: sdkClient.urlParams([
165
- "project_id",
166
- request.projectId ?? this.client.settings.defaultProjectId
167
- ])
168
- },
169
- marshalling_gen.unmarshalGrafanaProductDashboard
170
- );
171
- pageOfListPlans = (request = {}) => this.client.fetch(
172
- {
173
- method: "GET",
174
- path: `/cockpit/v1/plans`,
175
- urlParams: sdkClient.urlParams(
176
- ["order_by", request.orderBy],
177
- ["page", request.page],
178
- [
179
- "page_size",
180
- request.pageSize ?? this.client.settings.defaultPageSize
181
- ]
182
- )
183
- },
184
- marshalling_gen.unmarshalListPlansResponse
185
- );
186
- /**
187
- * List plan types. Retrieve a list of available pricing plan types.
188
- Deprecated: retention is now managed at the data source level.
189
- *
190
- * @deprecated
191
- * @param request - The request {@link GlobalApiListPlansRequest}
192
- * @returns A Promise of ListPlansResponse
193
- */
194
- listPlans = (request = {}) => sdkClient.enrichForPagination("plans", this.pageOfListPlans, request);
195
- /**
196
- * Apply a pricing plan. Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply.
197
- Deprecated: retention is now managed at the data source level.
198
- *
199
- * @deprecated
200
- * @param request - The request {@link GlobalApiSelectPlanRequest}
201
- * @returns A Promise of Plan
202
- */
203
- selectPlan = (request = {}) => this.client.fetch(
204
- {
205
- body: JSON.stringify(
206
- marshalling_gen.marshalGlobalApiSelectPlanRequest(request, this.client.settings)
207
- ),
208
- headers: jsonContentHeaders,
209
- method: "PATCH",
210
- path: `/cockpit/v1/plans`
211
- },
212
- marshalling_gen.unmarshalPlan
213
- );
214
- /**
215
- * Get current plan. Retrieve a pricing plan for the given Project, specified by the ID of the Project.
216
- Deprecated: retention is now managed at the data source level.
217
- *
218
- * @deprecated
219
- * @param request - The request {@link GlobalApiGetCurrentPlanRequest}
220
- * @returns A Promise of Plan
221
- */
222
- getCurrentPlan = (request = {}) => this.client.fetch(
223
- {
224
- method: "GET",
225
- path: `/cockpit/v1/current-plan`,
226
- urlParams: sdkClient.urlParams([
227
- "project_id",
228
- request.projectId ?? this.client.settings.defaultProjectId
229
- ])
230
- },
231
- marshalling_gen.unmarshalPlan
232
- );
233
- }
234
- class RegionalAPI extends sdkClient.API {
235
- /**
236
- * Locality of this API.
237
- * type ∈ {'zone','region','global','unspecified'}
238
- */
239
- static LOCALITY = sdkClient.toApiLocality({
240
- regions: ["fr-par", "nl-ams", "pl-waw"]
241
- });
242
- /**
243
- * Get the Cockpit configuration.
244
- *
245
- * @param request - The request {@link RegionalApiGetConfigRequest}
246
- * @returns A Promise of GetConfigResponse
247
- */
248
- getConfig = (request = {}) => this.client.fetch(
249
- {
250
- method: "GET",
251
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/config`
252
- },
253
- marshalling_gen.unmarshalGetConfigResponse
254
- );
255
- /**
256
- * Create a data source. You must specify the data source name and type (metrics, logs, traces) upon creation.
257
- The name of the data source will then be used as reference to name the associated Grafana data source.
258
- *
259
- * @param request - The request {@link RegionalApiCreateDataSourceRequest}
260
- * @returns A Promise of DataSource
261
- */
262
- createDataSource = (request) => this.client.fetch(
263
- {
264
- body: JSON.stringify(
265
- marshalling_gen.marshalRegionalApiCreateDataSourceRequest(
266
- request,
267
- this.client.settings
268
- )
269
- ),
270
- headers: jsonContentHeaders,
271
- method: "POST",
272
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/data-sources`
273
- },
274
- marshalling_gen.unmarshalDataSource
275
- );
276
- /**
277
- * Get a data source. Retrieve information about a given data source, specified by the data source ID. The data source's information such as its name, type, URL, origin, and retention period, is returned.
278
- *
279
- * @param request - The request {@link RegionalApiGetDataSourceRequest}
280
- * @returns A Promise of DataSource
281
- */
282
- getDataSource = (request) => this.client.fetch(
283
- {
284
- method: "GET",
285
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/data-sources/${sdkClient.validatePathParam("dataSourceId", request.dataSourceId)}`
286
- },
287
- marshalling_gen.unmarshalDataSource
288
- );
289
- /**
290
- * Delete a data source. Delete a given data source. Note that this action will permanently delete this data source and any data associated with it.
291
- *
292
- * @param request - The request {@link RegionalApiDeleteDataSourceRequest}
293
- */
294
- deleteDataSource = (request) => this.client.fetch({
295
- method: "DELETE",
296
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/data-sources/${sdkClient.validatePathParam("dataSourceId", request.dataSourceId)}`
297
- });
298
- pageOfListDataSources = (request = {}) => this.client.fetch(
299
- {
300
- method: "GET",
301
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/data-sources`,
302
- urlParams: sdkClient.urlParams(
303
- ["order_by", request.orderBy],
304
- ["origin", request.origin],
305
- ["page", request.page],
306
- [
307
- "page_size",
308
- request.pageSize ?? this.client.settings.defaultPageSize
309
- ],
310
- [
311
- "project_id",
312
- request.projectId ?? this.client.settings.defaultProjectId
313
- ],
314
- ["types", request.types]
315
- )
316
- },
317
- marshalling_gen.unmarshalListDataSourcesResponse
318
- );
319
- /**
320
- * List data sources. Retrieve the list of data sources available in the specified region. By default, the data sources returned in the list are ordered by creation date, in ascending order.
321
- *
322
- * @param request - The request {@link RegionalApiListDataSourcesRequest}
323
- * @returns A Promise of ListDataSourcesResponse
324
- */
325
- listDataSources = (request = {}) => sdkClient.enrichForPagination("dataSources", this.pageOfListDataSources, request);
326
- /**
327
- * Update a data source. Update a given data source attributes (name and/or retention_days).
328
- *
329
- * @param request - The request {@link RegionalApiUpdateDataSourceRequest}
330
- * @returns A Promise of DataSource
331
- */
332
- updateDataSource = (request) => this.client.fetch(
333
- {
334
- body: JSON.stringify(
335
- marshalling_gen.marshalRegionalApiUpdateDataSourceRequest(
336
- request,
337
- this.client.settings
338
- )
339
- ),
340
- headers: jsonContentHeaders,
341
- method: "PATCH",
342
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/data-sources/${sdkClient.validatePathParam("dataSourceId", request.dataSourceId)}`
343
- },
344
- marshalling_gen.unmarshalDataSource
345
- );
346
- /**
347
- * Get data source usage overview. Retrieve the volume of data ingested for each of your data sources in the specified project and region.
348
- *
349
- * @param request - The request {@link RegionalApiGetUsageOverviewRequest}
350
- * @returns A Promise of UsageOverview
351
- */
352
- getUsageOverview = (request = {}) => this.client.fetch(
353
- {
354
- method: "GET",
355
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/usage-overview`,
356
- urlParams: sdkClient.urlParams(
357
- ["interval", request.interval],
358
- [
359
- "project_id",
360
- request.projectId ?? this.client.settings.defaultProjectId
361
- ]
362
- )
363
- },
364
- marshalling_gen.unmarshalUsageOverview
365
- );
366
- /**
367
- * Create a token. Give your token the relevant scopes to ensure it has the right permissions to interact with your data sources and the Alert manager. Make sure that you create your token in the same regions as the data sources you want to use it for.
368
- Upon creation, your token's secret key display only once. Make sure that you save it.
369
- *
370
- * @param request - The request {@link RegionalApiCreateTokenRequest}
371
- * @returns A Promise of Token
372
- */
373
- createToken = (request) => this.client.fetch(
374
- {
375
- body: JSON.stringify(
376
- marshalling_gen.marshalRegionalApiCreateTokenRequest(request, this.client.settings)
377
- ),
378
- headers: jsonContentHeaders,
379
- method: "POST",
380
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`
381
- },
382
- marshalling_gen.unmarshalToken
383
- );
384
- pageOfListTokens = (request = {}) => this.client.fetch(
385
- {
386
- method: "GET",
387
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`,
388
- urlParams: sdkClient.urlParams(
389
- ["order_by", request.orderBy],
390
- ["page", request.page],
391
- [
392
- "page_size",
393
- request.pageSize ?? this.client.settings.defaultPageSize
394
- ],
395
- [
396
- "project_id",
397
- request.projectId ?? this.client.settings.defaultProjectId
398
- ],
399
- ["token_scopes", request.tokenScopes]
400
- )
401
- },
402
- marshalling_gen.unmarshalListTokensResponse
403
- );
404
- /**
405
- * List tokens. Retrieve a list of all tokens in the specified region. By default, tokens returned in the list are ordered by creation date, in ascending order.
406
- You can filter tokens by Project ID and token scopes.
407
- *
408
- * @param request - The request {@link RegionalApiListTokensRequest}
409
- * @returns A Promise of ListTokensResponse
410
- */
411
- listTokens = (request = {}) => sdkClient.enrichForPagination("tokens", this.pageOfListTokens, request);
412
- /**
413
- * Get a token. Retrieve information about a given token, specified by the token ID. The token's information such as its scopes, is returned.
414
- *
415
- * @param request - The request {@link RegionalApiGetTokenRequest}
416
- * @returns A Promise of Token
417
- */
418
- getToken = (request) => this.client.fetch(
419
- {
420
- method: "GET",
421
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${sdkClient.validatePathParam("tokenId", request.tokenId)}`
422
- },
423
- marshalling_gen.unmarshalToken
424
- );
425
- /**
426
- * Delete a token. Delete a given token, specified by the token ID. Deleting a token is irreversible and cannot be undone.
427
- *
428
- * @param request - The request {@link RegionalApiDeleteTokenRequest}
429
- */
430
- deleteToken = (request) => this.client.fetch({
431
- method: "DELETE",
432
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${sdkClient.validatePathParam("tokenId", request.tokenId)}`
433
- });
434
- /**
435
- * Get the Alert manager. Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled.
436
- The output returned displays a URL to access the Alert manager, and whether the Alert manager and managed alerts are enabled.
437
- *
438
- * @param request - The request {@link RegionalApiGetAlertManagerRequest}
439
- * @returns A Promise of AlertManager
440
- */
441
- getAlertManager = (request = {}) => this.client.fetch(
442
- {
443
- method: "GET",
444
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager`,
445
- urlParams: sdkClient.urlParams([
446
- "project_id",
447
- request.projectId ?? this.client.settings.defaultProjectId
448
- ])
449
- },
450
- marshalling_gen.unmarshalAlertManager
451
- );
452
- /**
453
- * Enable the Alert manager. Enabling the Alert manager allows you to enable managed alerts and create contact points in the specified Project and region, to be notified when your Scaleway resources may require your attention.
454
- *
455
- * @param request - The request {@link RegionalApiEnableAlertManagerRequest}
456
- * @returns A Promise of AlertManager
457
- */
458
- enableAlertManager = (request = {}) => this.client.fetch(
459
- {
460
- body: JSON.stringify(
461
- marshalling_gen.marshalRegionalApiEnableAlertManagerRequest(
462
- request,
463
- this.client.settings
464
- )
465
- ),
466
- headers: jsonContentHeaders,
467
- method: "POST",
468
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/enable`
469
- },
470
- marshalling_gen.unmarshalAlertManager
471
- );
472
- /**
473
- * Disable the Alert manager. Disabling the Alert manager deletes the contact points you have created and disables managed alerts in the specified Project and region.
474
- *
475
- * @param request - The request {@link RegionalApiDisableAlertManagerRequest}
476
- * @returns A Promise of AlertManager
477
- */
478
- disableAlertManager = (request = {}) => this.client.fetch(
479
- {
480
- body: JSON.stringify(
481
- marshalling_gen.marshalRegionalApiDisableAlertManagerRequest(
482
- request,
483
- this.client.settings
484
- )
485
- ),
486
- headers: jsonContentHeaders,
487
- method: "POST",
488
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/disable`
489
- },
490
- marshalling_gen.unmarshalAlertManager
491
- );
492
- /**
493
- * Get the number of enabled rules Get a detailed count of enabled rules in the specified Project. Includes preconfigured and custom alerting and recording rules.. Get the number of enabled rules Get a detailed count of enabled rules in the specified Project. Includes preconfigured and custom alerting and recording rules.
494
- *
495
- * @param request - The request {@link RegionalApiGetRulesCountRequest}
496
- * @returns A Promise of GetRulesCountResponse
497
- */
498
- getRulesCount = (request = {}) => this.client.fetch(
499
- {
500
- method: "GET",
501
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/rules/count`,
502
- urlParams: sdkClient.urlParams([
503
- "project_id",
504
- request.projectId ?? this.client.settings.defaultProjectId
505
- ])
506
- },
507
- marshalling_gen.unmarshalGetRulesCountResponse
508
- );
509
- /**
510
- * Create a contact point. Contact points are email addresses associated with the default receiver, that the Alert manager sends alerts to.
511
- The source of the alerts are data sources within the same Project and region as the Alert manager.
512
- If you need to receive alerts for other receivers, you can create additional contact points and receivers in Grafana. Make sure that you select the Scaleway Alert manager.
513
- *
514
- * @param request - The request {@link RegionalApiCreateContactPointRequest}
515
- * @returns A Promise of ContactPoint
516
- */
517
- createContactPoint = (request = {}) => this.client.fetch(
518
- {
519
- body: JSON.stringify(
520
- marshalling_gen.marshalRegionalApiCreateContactPointRequest(
521
- request,
522
- this.client.settings
523
- )
524
- ),
525
- headers: jsonContentHeaders,
526
- method: "POST",
527
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points`
528
- },
529
- marshalling_gen.unmarshalContactPoint
530
- );
531
- pageOfListContactPoints = (request = {}) => this.client.fetch(
532
- {
533
- method: "GET",
534
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points`,
535
- urlParams: sdkClient.urlParams(
536
- ["page", request.page],
537
- [
538
- "page_size",
539
- request.pageSize ?? this.client.settings.defaultPageSize
540
- ],
541
- [
542
- "project_id",
543
- request.projectId ?? this.client.settings.defaultProjectId
544
- ]
545
- )
546
- },
547
- marshalling_gen.unmarshalListContactPointsResponse
548
- );
549
- /**
550
- * List contact points. Retrieve a list of contact points for the specified Project. The response lists all contact points and receivers created in Grafana or via the API.
551
- *
552
- * @param request - The request {@link RegionalApiListContactPointsRequest}
553
- * @returns A Promise of ListContactPointsResponse
554
- */
555
- listContactPoints = (request = {}) => sdkClient.enrichForPagination("contactPoints", this.pageOfListContactPoints, request);
556
- updateContactPoint = (request = {}) => this.client.fetch(
557
- {
558
- body: JSON.stringify(
559
- marshalling_gen.marshalRegionalApiUpdateContactPointRequest(
560
- request,
561
- this.client.settings
562
- )
563
- ),
564
- headers: jsonContentHeaders,
565
- method: "PATCH",
566
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points`
567
- },
568
- marshalling_gen.unmarshalContactPoint
569
- );
570
- /**
571
- * Delete a contact point. Delete a contact point associated with the default receiver.
572
- *
573
- * @param request - The request {@link RegionalApiDeleteContactPointRequest}
574
- */
575
- deleteContactPoint = (request = {}) => this.client.fetch({
576
- body: JSON.stringify(
577
- marshalling_gen.marshalRegionalApiDeleteContactPointRequest(
578
- request,
579
- this.client.settings
580
- )
581
- ),
582
- headers: jsonContentHeaders,
583
- method: "POST",
584
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points/delete`
585
- });
586
- /**
587
- * List alerts. List preconfigured and/or custom alerts for the specified Project and data source.
588
- *
589
- * @param request - The request {@link RegionalApiListAlertsRequest}
590
- * @returns A Promise of ListAlertsResponse
591
- */
592
- listAlerts = (request = {}) => this.client.fetch(
593
- {
594
- method: "GET",
595
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alerts`,
596
- urlParams: sdkClient.urlParams(
597
- ["data_source_id", request.dataSourceId],
598
- ["is_preconfigured", request.isPreconfigured],
599
- [
600
- "project_id",
601
- request.projectId ?? this.client.settings.defaultProjectId
602
- ],
603
- ["rule_status", request.ruleStatus],
604
- ["state", request.state]
605
- )
606
- },
607
- marshalling_gen.unmarshalListAlertsResponse
608
- );
609
- /**
610
- * Enable preconfigured alert rules. Enable alert rules from the list of available preconfigured rules.
611
- *
612
- * @param request - The request {@link RegionalApiEnableAlertRulesRequest}
613
- * @returns A Promise of EnableAlertRulesResponse
614
- */
615
- enableAlertRules = (request = {}) => this.client.fetch(
616
- {
617
- body: JSON.stringify(
618
- marshalling_gen.marshalRegionalApiEnableAlertRulesRequest(
619
- request,
620
- this.client.settings
621
- )
622
- ),
623
- headers: jsonContentHeaders,
624
- method: "POST",
625
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/enable-alert-rules`
626
- },
627
- marshalling_gen.unmarshalEnableAlertRulesResponse
628
- );
629
- /**
630
- * Disable preconfigured alert rules. Disable alert rules from the list of available preconfigured rules.
631
- *
632
- * @param request - The request {@link RegionalApiDisableAlertRulesRequest}
633
- * @returns A Promise of DisableAlertRulesResponse
634
- */
635
- disableAlertRules = (request = {}) => this.client.fetch(
636
- {
637
- body: JSON.stringify(
638
- marshalling_gen.marshalRegionalApiDisableAlertRulesRequest(
639
- request,
640
- this.client.settings
641
- )
642
- ),
643
- headers: jsonContentHeaders,
644
- method: "POST",
645
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/disable-alert-rules`
646
- },
647
- marshalling_gen.unmarshalDisableAlertRulesResponse
648
- );
649
- /**
650
- * Trigger a test alert. Send a test alert to the Alert manager to make sure your contact points get notified.
651
- *
652
- * @param request - The request {@link RegionalApiTriggerTestAlertRequest}
653
- */
654
- triggerTestAlert = (request = {}) => this.client.fetch({
655
- body: JSON.stringify(
656
- marshalling_gen.marshalRegionalApiTriggerTestAlertRequest(
657
- request,
658
- this.client.settings
659
- )
660
- ),
661
- headers: jsonContentHeaders,
662
- method: "POST",
663
- path: `/cockpit/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/trigger-test-alert`
664
- });
665
- }
666
- exports.GlobalAPI = GlobalAPI;
667
- exports.RegionalAPI = RegionalAPI;