@scaleway/sdk-cockpit 1.3.1 → 1.3.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.
@@ -232,12 +232,13 @@ class GlobalAPI extends sdkClient.API {
232
232
  );
233
233
  }
234
234
  class RegionalAPI extends sdkClient.API {
235
- /** Lists the available regions of the API. */
236
- static LOCALITIES = [
237
- "fr-par",
238
- "nl-ams",
239
- "pl-waw"
240
- ];
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
+ });
241
242
  /**
242
243
  * Get the Cockpit configuration.
243
244
  *
@@ -252,10 +253,7 @@ class RegionalAPI extends sdkClient.API {
252
253
  marshalling_gen.unmarshalGetConfigResponse
253
254
  );
254
255
  /**
255
- * Create a data source. You must specify the data source type upon creation. Available data source types include:
256
- - metrics
257
- - logs
258
- - traces
256
+ * Create a data source. You must specify the data source name and type (metrics, logs, traces) upon creation.
259
257
  The name of the data source will then be used as reference to name the associated Grafana data source.
260
258
  *
261
259
  * @param request - The request {@link RegionalApiCreateDataSourceRequest}
@@ -289,7 +287,7 @@ class RegionalAPI extends sdkClient.API {
289
287
  marshalling_gen.unmarshalDataSource
290
288
  );
291
289
  /**
292
- * Delete a data source. Delete a given data source, specified by the data source ID. Note that deleting a data source is irreversible, and cannot be undone.
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.
293
291
  *
294
292
  * @param request - The request {@link RegionalApiDeleteDataSourceRequest}
295
293
  */
@@ -319,15 +317,14 @@ class RegionalAPI extends sdkClient.API {
319
317
  marshalling_gen.unmarshalListDataSourcesResponse
320
318
  );
321
319
  /**
322
- * 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.
323
- You can list data sources by Project, type and origin.
324
- *
325
- * @param request - The request {@link RegionalApiListDataSourcesRequest}
326
- * @returns A Promise of ListDataSourcesResponse
327
- */
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
+ */
328
325
  listDataSources = (request = {}) => sdkClient.enrichForPagination("dataSources", this.pageOfListDataSources, request);
329
326
  /**
330
- * Update a data source. Update a given data source name, specified by the data source ID.
327
+ * Update a data source. Update a given data source attributes (name and/or retention_days).
331
328
  *
332
329
  * @param request - The request {@link RegionalApiUpdateDataSourceRequest}
333
330
  * @returns A Promise of DataSource
@@ -347,7 +344,7 @@ class RegionalAPI extends sdkClient.API {
347
344
  marshalling_gen.unmarshalDataSource
348
345
  );
349
346
  /**
350
- * Get data source usage overview. Retrieve the data source usage overview per type for the specified Project.
347
+ * Get data source usage overview. Retrieve the volume of data ingested for each of your data sources in the specified project and region.
351
348
  *
352
349
  * @param request - The request {@link RegionalApiGetUsageOverviewRequest}
353
350
  * @returns A Promise of UsageOverview
@@ -1,5 +1,5 @@
1
1
  import { API as ParentAPI } from '@scaleway/sdk-client';
2
- import type { Region as ScwRegion } from '@scaleway/sdk-client';
2
+ import type { ApiLocality } from '@scaleway/sdk-client';
3
3
  import type { AlertManager, ContactPoint, DataSource, DisableAlertRulesResponse, EnableAlertRulesResponse, GetConfigResponse, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, ListAlertsResponse, ListContactPointsResponse, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, ListTokensResponse, Plan, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableAlertRulesRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableAlertRulesRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetConfigRequest, RegionalApiGetDataSourceRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListAlertsRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateContactPointRequest, RegionalApiUpdateDataSourceRequest, Token, UsageOverview } from './types.gen';
4
4
  /**
5
5
  * Cockpit Global API.
@@ -110,8 +110,11 @@ export declare class GlobalAPI extends ParentAPI {
110
110
  The Cockpit API allows you to create data sources and Cockpit tokens to store and query data types such as metrics, logs, and traces. You can also push your data into Cockpit, and send alerts to your contact points when your resources may require your attention, using the regional Alert manager.
111
111
  */
