@scaleway/sdk-cockpit 2.2.0 → 2.2.2
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/v1/api.gen.d.ts +56 -3
- package/dist/v1/api.gen.js +205 -186
- package/dist/v1/content.gen.d.ts +3 -0
- package/dist/v1/content.gen.js +6 -0
- package/dist/v1/index.gen.d.ts +2 -1
- package/dist/v1/index.gen.js +7 -1
- package/dist/v1/marshalling.gen.d.ts +5 -1
- package/dist/v1/marshalling.gen.js +99 -16
- package/dist/v1/types.gen.d.ts +221 -18
- package/dist/v1/validation-rules.gen.d.ts +28 -0
- package/dist/v1/validation-rules.gen.js +32 -1
- package/package.json +2 -2
package/dist/v1/api.gen.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { API, toApiLocality, validatePathParam, urlParams, enrichForPagination } from "@scaleway/sdk-client";
|
|
2
|
-
import {
|
|
1
|
+
import { API, toApiLocality, validatePathParam, urlParams, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
|
|
2
|
+
import { EXPORTER_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
+
import { unmarshalGetConfigResponse, marshalRegionalApiCreateExporterRequest, unmarshalExporter, unmarshalListExportersResponse, marshalRegionalApiUpdateExporterRequest, marshalRegionalApiCreateDataSourceRequest, unmarshalDataSource, unmarshalListDataSourcesResponse, marshalRegionalApiUpdateDataSourceRequest, unmarshalUsageOverview, marshalRegionalApiCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, unmarshalListProductsResponse, unmarshalAlertManager, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiDisableAlertManagerRequest, unmarshalGetRulesCountResponse, marshalRegionalApiCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalRegionalApiUpdateContactPointRequest, marshalRegionalApiDeleteContactPointRequest, unmarshalListAlertsResponse, marshalRegionalApiEnableManagedAlertsRequest, marshalRegionalApiDisableManagedAlertsRequest, marshalRegionalApiEnableAlertRulesRequest, unmarshalEnableAlertRulesResponse, marshalRegionalApiDisableAlertRulesRequest, unmarshalDisableAlertRulesResponse, marshalRegionalApiTriggerTestAlertRequest, unmarshalGrafana, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalGlobalApiCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalGlobalApiResetGrafanaUserPasswordRequest, unmarshalListGrafanaProductDashboardsResponse, unmarshalGrafanaProductDashboard, unmarshalListPlansResponse, marshalGlobalApiSelectPlanRequest, unmarshalPlan } from "./marshalling.gen.js";
|
|
3
4
|
const jsonContentHeaders = {
|
|
4
5
|
"Content-Type": "application/json; charset=utf-8"
|
|
5
6
|
};
|
|
@@ -15,10 +16,9 @@ class GlobalAPI extends API {
|
|
|
15
16
|
{
|
|
16
17
|
method: "GET",
|
|
17
18
|
path: `/cockpit/v1/grafana`,
|
|
18
|
-
urlParams: urlParams(
|
|
19
|
-
"project_id",
|
|
20
|
-
|
|
21
|
-
])
|
|
19
|
+
urlParams: urlParams(
|
|
20
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId]
|
|
21
|
+
)
|
|
22
22
|
},
|
|
23
23
|
unmarshalGrafana
|
|
24
24
|
);
|
|
@@ -27,17 +27,16 @@ class GlobalAPI extends API {
|
|
|
27
27
|
*
|
|
28
28
|
* @param request - The request {@link GlobalApiSyncGrafanaDataSourcesRequest}
|
|
29
29
|
*/
|
|
30
|
-
syncGrafanaDataSources = (request = {}) => this.client.fetch(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
request,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
30
|
+
syncGrafanaDataSources = (request = {}) => this.client.fetch(
|
|
31
|
+
{
|
|
32
|
+
body: JSON.stringify(
|
|
33
|
+
marshalGlobalApiSyncGrafanaDataSourcesRequest(request, this.client.settings)
|
|
34
|
+
),
|
|
35
|
+
headers: jsonContentHeaders,
|
|
36
|
+
method: "POST",
|
|
37
|
+
path: `/cockpit/v1/grafana/sync-data-sources`
|
|
38
|
+
}
|
|
39
|
+
);
|
|
41
40
|
/**
|
|
42
41
|
* (Deprecated) EOL 2026-01-20. Create a Grafana user
|
|
43
42
|
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.
|
|
@@ -50,10 +49,7 @@ class GlobalAPI extends API {
|
|
|
50
49
|
createGrafanaUser = (request) => this.client.fetch(
|
|
51
50
|
{
|
|
52
51
|
body: JSON.stringify(
|
|
53
|
-
marshalGlobalApiCreateGrafanaUserRequest(
|
|
54
|
-
request,
|
|
55
|
-
this.client.settings
|
|
56
|
-
)
|
|
52
|
+
marshalGlobalApiCreateGrafanaUserRequest(request, this.client.settings)
|
|
57
53
|
),
|
|
58
54
|
headers: jsonContentHeaders,
|
|
59
55
|
method: "POST",
|
|
@@ -68,14 +64,8 @@ class GlobalAPI extends API {
|
|
|
68
64
|
urlParams: urlParams(
|
|
69
65
|
["order_by", request.orderBy],
|
|
70
66
|
["page", request.page],
|
|
71
|
-
[
|
|
72
|
-
|
|
73
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
74
|
-
],
|
|
75
|
-
[
|
|
76
|
-
"project_id",
|
|
77
|
-
request.projectId ?? this.client.settings.defaultProjectId
|
|
78
|
-
]
|
|
67
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
68
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId]
|
|
79
69
|
)
|
|
80
70
|
},
|
|
81
71
|
unmarshalListGrafanaUsersResponse
|
|
@@ -96,14 +86,15 @@ class GlobalAPI extends API {
|
|
|
96
86
|
* @deprecated
|
|
97
87
|
* @param request - The request {@link GlobalApiDeleteGrafanaUserRequest}
|
|
98
88
|
*/
|
|
99
|
-
deleteGrafanaUser = (request) => this.client.fetch(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
89
|
+
deleteGrafanaUser = (request) => this.client.fetch(
|
|
90
|
+
{
|
|
91
|
+
method: "DELETE",
|
|
92
|
+
path: `/cockpit/v1/grafana/users/${validatePathParam("grafanaUserId", request.grafanaUserId)}`,
|
|
93
|
+
urlParams: urlParams(
|
|
94
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId]
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
);
|
|
107
98
|
/**
|
|
108
99
|
* (Deprecated) EOL 2026-01-20. Reset a Grafana user password
|
|
109
100
|
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.
|
|
@@ -116,10 +107,7 @@ class GlobalAPI extends API {
|
|
|
116
107
|
resetGrafanaUserPassword = (request) => this.client.fetch(
|
|
117
108
|
{
|
|
118
109
|
body: JSON.stringify(
|
|
119
|
-
marshalGlobalApiResetGrafanaUserPasswordRequest(
|
|
120
|
-
request,
|
|
121
|
-
this.client.settings
|
|
122
|
-
)
|
|
110
|
+
marshalGlobalApiResetGrafanaUserPasswordRequest(request, this.client.settings)
|
|
123
111
|
),
|
|
124
112
|
headers: jsonContentHeaders,
|
|
125
113
|
method: "POST",
|
|
@@ -133,14 +121,8 @@ class GlobalAPI extends API {
|
|
|
133
121
|
path: `/cockpit/v1/grafana/product-dashboards`,
|
|
134
122
|
urlParams: urlParams(
|
|
135
123
|
["page", request.page],
|
|
136
|
-
[
|
|
137
|
-
|
|
138
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
139
|
-
],
|
|
140
|
-
[
|
|
141
|
-
"project_id",
|
|
142
|
-
request.projectId ?? this.client.settings.defaultProjectId
|
|
143
|
-
],
|
|
124
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
125
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId],
|
|
144
126
|
["tags", request.tags]
|
|
145
127
|
)
|
|
146
128
|
},
|
|
@@ -152,11 +134,7 @@ class GlobalAPI extends API {
|
|
|
152
134
|
* @param request - The request {@link GlobalApiListGrafanaProductDashboardsRequest}
|
|
153
135
|
* @returns A Promise of ListGrafanaProductDashboardsResponse
|
|
154
136
|
*/
|
|
155
|
-
listGrafanaProductDashboards = (request = {}) => enrichForPagination(
|
|
156
|
-
"dashboards",
|
|
157
|
-
this.pageOfListGrafanaProductDashboards,
|
|
158
|
-
request
|
|
159
|
-
);
|
|
137
|
+
listGrafanaProductDashboards = (request = {}) => enrichForPagination("dashboards", this.pageOfListGrafanaProductDashboards, request);
|
|
160
138
|
/**
|
|
161
139
|
* 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.
|
|
162
140
|
*
|
|
@@ -167,10 +145,9 @@ class GlobalAPI extends API {
|
|
|
167
145
|
{
|
|
168
146
|
method: "GET",
|
|
169
147
|
path: `/cockpit/v1/grafana/product-dashboards/${validatePathParam("dashboardName", request.dashboardName)}`,
|
|
170
|
-
urlParams: urlParams(
|
|
171
|
-
"project_id",
|
|
172
|
-
|
|
173
|
-
])
|
|
148
|
+
urlParams: urlParams(
|
|
149
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId]
|
|
150
|
+
)
|
|
174
151
|
},
|
|
175
152
|
unmarshalGrafanaProductDashboard
|
|
176
153
|
);
|
|
@@ -181,10 +158,7 @@ class GlobalAPI extends API {
|
|
|
181
158
|
urlParams: urlParams(
|
|
182
159
|
["order_by", request.orderBy],
|
|
183
160
|
["page", request.page],
|
|
184
|
-
[
|
|
185
|
-
"page_size",
|
|
186
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
187
|
-
]
|
|
161
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
188
162
|
)
|
|
189
163
|
},
|
|
190
164
|
unmarshalListPlansResponse
|
|
@@ -229,10 +203,9 @@ class GlobalAPI extends API {
|
|
|
229
203
|
{
|
|
230
204
|
method: "GET",
|
|
231
205
|
path: `/cockpit/v1/current-plan`,
|
|
232
|
-
urlParams: urlParams(
|
|
233
|
-
"project_id",
|
|
234
|
-
|
|
235
|
-
])
|
|
206
|
+
urlParams: urlParams(
|
|
207
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId]
|
|
208
|
+
)
|
|
236
209
|
},
|
|
237
210
|
unmarshalPlan
|
|
238
211
|
);
|
|
@@ -243,7 +216,11 @@ class RegionalAPI extends API {
|
|
|
243
216
|
* type ∈ {'zone','region','global','unspecified'}
|
|
244
217
|
*/
|
|
245
218
|
static LOCALITY = toApiLocality({
|
|
246
|
-
regions: [
|
|
219
|
+
regions: [
|
|
220
|
+
"fr-par",
|
|
221
|
+
"nl-ams",
|
|
222
|
+
"pl-waw"
|
|
223
|
+
]
|
|
247
224
|
});
|
|
248
225
|
/**
|
|
249
226
|
* Get the Cockpit configuration.
|
|
@@ -258,6 +235,103 @@ class RegionalAPI extends API {
|
|
|
258
235
|
},
|
|
259
236
|
unmarshalGetConfigResponse
|
|
260
237
|
);
|
|
238
|
+
/**
|
|
239
|
+
* Create a data export. Create an export to send your metrics/logs from a Scaleway data source to an external destination.
|
|
240
|
+
Current supported destination for data exports are Datadog and OTLP endpoints.
|
|
241
|
+
This feature is in Beta phase. During Beta phase, exporter can take up to 30 min to be effectively active.
|
|
242
|
+
*
|
|
243
|
+
* @param request - The request {@link RegionalApiCreateExporterRequest}
|
|
244
|
+
* @returns A Promise of Exporter
|
|
245
|
+
*/
|
|
246
|
+
createExporter = (request) => this.client.fetch(
|
|
247
|
+
{
|
|
248
|
+
body: JSON.stringify(
|
|
249
|
+
marshalRegionalApiCreateExporterRequest(request, this.client.settings)
|
|
250
|
+
),
|
|
251
|
+
headers: jsonContentHeaders,
|
|
252
|
+
method: "POST",
|
|
253
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/exporters`
|
|
254
|
+
},
|
|
255
|
+
unmarshalExporter
|
|
256
|
+
);
|
|
257
|
+
pageOfListExporters = (request = {}) => this.client.fetch(
|
|
258
|
+
{
|
|
259
|
+
method: "GET",
|
|
260
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/exporters`,
|
|
261
|
+
urlParams: urlParams(
|
|
262
|
+
["datasource_id", request.datasourceId],
|
|
263
|
+
["order_by", request.orderBy],
|
|
264
|
+
["page", request.page],
|
|
265
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
266
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId]
|
|
267
|
+
)
|
|
268
|
+
},
|
|
269
|
+
unmarshalListExportersResponse
|
|
270
|
+
);
|
|
271
|
+
/**
|
|
272
|
+
* List data exports. List all data exports within a given Scaleway Project, specified by its ID.
|
|
273
|
+
Optionally, specify a Scaleway data source ID to retrieve only data exports associated with that data source.
|
|
274
|
+
*
|
|
275
|
+
* @param request - The request {@link RegionalApiListExportersRequest}
|
|
276
|
+
* @returns A Promise of ListExportersResponse
|
|
277
|
+
*/
|
|
278
|
+
listExporters = (request = {}) => enrichForPagination("exporters", this.pageOfListExporters, request);
|
|
279
|
+
/**
|
|
280
|
+
* Get a data export. Retrieve information about a given data export, specified by its ID.
|
|
281
|
+
*
|
|
282
|
+
* @param request - The request {@link RegionalApiGetExporterRequest}
|
|
283
|
+
* @returns A Promise of Exporter
|
|
284
|
+
*/
|
|
285
|
+
getExporter = (request) => this.client.fetch(
|
|
286
|
+
{
|
|
287
|
+
method: "GET",
|
|
288
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/exporters/${validatePathParam("exporterId", request.exporterId)}`
|
|
289
|
+
},
|
|
290
|
+
unmarshalExporter
|
|
291
|
+
);
|
|
292
|
+
/**
|
|
293
|
+
* Waits for {@link Exporter} to be in a final state.
|
|
294
|
+
*
|
|
295
|
+
* @param request - The request {@link RegionalApiGetExporterRequest}
|
|
296
|
+
* @param options - The waiting options
|
|
297
|
+
* @returns A Promise of Exporter
|
|
298
|
+
*/
|
|
299
|
+
waitForExporter = (request, options) => waitForResource(
|
|
300
|
+
options?.stop ?? ((res) => Promise.resolve(!EXPORTER_TRANSIENT_STATUSES.includes(res.status))),
|
|
301
|
+
this.getExporter,
|
|
302
|
+
request,
|
|
303
|
+
options
|
|
304
|
+
);
|
|
305
|
+
/**
|
|
306
|
+
* Delete a data export. Delete a given data export, specified by its ID.
|
|
307
|
+
Note that this action will immediately and permanently delete this data exports.
|
|
308
|
+
*
|
|
309
|
+
* @param request - The request {@link RegionalApiDeleteExporterRequest}
|
|
310
|
+
*/
|
|
311
|
+
deleteExporter = (request) => this.client.fetch(
|
|
312
|
+
{
|
|
313
|
+
method: "DELETE",
|
|
314
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/exporters/${validatePathParam("exporterId", request.exporterId)}`
|
|
315
|
+
}
|
|
316
|
+
);
|
|
317
|
+
/**
|
|
318
|
+
* Update a data export. Update a data export attributes. Changes are effective immediately even during Beta phase.
|
|
319
|
+
Note that you can not change the data source linked to the export. If you need to do so, you will need to re-create the export.
|
|
320
|
+
*
|
|
321
|
+
* @param request - The request {@link RegionalApiUpdateExporterRequest}
|
|
322
|
+
* @returns A Promise of Exporter
|
|
323
|
+
*/
|
|
324
|
+
updateExporter = (request) => this.client.fetch(
|
|
325
|
+
{
|
|
326
|
+
body: JSON.stringify(
|
|
327
|
+
marshalRegionalApiUpdateExporterRequest(request, this.client.settings)
|
|
328
|
+
),
|
|
329
|
+
headers: jsonContentHeaders,
|
|
330
|
+
method: "PATCH",
|
|
331
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/exporters/${validatePathParam("exporterId", request.exporterId)}`
|
|
332
|
+
},
|
|
333
|
+
unmarshalExporter
|
|
334
|
+
);
|
|
261
335
|
/**
|
|
262
336
|
* Create a data source. You must specify the data source name and type (metrics, logs, traces) upon creation.
|
|
263
337
|
The name of the data source will then be used as reference to name the associated Grafana data source.
|
|
@@ -268,10 +342,7 @@ class RegionalAPI extends API {
|
|
|
268
342
|
createDataSource = (request) => this.client.fetch(
|
|
269
343
|
{
|
|
270
344
|
body: JSON.stringify(
|
|
271
|
-
marshalRegionalApiCreateDataSourceRequest(
|
|
272
|
-
request,
|
|
273
|
-
this.client.settings
|
|
274
|
-
)
|
|
345
|
+
marshalRegionalApiCreateDataSourceRequest(request, this.client.settings)
|
|
275
346
|
),
|
|
276
347
|
headers: jsonContentHeaders,
|
|
277
348
|
method: "POST",
|
|
@@ -297,10 +368,12 @@ class RegionalAPI extends API {
|
|
|
297
368
|
*
|
|
298
369
|
* @param request - The request {@link RegionalApiDeleteDataSourceRequest}
|
|
299
370
|
*/
|
|
300
|
-
deleteDataSource = (request) => this.client.fetch(
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
371
|
+
deleteDataSource = (request) => this.client.fetch(
|
|
372
|
+
{
|
|
373
|
+
method: "DELETE",
|
|
374
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/data-sources/${validatePathParam("dataSourceId", request.dataSourceId)}`
|
|
375
|
+
}
|
|
376
|
+
);
|
|
304
377
|
pageOfListDataSources = (request = {}) => this.client.fetch(
|
|
305
378
|
{
|
|
306
379
|
method: "GET",
|
|
@@ -309,14 +382,8 @@ class RegionalAPI extends API {
|
|
|
309
382
|
["order_by", request.orderBy],
|
|
310
383
|
["origin", request.origin],
|
|
311
384
|
["page", request.page],
|
|
312
|
-
[
|
|
313
|
-
|
|
314
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
315
|
-
],
|
|
316
|
-
[
|
|
317
|
-
"project_id",
|
|
318
|
-
request.projectId ?? this.client.settings.defaultProjectId
|
|
319
|
-
],
|
|
385
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
386
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId],
|
|
320
387
|
["types", request.types]
|
|
321
388
|
)
|
|
322
389
|
},
|
|
@@ -338,10 +405,7 @@ class RegionalAPI extends API {
|
|
|
338
405
|
updateDataSource = (request) => this.client.fetch(
|
|
339
406
|
{
|
|
340
407
|
body: JSON.stringify(
|
|
341
|
-
marshalRegionalApiUpdateDataSourceRequest(
|
|
342
|
-
request,
|
|
343
|
-
this.client.settings
|
|
344
|
-
)
|
|
408
|
+
marshalRegionalApiUpdateDataSourceRequest(request, this.client.settings)
|
|
345
409
|
),
|
|
346
410
|
headers: jsonContentHeaders,
|
|
347
411
|
method: "PATCH",
|
|
@@ -361,10 +425,7 @@ class RegionalAPI extends API {
|
|
|
361
425
|
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/usage-overview`,
|
|
362
426
|
urlParams: urlParams(
|
|
363
427
|
["interval", request.interval],
|
|
364
|
-
[
|
|
365
|
-
"project_id",
|
|
366
|
-
request.projectId ?? this.client.settings.defaultProjectId
|
|
367
|
-
]
|
|
428
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId]
|
|
368
429
|
)
|
|
369
430
|
},
|
|
370
431
|
unmarshalUsageOverview
|
|
@@ -394,14 +455,8 @@ class RegionalAPI extends API {
|
|
|
394
455
|
urlParams: urlParams(
|
|
395
456
|
["order_by", request.orderBy],
|
|
396
457
|
["page", request.page],
|
|
397
|
-
[
|
|
398
|
-
|
|
399
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
400
|
-
],
|
|
401
|
-
[
|
|
402
|
-
"project_id",
|
|
403
|
-
request.projectId ?? this.client.settings.defaultProjectId
|
|
404
|
-
],
|
|
458
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
459
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId],
|
|
405
460
|
["token_scopes", request.tokenScopes]
|
|
406
461
|
)
|
|
407
462
|
},
|
|
@@ -433,10 +488,12 @@ class RegionalAPI extends API {
|
|
|
433
488
|
*
|
|
434
489
|
* @param request - The request {@link RegionalApiDeleteTokenRequest}
|
|
435
490
|
*/
|
|
436
|
-
deleteToken = (request) => this.client.fetch(
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
491
|
+
deleteToken = (request) => this.client.fetch(
|
|
492
|
+
{
|
|
493
|
+
method: "DELETE",
|
|
494
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam("tokenId", request.tokenId)}`
|
|
495
|
+
}
|
|
496
|
+
);
|
|
440
497
|
pageOfListProducts = (request = {}) => this.client.fetch(
|
|
441
498
|
{
|
|
442
499
|
method: "GET",
|
|
@@ -444,20 +501,19 @@ class RegionalAPI extends API {
|
|
|
444
501
|
urlParams: urlParams(
|
|
445
502
|
["order_by", request.orderBy],
|
|
446
503
|
["page", request.page],
|
|
447
|
-
[
|
|
448
|
-
"page_size",
|
|
449
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
450
|
-
]
|
|
504
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
451
505
|
)
|
|
452
506
|
},
|
|
453
507
|
unmarshalListProductsResponse
|
|
454
508
|
);
|
|
455
509
|
/**
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
510
|
+
* List Scaleway products. List all Scaleway products that send metrics and/or logs to Cockpit.
|
|
511
|
+
Note that all of those products send at least metrics, but only a subset send logs to Cockpit.
|
|
512
|
+
For more information, see https://www.scaleway.com/en/docs/cockpit/reference-content/cockpit-product-integration/.
|
|
513
|
+
*
|
|
514
|
+
* @param request - The request {@link RegionalApiListProductsRequest}
|
|
515
|
+
* @returns A Promise of ListProductsResponse
|
|
516
|
+
*/
|
|
461
517
|
listProducts = (request = {}) => enrichForPagination("productsList", this.pageOfListProducts, request);
|
|
462
518
|
/**
|
|
463
519
|
* Get the Alert manager. Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled.
|
|
@@ -470,10 +526,9 @@ class RegionalAPI extends API {
|
|
|
470
526
|
{
|
|
471
527
|
method: "GET",
|
|
472
528
|
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager`,
|
|
473
|
-
urlParams: urlParams(
|
|
474
|
-
"project_id",
|
|
475
|
-
|
|
476
|
-
])
|
|
529
|
+
urlParams: urlParams(
|
|
530
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId]
|
|
531
|
+
)
|
|
477
532
|
},
|
|
478
533
|
unmarshalAlertManager
|
|
479
534
|
);
|
|
@@ -486,10 +541,7 @@ class RegionalAPI extends API {
|
|
|
486
541
|
enableAlertManager = (request = {}) => this.client.fetch(
|
|
487
542
|
{
|
|
488
543
|
body: JSON.stringify(
|
|
489
|
-
marshalRegionalApiEnableAlertManagerRequest(
|
|
490
|
-
request,
|
|
491
|
-
this.client.settings
|
|
492
|
-
)
|
|
544
|
+
marshalRegionalApiEnableAlertManagerRequest(request, this.client.settings)
|
|
493
545
|
),
|
|
494
546
|
headers: jsonContentHeaders,
|
|
495
547
|
method: "POST",
|
|
@@ -506,10 +558,7 @@ class RegionalAPI extends API {
|
|
|
506
558
|
disableAlertManager = (request = {}) => this.client.fetch(
|
|
507
559
|
{
|
|
508
560
|
body: JSON.stringify(
|
|
509
|
-
marshalRegionalApiDisableAlertManagerRequest(
|
|
510
|
-
request,
|
|
511
|
-
this.client.settings
|
|
512
|
-
)
|
|
561
|
+
marshalRegionalApiDisableAlertManagerRequest(request, this.client.settings)
|
|
513
562
|
),
|
|
514
563
|
headers: jsonContentHeaders,
|
|
515
564
|
method: "POST",
|
|
@@ -527,10 +576,9 @@ class RegionalAPI extends API {
|
|
|
527
576
|
{
|
|
528
577
|
method: "GET",
|
|
529
578
|
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/rules/count`,
|
|
530
|
-
urlParams: urlParams(
|
|
531
|
-
"project_id",
|
|
532
|
-
|
|
533
|
-
])
|
|
579
|
+
urlParams: urlParams(
|
|
580
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId]
|
|
581
|
+
)
|
|
534
582
|
},
|
|
535
583
|
unmarshalGetRulesCountResponse
|
|
536
584
|
);
|
|
@@ -545,10 +593,7 @@ class RegionalAPI extends API {
|
|
|
545
593
|
createContactPoint = (request = {}) => this.client.fetch(
|
|
546
594
|
{
|
|
547
595
|
body: JSON.stringify(
|
|
548
|
-
marshalRegionalApiCreateContactPointRequest(
|
|
549
|
-
request,
|
|
550
|
-
this.client.settings
|
|
551
|
-
)
|
|
596
|
+
marshalRegionalApiCreateContactPointRequest(request, this.client.settings)
|
|
552
597
|
),
|
|
553
598
|
headers: jsonContentHeaders,
|
|
554
599
|
method: "POST",
|
|
@@ -562,14 +607,8 @@ class RegionalAPI extends API {
|
|
|
562
607
|
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points`,
|
|
563
608
|
urlParams: urlParams(
|
|
564
609
|
["page", request.page],
|
|
565
|
-
[
|
|
566
|
-
|
|
567
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
568
|
-
],
|
|
569
|
-
[
|
|
570
|
-
"project_id",
|
|
571
|
-
request.projectId ?? this.client.settings.defaultProjectId
|
|
572
|
-
]
|
|
610
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
611
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId]
|
|
573
612
|
)
|
|
574
613
|
},
|
|
575
614
|
unmarshalListContactPointsResponse
|
|
@@ -584,10 +623,7 @@ class RegionalAPI extends API {
|
|
|
584
623
|
updateContactPoint = (request = {}) => this.client.fetch(
|
|
585
624
|
{
|
|
586
625
|
body: JSON.stringify(
|
|
587
|
-
marshalRegionalApiUpdateContactPointRequest(
|
|
588
|
-
request,
|
|
589
|
-
this.client.settings
|
|
590
|
-
)
|
|
626
|
+
marshalRegionalApiUpdateContactPointRequest(request, this.client.settings)
|
|
591
627
|
),
|
|
592
628
|
headers: jsonContentHeaders,
|
|
593
629
|
method: "PATCH",
|
|
@@ -600,17 +636,16 @@ class RegionalAPI extends API {
|
|
|
600
636
|
*
|
|
601
637
|
* @param request - The request {@link RegionalApiDeleteContactPointRequest}
|
|
602
638
|
*/
|
|
603
|
-
deleteContactPoint = (request = {}) => this.client.fetch(
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
request,
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
});
|
|
639
|
+
deleteContactPoint = (request = {}) => this.client.fetch(
|
|
640
|
+
{
|
|
641
|
+
body: JSON.stringify(
|
|
642
|
+
marshalRegionalApiDeleteContactPointRequest(request, this.client.settings)
|
|
643
|
+
),
|
|
644
|
+
headers: jsonContentHeaders,
|
|
645
|
+
method: "POST",
|
|
646
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points/delete`
|
|
647
|
+
}
|
|
648
|
+
);
|
|
614
649
|
/**
|
|
615
650
|
* List alerts. List preconfigured and/or custom alerts for the specified Project and data source.
|
|
616
651
|
*
|
|
@@ -624,10 +659,7 @@ class RegionalAPI extends API {
|
|
|
624
659
|
urlParams: urlParams(
|
|
625
660
|
["data_source_id", request.dataSourceId],
|
|
626
661
|
["is_preconfigured", request.isPreconfigured],
|
|
627
|
-
[
|
|
628
|
-
"project_id",
|
|
629
|
-
request.projectId ?? this.client.settings.defaultProjectId
|
|
630
|
-
],
|
|
662
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId],
|
|
631
663
|
["rule_status", request.ruleStatus],
|
|
632
664
|
["state", request.state]
|
|
633
665
|
)
|
|
@@ -644,10 +676,7 @@ class RegionalAPI extends API {
|
|
|
644
676
|
enableManagedAlerts = (request = {}) => this.client.fetch(
|
|
645
677
|
{
|
|
646
678
|
body: JSON.stringify(
|
|
647
|
-
marshalRegionalApiEnableManagedAlertsRequest(
|
|
648
|
-
request,
|
|
649
|
-
this.client.settings
|
|
650
|
-
)
|
|
679
|
+
marshalRegionalApiEnableManagedAlertsRequest(request, this.client.settings)
|
|
651
680
|
),
|
|
652
681
|
headers: jsonContentHeaders,
|
|
653
682
|
method: "POST",
|
|
@@ -665,10 +694,7 @@ class RegionalAPI extends API {
|
|
|
665
694
|
disableManagedAlerts = (request = {}) => this.client.fetch(
|
|
666
695
|
{
|
|
667
696
|
body: JSON.stringify(
|
|
668
|
-
marshalRegionalApiDisableManagedAlertsRequest(
|
|
669
|
-
request,
|
|
670
|
-
this.client.settings
|
|
671
|
-
)
|
|
697
|
+
marshalRegionalApiDisableManagedAlertsRequest(request, this.client.settings)
|
|
672
698
|
),
|
|
673
699
|
headers: jsonContentHeaders,
|
|
674
700
|
method: "POST",
|
|
@@ -685,10 +711,7 @@ class RegionalAPI extends API {
|
|
|
685
711
|
enableAlertRules = (request = {}) => this.client.fetch(
|
|
686
712
|
{
|
|
687
713
|
body: JSON.stringify(
|
|
688
|
-
marshalRegionalApiEnableAlertRulesRequest(
|
|
689
|
-
request,
|
|
690
|
-
this.client.settings
|
|
691
|
-
)
|
|
714
|
+
marshalRegionalApiEnableAlertRulesRequest(request, this.client.settings)
|
|
692
715
|
),
|
|
693
716
|
headers: jsonContentHeaders,
|
|
694
717
|
method: "POST",
|
|
@@ -705,10 +728,7 @@ class RegionalAPI extends API {
|
|
|
705
728
|
disableAlertRules = (request = {}) => this.client.fetch(
|
|
706
729
|
{
|
|
707
730
|
body: JSON.stringify(
|
|
708
|
-
marshalRegionalApiDisableAlertRulesRequest(
|
|
709
|
-
request,
|
|
710
|
-
this.client.settings
|
|
711
|
-
)
|
|
731
|
+
marshalRegionalApiDisableAlertRulesRequest(request, this.client.settings)
|
|
712
732
|
),
|
|
713
733
|
headers: jsonContentHeaders,
|
|
714
734
|
method: "POST",
|
|
@@ -721,17 +741,16 @@ class RegionalAPI extends API {
|
|
|
721
741
|
*
|
|
722
742
|
* @param request - The request {@link RegionalApiTriggerTestAlertRequest}
|
|
723
743
|
*/
|
|
724
|
-
triggerTestAlert = (request = {}) => this.client.fetch(
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
request,
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
});
|
|
744
|
+
triggerTestAlert = (request = {}) => this.client.fetch(
|
|
745
|
+
{
|
|
746
|
+
body: JSON.stringify(
|
|
747
|
+
marshalRegionalApiTriggerTestAlertRequest(request, this.client.settings)
|
|
748
|
+
),
|
|
749
|
+
headers: jsonContentHeaders,
|
|
750
|
+
method: "POST",
|
|
751
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/trigger-test-alert`
|
|
752
|
+
}
|
|
753
|
+
);
|
|
735
754
|
}
|
|
736
755
|
export {
|
|
737
756
|
GlobalAPI,
|
package/dist/v1/index.gen.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { GlobalAPI, RegionalAPI, } from './api.gen.js';
|
|
2
|
+
export * from './content.gen.js';
|
|
2
3
|
export * from './marshalling.gen.js';
|
|
3
|
-
export type { Alert, AlertManager, AlertState, AlertStatus, ContactPoint, ContactPointEmail, DataSource, DataSourceOrigin, DataSourceType, DisableAlertRulesResponse, EnableAlertRulesResponse, GetConfigResponse, GetConfigResponseRetention, GetRulesCountResponse, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, GrafanaUserRole, ListAlertsResponse, ListContactPointsResponse, ListDataSourcesRequestOrderBy, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersRequestOrderBy, ListGrafanaUsersResponse, ListPlansRequestOrderBy, ListPlansResponse, ListProductsRequestOrderBy, ListProductsResponse, ListTokensRequestOrderBy, ListTokensResponse, Plan, PlanName, PreconfiguredAlertData, Product, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableAlertRulesRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableAlertRulesRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetConfigRequest, RegionalApiGetDataSourceRequest, RegionalApiGetRulesCountRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListAlertsRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListProductsRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateContactPointRequest, RegionalApiUpdateDataSourceRequest, RulesCount, Token, TokenScope, Usage, UsageOverview, UsageUnit, } from './types.gen.js';
|
|
4
|
+
export type { Alert, AlertManager, AlertState, AlertStatus, ContactPoint, ContactPointEmail, DataSource, DataSourceOrigin, DataSourceType, DisableAlertRulesResponse, EnableAlertRulesResponse, Exporter, ExporterDatadogDestination, ExporterOTLPDestination, ExporterStatus, GetConfigResponse, GetConfigResponseRetention, GetRulesCountResponse, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, GrafanaUserRole, ListAlertsResponse, ListContactPointsResponse, ListDataSourcesRequestOrderBy, ListDataSourcesResponse, ListExportersRequestOrderBy, ListExportersResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersRequestOrderBy, ListGrafanaUsersResponse, ListPlansRequestOrderBy, ListPlansResponse, ListProductsRequestOrderBy, ListProductsResponse, ListTokensRequestOrderBy, ListTokensResponse, Plan, PlanName, PreconfiguredAlertData, Product, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateExporterRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteExporterRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableAlertRulesRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableAlertRulesRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetConfigRequest, RegionalApiGetDataSourceRequest, RegionalApiGetExporterRequest, RegionalApiGetRulesCountRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListAlertsRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListExportersRequest, RegionalApiListProductsRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateContactPointRequest, RegionalApiUpdateDataSourceRequest, RegionalApiUpdateExporterRequest, RulesCount, Token, TokenScope, Usage, UsageOverview, UsageUnit, } from './types.gen.js';
|
|
4
5
|
export * as ValidationRules from './validation-rules.gen.js';
|