112
112
  export declare class RegionalAPI extends ParentAPI {
113
- /** Lists the available regions of the API. */
114
- static readonly LOCALITIES: ScwRegion[];
113
+ /**
114
+ * Locality of this API.
115
+ * type ∈ {'zone','region','global','unspecified'}
116
+ */
117
+ static readonly LOCALITY: ApiLocality;
115
118
  /**
116
119
  * Get the Cockpit configuration.
117
120
  *
@@ -120,10 +123,7 @@ export declare class RegionalAPI extends ParentAPI {
120
123
  */
121
124
  getConfig: (request?: Readonly<RegionalApiGetConfigRequest>) => Promise<GetConfigResponse>;
122
125
  /**
123
- * Create a data source. You must specify the data source type upon creation. Available data source types include:
124
- - metrics
125
- - logs
126
- - traces
126
+ * Create a data source. You must specify the data source name and type (metrics, logs, traces) upon creation.
127
127
  The name of the data source will then be used as reference to name the associated Grafana data source.
128
128
  *
129
129
  * @param request - The request {@link RegionalApiCreateDataSourceRequest}
@@ -138,7 +138,7 @@ export declare class RegionalAPI extends ParentAPI {
138
138
  */
139
139
  getDataSource: (request: Readonly<RegionalApiGetDataSourceRequest>) => Promise<DataSource>;
140
140
  /**
141
- * Delete a data source. Delete a given data source, specified by the data source ID. Note that deleting a data source is irreversible, and cannot be undone.
141
+ * 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.
142
142
  *
143
143
  * @param request - The request {@link RegionalApiDeleteDataSourceRequest}
144
144
  */
@@ -146,7 +146,6 @@ export declare class RegionalAPI extends ParentAPI {
146
146
  protected pageOfListDataSources: (request?: Readonly<RegionalApiListDataSourcesRequest>) => Promise<ListDataSourcesResponse>;
147
147
  /**
148
148
  * 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.
149
- You can list data sources by Project, type and origin.
150
149
  *
151
150
  * @param request - The request {@link RegionalApiListDataSourcesRequest}
152
151
  * @returns A Promise of ListDataSourcesResponse
@@ -156,14 +155,14 @@ export declare class RegionalAPI extends ParentAPI {
156
155
  [Symbol.asyncIterator]: () => AsyncGenerator<DataSource[], void, void>;
157
156
  };
158
157
  /**
159
- * Update a data source. Update a given data source name, specified by the data source ID.
158
+ * Update a data source. Update a given data source attributes (name and/or retention_days).
160
159
  *
161
160
  * @param request - The request {@link RegionalApiUpdateDataSourceRequest}
162
161
  * @returns A Promise of DataSource
163
162
  */
164
163
  updateDataSource: (request: Readonly<RegionalApiUpdateDataSourceRequest>) => Promise<DataSource>;
165
164
  /**
166
- * Get data source usage overview. Retrieve the data source usage overview per type for the specified Project.
165
+ * Get data source usage overview. Retrieve the volume of data ingested for each of your data sources in the specified project and region.
167
166
  *
168
167
  * @param request - The request {@link RegionalApiGetUsageOverviewRequest}
169
168
  * @returns A Promise of UsageOverview
@@ -1,5 +1,5 @@
1
- import { API, urlParams, enrichForPagination, validatePathParam } from "@scaleway/sdk-client";
2
- import { unmarshalGrafana, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalGlobalApiCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalGlobalApiResetGrafanaUserPasswordRequest, unmarshalListGrafanaProductDashboardsResponse, unmarshalGrafanaProductDashboard, unmarshalListPlansResponse, marshalGlobalApiSelectPlanRequest, unmarshalPlan, unmarshalGetConfigResponse, marshalRegionalApiCreateDataSourceRequest, unmarshalDataSource, unmarshalListDataSourcesResponse, marshalRegionalApiUpdateDataSourceRequest, unmarshalUsageOverview, marshalRegionalApiCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, unmarshalAlertManager, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiDisableAlertManagerRequest, marshalRegionalApiCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalRegionalApiUpdateContactPointRequest, marshalRegionalApiDeleteContactPointRequest, unmarshalListAlertsResponse, marshalRegionalApiEnableManagedAlertsRequest, marshalRegionalApiDisableManagedAlertsRequest, marshalRegionalApiEnableAlertRulesRequest, unmarshalEnableAlertRulesResponse, marshalRegionalApiDisableAlertRulesRequest, unmarshalDisableAlertRulesResponse, marshalRegionalApiTriggerTestAlertRequest } from "./marshalling.gen.js";
1
+ import { API, toApiLocality, validatePathParam, urlParams, enrichForPagination } from "@scaleway/sdk-client";
2
+ import { unmarshalGetConfigResponse, marshalRegionalApiCreateDataSourceRequest, unmarshalDataSource, unmarshalListDataSourcesResponse, marshalRegionalApiUpdateDataSourceRequest, unmarshalUsageOverview, marshalRegionalApiCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, unmarshalAlertManager, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiDisableAlertManagerRequest, 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
3
  const jsonContentHeaders = {
4
4
  "Content-Type": "application/json; charset=utf-8"
5
5
  };
@@ -230,12 +230,13 @@ class GlobalAPI extends API {
230
230
  );
231
231
  }
232
232
  class RegionalAPI extends API {
233
- /** Lists the available regions of the API. */
234
- static LOCALITIES = [
235
- "fr-par",
236
- "nl-ams",
237
- "pl-waw"
238
- ];
233
+ /**
234
+ * Locality of this API.
235
+ * type ∈ {'zone','region','global','unspecified'}
236
+ */
237
+ static LOCALITY = toApiLocality({
238
+ regions: ["fr-par", "nl-ams", "pl-waw"]
239
+ });
239
240
  /**
240
241
  * Get the Cockpit configuration.
241
242
  *
@@ -250,10 +251,7 @@ class RegionalAPI extends API {
250
251
  unmarshalGetConfigResponse
251
252
  );
252
253
  /**
253
- * Create a data source. You must specify the data source type upon creation. Available data source types include:
254
- - metrics
255
- - logs
256
- - traces
254
+ * Create a data source. You must specify the data source name and type (metrics, logs, traces) upon creation.
257
255
  The name of the data source will then be used as reference to name the associated Grafana data source.
258
256
  *
259
257
  * @param request - The request {@link RegionalApiCreateDataSourceRequest}
@@ -287,7 +285,7 @@ class RegionalAPI extends API {
287
285
  unmarshalDataSource
288
286
  );
289
287
  /**
290
- * Delete a data source. Delete a given data source, specified by the data source ID. Note that deleting a data source is irreversible, and cannot be undone.
288
+ * 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
289
  *
292
290
  * @param request - The request {@link RegionalApiDeleteDataSourceRequest}
293
291
  */
@@ -317,15 +315,14 @@ class RegionalAPI extends API {
317
315
  unmarshalListDataSourcesResponse
318
316
  );
319
317
  /**
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
- You can list data sources by Project, type and origin.
322
- *
323
- * @param request - The request {@link RegionalApiListDataSourcesRequest}
324
- * @returns A Promise of ListDataSourcesResponse
325
- */
318
+ * 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.
319
+ *
320
+ * @param request - The request {@link RegionalApiListDataSourcesRequest}
321
+ * @returns A Promise of ListDataSourcesResponse
322
+ */
326
323
  listDataSources = (request = {}) => enrichForPagination("dataSources", this.pageOfListDataSources, request);
327
324
  /**
328
- * Update a data source. Update a given data source name, specified by the data source ID.
325
+ * Update a data source. Update a given data source attributes (name and/or retention_days).
329
326
  *
330
327
  * @param request - The request {@link RegionalApiUpdateDataSourceRequest}
331
328
  * @returns A Promise of DataSource
@@ -345,7 +342,7 @@ class RegionalAPI extends API {
345
342
  unmarshalDataSource
346
343
  );
347
344
  /**
348
- * Get data source usage overview. Retrieve the data source usage overview per type for the specified Project.
345
+ * Get data source usage overview. Retrieve the volume of data ingested for each of your data sources in the specified project and region.
349
346
  *
350
347
  * @param request - The request {@link RegionalApiGetUsageOverviewRequest}
351
348
  * @returns A Promise of UsageOverview
@@ -148,7 +148,7 @@ export interface DataSource {
148
148
  */
149
149
  synchronizedWithGrafana: boolean;
150
150
  /**
151
- * BETA - Duration for which the data will be retained in the data source.
151
+ * Duration for which the data will be retained in the data source.
152
152
  */
153
153
  retentionDays: number;
154
154
  /**
@@ -334,10 +334,22 @@ export interface AlertManager {
334
334
  */
335
335
  region: ScwRegion;
336
336
  }
337
+ /**
338
+ * Output returned when alert rules are disabled.
339
+ */
337
340
  export interface DisableAlertRulesResponse {
341
+ /**
342
+ * Only newly disabled rules are listed. Rules that were already disabled are not returned in the output.
343
+ */
338
344
  disabledRuleIds: string[];
339
345
  }
346
+ /**
347
+ * Output returned when alert rules are enabled.
348
+ */
340
349
  export interface EnableAlertRulesResponse {
350
+ /**
351
+ * Only newly enabled rules are listed. Rules that were already enabled are not returned in the output.
352
+ */
341
353
  enabledRuleIds: string[];
342
354
  }
343
355
  /**
@@ -669,7 +681,7 @@ export type RegionalApiCreateDataSourceRequest = {
669
681
  */
670
682
  type?: DataSourceType;
671
683
  /**
672
- * Default values are 30 days for metrics, 7 days for logs and traces.
684
+ * Default values are 31 days for metrics, 7 days for logs and traces.
673
685
  */
674
686
  retentionDays?: number;
675
687
  };
@@ -757,7 +769,13 @@ export type RegionalApiDisableAlertRulesRequest = {
757
769
  * Region to target. If none is passed will use default region from the config.
758
770
  */
759
771
  region?: ScwRegion;
772
+ /**
773
+ * ID of the Project.
774
+ */
760
775
  projectId?: string;
776
+ /**
777
+ * List of IDs of the rules to enable. If empty, disables all preconfigured rules.
778
+ */
761
779
  ruleIds?: string[];
762
780
  };
763
781
  /**
@@ -791,7 +809,13 @@ export type RegionalApiEnableAlertRulesRequest = {
791
809
  * Region to target. If none is passed will use default region from the config.
792
810
  */
793
811
  region?: ScwRegion;
812
+ /**
813
+ * ID of the Project.
814
+ */
794
815
  projectId?: string;
816
+ /**
817
+ * List of IDs of the rules to enable. If empty, enables all preconfigured rules.
818
+ */
795
819
  ruleIds?: string[];
796
820
  };
797
821
  /**
@@ -938,11 +962,11 @@ export type RegionalApiListDataSourcesRequest = {
938
962
  */
939
963
  projectId?: string;
940
964
  /**
941
- * Origin to filter for, only data sources with matching origin will be returned.
965
+ * Origin to filter for, only data sources with matching origin will be returned. If omitted, all types will be returned.
942
966
  */
943
967
  origin?: DataSourceOrigin;
944
968
  /**
945
- * Types to filter for, only data sources with matching types will be returned.
969
+ * Types to filter for (metrics, logs, traces), only data sources with matching types will be returned. If omitted, all types will be returned.
946
970
  */
947
971
  types?: DataSourceType[];
948
972
  };
@@ -1028,7 +1052,7 @@ export type RegionalApiUpdateDataSourceRequest = {
1028
1052
  */
1029
1053
  name?: string;
1030
1054
  /**
1031
- * BETA - Duration for which the data will be retained in the data source.
1055
+ * Duration for which the data will be retained in the data source.
1032
1056
  */
1033
1057
  retentionDays?: number;
1034
1058
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-cockpit",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Scaleway SDK cockpit",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@scaleway/random-name": "5.1.1",
33
- "@scaleway/sdk-std": "1.0.4"
33
+ "@scaleway/sdk-std": "1.0.5"
34
34
  },
35
35
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.2.3"
36
+ "@scaleway/sdk-client": "^1.3.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.2.3"
39
+ "@scaleway/sdk-client": "^1.3.0"
40
40
  },
41
41
  "scripts": {
42
42
  "package:check": "pnpm publint",