@scaleway/sdk-cockpit 1.7.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -0
- package/dist/v1/api.gen.d.ts +45 -10
- package/dist/v1/api.gen.js +88 -16
- package/dist/v1/index.gen.d.ts +1 -1
- package/dist/v1/index.gen.js +4 -1
- package/dist/v1/marshalling.gen.d.ts +4 -1
- package/dist/v1/marshalling.gen.js +34 -0
- package/dist/v1/types.gen.d.ts +63 -1
- package/dist/v1/validation-rules.gen.d.ts +10 -0
- package/dist/v1/validation-rules.gen.js +11 -0
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -4
- package/dist/v1/api.gen.cjs +0 -667
- package/dist/v1/index.gen.cjs +0 -43
- package/dist/v1/marshalling.gen.cjs +0 -468
- package/dist/v1/validation-rules.gen.cjs +0 -67
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-cockpit
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-cockpit)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-cockpit)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for Cockpit API.
|
|
8
|
+
|
|
9
|
+
> **Note**
|
|
10
|
+
> This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @scaleway/sdk-cockpit @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-cockpit @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-cockpit @scaleway/sdk-client
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Getting Started
|
|
31
|
+
|
|
32
|
+
You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
|
|
33
|
+
|
|
34
|
+
### Basic Usage
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
38
|
+
import { Cockpit } from '@scaleway/sdk-cockpit'
|
|
39
|
+
|
|
40
|
+
const client = createClient({
|
|
41
|
+
accessKey: 'SCWXXXXXXXXXXXXXXXXX',
|
|
42
|
+
secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
43
|
+
defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
44
|
+
defaultRegion: 'fr-par',
|
|
45
|
+
defaultZone: 'fr-par-1',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const api = new Cockpit.v1.API(client)
|
|
49
|
+
|
|
50
|
+
// Use the API
|
|
51
|
+
// Example: await api.listServers()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Using Configuration Loader
|
|
55
|
+
|
|
56
|
+
For a simpler setup, you can load credentials from the configuration file or environment variables:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
60
|
+
import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
|
|
61
|
+
import { Cockpit } from '@scaleway/sdk-cockpit'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new Cockpit.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- 🌐 [Scaleway Cockpit API Documentation](https://www.scaleway.com/en/developers/api/cockpit/)
|
|
72
|
+
- 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
|
|
73
|
+
- 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- ✅ Full TypeScript support with complete type definitions
|
|
78
|
+
- ✅ Promise-based API
|
|
79
|
+
- ✅ Automatic pagination helpers
|
|
80
|
+
- ✅ Built-in error handling
|
|
81
|
+
- ✅ Compatible with Node.js ≥ 20
|
|
82
|
+
|
|
83
|
+
## Support
|
|
84
|
+
|
|
85
|
+
We love feedback! Feel free to reach us on:
|
|
86
|
+
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
|
+
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
+
|
package/dist/v1/api.gen.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
1
|
import type { ApiLocality } from '@scaleway/sdk-client';
|
|
3
|
-
import
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
|
+
import type { AlertManager, ContactPoint, DataSource, DisableAlertRulesResponse, EnableAlertRulesResponse, GetConfigResponse, GetRulesCountResponse, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, ListAlertsResponse, ListContactPointsResponse, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, ListProductsResponse, ListTokensResponse, Plan, 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, Token, UsageOverview } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Cockpit Global API.
|
|
6
6
|
|
|
@@ -22,17 +22,21 @@ export declare class GlobalAPI extends ParentAPI {
|
|
|
22
22
|
*/
|
|
23
23
|
syncGrafanaDataSources: (request?: Readonly<GlobalApiSyncGrafanaDataSourcesRequest>) => Promise<void>;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* (Deprecated) EOL 2026-01-20. Create a Grafana user
|
|
26
|
+
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.
|
|
26
27
|
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.
|
|
27
28
|
*
|
|
29
|
+
* @deprecated
|
|
28
30
|
* @param request - The request {@link GlobalApiCreateGrafanaUserRequest}
|
|
29
31
|
* @returns A Promise of GrafanaUser
|
|
30
32
|
*/
|
|
31
33
|
createGrafanaUser: (request: Readonly<GlobalApiCreateGrafanaUserRequest>) => Promise<GrafanaUser>;
|
|
32
34
|
protected pageOfListGrafanaUsers: (request?: Readonly<GlobalApiListGrafanaUsersRequest>) => Promise<ListGrafanaUsersResponse>;
|
|
33
35
|
/**
|
|
34
|
-
*
|
|
36
|
+
* (Deprecated) EOL 2026-01-20. List Grafana users
|
|
37
|
+
List all Grafana users created in your Cockpit's Grafana. By default, the Grafana users returned in the list are ordered in ascending order.
|
|
35
38
|
*
|
|
39
|
+
* @deprecated
|
|
36
40
|
* @param request - The request {@link GlobalApiListGrafanaUsersRequest}
|
|
37
41
|
* @returns A Promise of ListGrafanaUsersResponse
|
|
38
42
|
*/
|
|
@@ -41,15 +45,19 @@ export declare class GlobalAPI extends ParentAPI {
|
|
|
41
45
|
[Symbol.asyncIterator]: () => AsyncGenerator<GrafanaUser[], void, void>;
|
|
42
46
|
};
|
|
43
47
|
/**
|
|
44
|
-
*
|
|
48
|
+
* (Deprecated) EOL 2026-01-20. Delete a Grafana user
|
|
49
|
+
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.
|
|
45
50
|
*
|
|
51
|
+
* @deprecated
|
|
46
52
|
* @param request - The request {@link GlobalApiDeleteGrafanaUserRequest}
|
|
47
53
|
*/
|
|
48
54
|
deleteGrafanaUser: (request: Readonly<GlobalApiDeleteGrafanaUserRequest>) => Promise<void>;
|
|
49
55
|
/**
|
|
50
|
-
*
|
|
56
|
+
* (Deprecated) EOL 2026-01-20. Reset a Grafana user password
|
|
57
|
+
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.
|
|
51
58
|
A new password regenerates and only displays once. Make sure that you save it.
|
|
52
59
|
*
|
|
60
|
+
* @deprecated
|
|
53
61
|
* @param request - The request {@link GlobalApiResetGrafanaUserPasswordRequest}
|
|
54
62
|
* @returns A Promise of GrafanaUser
|
|
55
63
|
*/
|
|
@@ -75,7 +83,7 @@ export declare class GlobalAPI extends ParentAPI {
|
|
|
75
83
|
protected pageOfListPlans: (request?: Readonly<GlobalApiListPlansRequest>) => Promise<ListPlansResponse>;
|
|
76
84
|
/**
|
|
77
85
|
* List plan types. Retrieve a list of available pricing plan types.
|
|
78
|
-
Deprecated
|
|
86
|
+
Deprecated due to retention now being managed at the data source level.
|
|
79
87
|
*
|
|
80
88
|
* @deprecated
|
|
81
89
|
* @param request - The request {@link GlobalApiListPlansRequest}
|
|
@@ -87,7 +95,7 @@ export declare class GlobalAPI extends ParentAPI {
|
|
|
87
95
|
};
|
|
88
96
|
/**
|
|
89
97
|
* 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.
|
|
90
|
-
Deprecated
|
|
98
|
+
Deprecated due to retention now being managed at the data source level.
|
|
91
99
|
*
|
|
92
100
|
* @deprecated
|
|
93
101
|
* @param request - The request {@link GlobalApiSelectPlanRequest}
|
|
@@ -96,7 +104,7 @@ export declare class GlobalAPI extends ParentAPI {
|
|
|
96
104
|
selectPlan: (request?: Readonly<GlobalApiSelectPlanRequest>) => Promise<Plan>;
|
|
97
105
|
/**
|
|
98
106
|
* Get current plan. Retrieve a pricing plan for the given Project, specified by the ID of the Project.
|
|
99
|
-
Deprecated
|
|
107
|
+
Deprecated due to retention now being managed at the data source level.
|
|
100
108
|
*
|
|
101
109
|
* @deprecated
|
|
102
110
|
* @param request - The request {@link GlobalApiGetCurrentPlanRequest}
|
|
@@ -201,6 +209,17 @@ export declare class RegionalAPI extends ParentAPI {
|
|
|
201
209
|
* @param request - The request {@link RegionalApiDeleteTokenRequest}
|
|
202
210
|
*/
|
|
203
211
|
deleteToken: (request: Readonly<RegionalApiDeleteTokenRequest>) => Promise<void>;
|
|
212
|
+
protected pageOfListProducts: (request?: Readonly<RegionalApiListProductsRequest>) => Promise<ListProductsResponse>;
|
|
213
|
+
/**
|
|
214
|
+
* List all Scaleway products that send metrics and/or logs to Cockpit.. List all Scaleway products that send metrics and/or logs to Cockpit.
|
|
215
|
+
*
|
|
216
|
+
* @param request - The request {@link RegionalApiListProductsRequest}
|
|
217
|
+
* @returns A Promise of ListProductsResponse
|
|
218
|
+
*/
|
|
219
|
+
listProducts: (request?: Readonly<RegionalApiListProductsRequest>) => Promise<ListProductsResponse> & {
|
|
220
|
+
all: () => Promise<import("./types.gen.js").Product[]>;
|
|
221
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").Product[], void, void>;
|
|
222
|
+
};
|
|
204
223
|
/**
|
|
205
224
|
* Get the Alert manager. Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled.
|
|
206
225
|
The output returned displays a URL to access the Alert manager, and whether the Alert manager and managed alerts are enabled.
|
|
@@ -224,7 +243,7 @@ export declare class RegionalAPI extends ParentAPI {
|
|
|
224
243
|
*/
|
|
225
244
|
disableAlertManager: (request?: Readonly<RegionalApiDisableAlertManagerRequest>) => Promise<AlertManager>;
|
|
226
245
|
/**
|
|
227
|
-
* Get the number of enabled rules
|
|
246
|
+
* 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.
|
|
228
247
|
*
|
|
229
248
|
* @param request - The request {@link RegionalApiGetRulesCountRequest}
|
|
230
249
|
* @returns A Promise of GetRulesCountResponse
|
|
@@ -264,6 +283,22 @@ export declare class RegionalAPI extends ParentAPI {
|
|
|
264
283
|
* @returns A Promise of ListAlertsResponse
|
|
265
284
|
*/
|
|
266
285
|
listAlerts: (request?: Readonly<RegionalApiListAlertsRequest>) => Promise<ListAlertsResponse>;
|
|
286
|
+
/**
|
|
287
|
+
* Enable managed alerts. Enable the sending of managed alerts for the specified Project. Managed alerts are predefined alerts that apply to Scaleway resources integrated with Cockpit by default.
|
|
288
|
+
*
|
|
289
|
+
* @deprecated
|
|
290
|
+
* @param request - The request {@link RegionalApiEnableManagedAlertsRequest}
|
|
291
|
+
* @returns A Promise of AlertManager
|
|
292
|
+
*/
|
|
293
|
+
enableManagedAlerts: (request?: Readonly<RegionalApiEnableManagedAlertsRequest>) => Promise<AlertManager>;
|
|
294
|
+
/**
|
|
295
|
+
* Disable managed alerts. Disable the sending of managed alerts for the specified Project.
|
|
296
|
+
*
|
|
297
|
+
* @deprecated
|
|
298
|
+
* @param request - The request {@link RegionalApiDisableManagedAlertsRequest}
|
|
299
|
+
* @returns A Promise of AlertManager
|
|
300
|
+
*/
|
|
301
|
+
disableManagedAlerts: (request?: Readonly<RegionalApiDisableManagedAlertsRequest>) => Promise<AlertManager>;
|
|
267
302
|
/**
|
|
268
303
|
* Enable preconfigured alert rules. Enable alert rules from the list of available preconfigured rules.
|
|
269
304
|
*
|
package/dist/v1/api.gen.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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, unmarshalGetRulesCountResponse, marshalRegionalApiCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalRegionalApiUpdateContactPointRequest, marshalRegionalApiDeleteContactPointRequest, unmarshalListAlertsResponse, marshalRegionalApiEnableAlertRulesRequest, unmarshalEnableAlertRulesResponse, marshalRegionalApiDisableAlertRulesRequest, unmarshalDisableAlertRulesResponse, marshalRegionalApiTriggerTestAlertRequest, unmarshalGrafana, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalGlobalApiCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalGlobalApiResetGrafanaUserPasswordRequest, unmarshalListGrafanaProductDashboardsResponse, unmarshalGrafanaProductDashboard, unmarshalListPlansResponse, marshalGlobalApiSelectPlanRequest, unmarshalPlan } from "./marshalling.gen.js";
|
|
2
|
+
import { unmarshalGetConfigResponse, 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
3
|
const jsonContentHeaders = {
|
|
4
4
|
"Content-Type": "application/json; charset=utf-8"
|
|
5
5
|
};
|
|
@@ -39,9 +39,11 @@ class GlobalAPI extends API {
|
|
|
39
39
|
path: `/cockpit/v1/grafana/sync-data-sources`
|
|
40
40
|
});
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* (Deprecated) EOL 2026-01-20. Create a Grafana user
|
|
43
|
+
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.
|
|
43
44
|
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.
|
|
44
45
|
*
|
|
46
|
+
* @deprecated
|
|
45
47
|
* @param request - The request {@link GlobalApiCreateGrafanaUserRequest}
|
|
46
48
|
* @returns A Promise of GrafanaUser
|
|
47
49
|
*/
|
|
@@ -79,17 +81,21 @@ class GlobalAPI extends API {
|
|
|
79
81
|
unmarshalListGrafanaUsersResponse
|
|
80
82
|
);
|
|
81
83
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
* (Deprecated) EOL 2026-01-20. List Grafana users
|
|
85
|
+
List all Grafana users created in your Cockpit's Grafana. By default, the Grafana users returned in the list are ordered in ascending order.
|
|
86
|
+
*
|
|
87
|
+
* @deprecated
|
|
88
|
+
* @param request - The request {@link GlobalApiListGrafanaUsersRequest}
|
|
89
|
+
* @returns A Promise of ListGrafanaUsersResponse
|
|
90
|
+
*/
|
|
87
91
|
listGrafanaUsers = (request = {}) => enrichForPagination("grafanaUsers", this.pageOfListGrafanaUsers, request);
|
|
88
92
|
/**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
* (Deprecated) EOL 2026-01-20. Delete a Grafana user
|
|
94
|
+
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.
|
|
95
|
+
*
|
|
96
|
+
* @deprecated
|
|
97
|
+
* @param request - The request {@link GlobalApiDeleteGrafanaUserRequest}
|
|
98
|
+
*/
|
|
93
99
|
deleteGrafanaUser = (request) => this.client.fetch({
|
|
94
100
|
method: "DELETE",
|
|
95
101
|
path: `/cockpit/v1/grafana/users/${validatePathParam("grafanaUserId", request.grafanaUserId)}`,
|
|
@@ -99,9 +105,11 @@ class GlobalAPI extends API {
|
|
|
99
105
|
])
|
|
100
106
|
});
|
|
101
107
|
/**
|
|
102
|
-
*
|
|
108
|
+
* (Deprecated) EOL 2026-01-20. Reset a Grafana user password
|
|
109
|
+
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.
|
|
103
110
|
A new password regenerates and only displays once. Make sure that you save it.
|
|
104
111
|
*
|
|
112
|
+
* @deprecated
|
|
105
113
|
* @param request - The request {@link GlobalApiResetGrafanaUserPasswordRequest}
|
|
106
114
|
* @returns A Promise of GrafanaUser
|
|
107
115
|
*/
|
|
@@ -183,7 +191,7 @@ class GlobalAPI extends API {
|
|
|
183
191
|
);
|
|
184
192
|
/**
|
|
185
193
|
* List plan types. Retrieve a list of available pricing plan types.
|
|
186
|
-
Deprecated
|
|
194
|
+
Deprecated due to retention now being managed at the data source level.
|
|
187
195
|
*
|
|
188
196
|
* @deprecated
|
|
189
197
|
* @param request - The request {@link GlobalApiListPlansRequest}
|
|
@@ -192,7 +200,7 @@ class GlobalAPI extends API {
|
|
|
192
200
|
listPlans = (request = {}) => enrichForPagination("plans", this.pageOfListPlans, request);
|
|
193
201
|
/**
|
|
194
202
|
* 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.
|
|
195
|
-
Deprecated
|
|
203
|
+
Deprecated due to retention now being managed at the data source level.
|
|
196
204
|
*
|
|
197
205
|
* @deprecated
|
|
198
206
|
* @param request - The request {@link GlobalApiSelectPlanRequest}
|
|
@@ -211,7 +219,7 @@ class GlobalAPI extends API {
|
|
|
211
219
|
);
|
|
212
220
|
/**
|
|
213
221
|
* Get current plan. Retrieve a pricing plan for the given Project, specified by the ID of the Project.
|
|
214
|
-
Deprecated
|
|
222
|
+
Deprecated due to retention now being managed at the data source level.
|
|
215
223
|
*
|
|
216
224
|
* @deprecated
|
|
217
225
|
* @param request - The request {@link GlobalApiGetCurrentPlanRequest}
|
|
@@ -429,6 +437,28 @@ class RegionalAPI extends API {
|
|
|
429
437
|
method: "DELETE",
|
|
430
438
|
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam("tokenId", request.tokenId)}`
|
|
431
439
|
});
|
|
440
|
+
pageOfListProducts = (request = {}) => this.client.fetch(
|
|
441
|
+
{
|
|
442
|
+
method: "GET",
|
|
443
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/products`,
|
|
444
|
+
urlParams: urlParams(
|
|
445
|
+
["order_by", request.orderBy],
|
|
446
|
+
["page", request.page],
|
|
447
|
+
[
|
|
448
|
+
"page_size",
|
|
449
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
450
|
+
]
|
|
451
|
+
)
|
|
452
|
+
},
|
|
453
|
+
unmarshalListProductsResponse
|
|
454
|
+
);
|
|
455
|
+
/**
|
|
456
|
+
* List all Scaleway products that send metrics and/or logs to Cockpit.. List all Scaleway products that send metrics and/or logs to Cockpit.
|
|
457
|
+
*
|
|
458
|
+
* @param request - The request {@link RegionalApiListProductsRequest}
|
|
459
|
+
* @returns A Promise of ListProductsResponse
|
|
460
|
+
*/
|
|
461
|
+
listProducts = (request = {}) => enrichForPagination("productsList", this.pageOfListProducts, request);
|
|
432
462
|
/**
|
|
433
463
|
* Get the Alert manager. Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled.
|
|
434
464
|
The output returned displays a URL to access the Alert manager, and whether the Alert manager and managed alerts are enabled.
|
|
@@ -488,7 +518,7 @@ class RegionalAPI extends API {
|
|
|
488
518
|
unmarshalAlertManager
|
|
489
519
|
);
|
|
490
520
|
/**
|
|
491
|
-
* Get the number of enabled rules
|
|
521
|
+
* 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.
|
|
492
522
|
*
|
|
493
523
|
* @param request - The request {@link RegionalApiGetRulesCountRequest}
|
|
494
524
|
* @returns A Promise of GetRulesCountResponse
|
|
@@ -604,6 +634,48 @@ class RegionalAPI extends API {
|
|
|
604
634
|
},
|
|
605
635
|
unmarshalListAlertsResponse
|
|
606
636
|
);
|
|
637
|
+
/**
|
|
638
|
+
* Enable managed alerts. Enable the sending of managed alerts for the specified Project. Managed alerts are predefined alerts that apply to Scaleway resources integrated with Cockpit by default.
|
|
639
|
+
*
|
|
640
|
+
* @deprecated
|
|
641
|
+
* @param request - The request {@link RegionalApiEnableManagedAlertsRequest}
|
|
642
|
+
* @returns A Promise of AlertManager
|
|
643
|
+
*/
|
|
644
|
+
enableManagedAlerts = (request = {}) => this.client.fetch(
|
|
645
|
+
{
|
|
646
|
+
body: JSON.stringify(
|
|
647
|
+
marshalRegionalApiEnableManagedAlertsRequest(
|
|
648
|
+
request,
|
|
649
|
+
this.client.settings
|
|
650
|
+
)
|
|
651
|
+
),
|
|
652
|
+
headers: jsonContentHeaders,
|
|
653
|
+
method: "POST",
|
|
654
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/managed-alerts/enable`
|
|
655
|
+
},
|
|
656
|
+
unmarshalAlertManager
|
|
657
|
+
);
|
|
658
|
+
/**
|
|
659
|
+
* Disable managed alerts. Disable the sending of managed alerts for the specified Project.
|
|
660
|
+
*
|
|
661
|
+
* @deprecated
|
|
662
|
+
* @param request - The request {@link RegionalApiDisableManagedAlertsRequest}
|
|
663
|
+
* @returns A Promise of AlertManager
|
|
664
|
+
*/
|
|
665
|
+
disableManagedAlerts = (request = {}) => this.client.fetch(
|
|
666
|
+
{
|
|
667
|
+
body: JSON.stringify(
|
|
668
|
+
marshalRegionalApiDisableManagedAlertsRequest(
|
|
669
|
+
request,
|
|
670
|
+
this.client.settings
|
|
671
|
+
)
|
|
672
|
+
),
|
|
673
|
+
headers: jsonContentHeaders,
|
|
674
|
+
method: "POST",
|
|
675
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/managed-alerts/disable`
|
|
676
|
+
},
|
|
677
|
+
unmarshalAlertManager
|
|
678
|
+
);
|
|
607
679
|
/**
|
|
608
680
|
* Enable preconfigured alert rules. Enable alert rules from the list of available preconfigured rules.
|
|
609
681
|
*
|
package/dist/v1/index.gen.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { GlobalAPI, RegionalAPI, } from './api.gen.js';
|
|
2
2
|
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, ListTokensRequestOrderBy, ListTokensResponse, Plan, PlanName, PreconfiguredAlertData, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableAlertRulesRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableAlertRulesRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetConfigRequest, RegionalApiGetDataSourceRequest, RegionalApiGetRulesCountRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListAlertsRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateContactPointRequest, RegionalApiUpdateDataSourceRequest, RulesCount, Token, TokenScope, Usage, UsageOverview, UsageUnit, } from './types.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
4
|
export * as ValidationRules from './validation-rules.gen.js';
|
package/dist/v1/index.gen.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GlobalAPI, RegionalAPI } from "./api.gen.js";
|
|
2
|
-
import { marshalGlobalApiCreateGrafanaUserRequest, marshalGlobalApiResetGrafanaUserPasswordRequest, marshalGlobalApiSelectPlanRequest, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalRegionalApiCreateContactPointRequest, marshalRegionalApiCreateDataSourceRequest, marshalRegionalApiCreateTokenRequest, marshalRegionalApiDeleteContactPointRequest, marshalRegionalApiDisableAlertManagerRequest, marshalRegionalApiDisableAlertRulesRequest, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiEnableAlertRulesRequest, marshalRegionalApiTriggerTestAlertRequest, marshalRegionalApiUpdateContactPointRequest, marshalRegionalApiUpdateDataSourceRequest, unmarshalAlertManager, unmarshalContactPoint, unmarshalDataSource, unmarshalDisableAlertRulesResponse, unmarshalEnableAlertRulesResponse, unmarshalGetConfigResponse, unmarshalGetRulesCountResponse, unmarshalGrafana, unmarshalGrafanaProductDashboard, unmarshalGrafanaUser, unmarshalListAlertsResponse, unmarshalListContactPointsResponse, unmarshalListDataSourcesResponse, unmarshalListGrafanaProductDashboardsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListTokensResponse, unmarshalPlan, unmarshalToken, unmarshalUsageOverview } from "./marshalling.gen.js";
|
|
2
|
+
import { marshalGlobalApiCreateGrafanaUserRequest, marshalGlobalApiResetGrafanaUserPasswordRequest, marshalGlobalApiSelectPlanRequest, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalRegionalApiCreateContactPointRequest, marshalRegionalApiCreateDataSourceRequest, marshalRegionalApiCreateTokenRequest, marshalRegionalApiDeleteContactPointRequest, marshalRegionalApiDisableAlertManagerRequest, marshalRegionalApiDisableAlertRulesRequest, marshalRegionalApiDisableManagedAlertsRequest, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiEnableAlertRulesRequest, marshalRegionalApiEnableManagedAlertsRequest, marshalRegionalApiTriggerTestAlertRequest, marshalRegionalApiUpdateContactPointRequest, marshalRegionalApiUpdateDataSourceRequest, unmarshalAlertManager, unmarshalContactPoint, unmarshalDataSource, unmarshalDisableAlertRulesResponse, unmarshalEnableAlertRulesResponse, unmarshalGetConfigResponse, unmarshalGetRulesCountResponse, unmarshalGrafana, unmarshalGrafanaProductDashboard, unmarshalGrafanaUser, unmarshalListAlertsResponse, unmarshalListContactPointsResponse, unmarshalListDataSourcesResponse, unmarshalListGrafanaProductDashboardsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListProductsResponse, unmarshalListTokensResponse, unmarshalPlan, unmarshalToken, unmarshalUsageOverview } from "./marshalling.gen.js";
|
|
3
3
|
import * as validationRules_gen from "./validation-rules.gen.js";
|
|
4
4
|
export {
|
|
5
5
|
GlobalAPI,
|
|
@@ -15,8 +15,10 @@ export {
|
|
|
15
15
|
marshalRegionalApiDeleteContactPointRequest,
|
|
16
16
|
marshalRegionalApiDisableAlertManagerRequest,
|
|
17
17
|
marshalRegionalApiDisableAlertRulesRequest,
|
|
18
|
+
marshalRegionalApiDisableManagedAlertsRequest,
|
|
18
19
|
marshalRegionalApiEnableAlertManagerRequest,
|
|
19
20
|
marshalRegionalApiEnableAlertRulesRequest,
|
|
21
|
+
marshalRegionalApiEnableManagedAlertsRequest,
|
|
20
22
|
marshalRegionalApiTriggerTestAlertRequest,
|
|
21
23
|
marshalRegionalApiUpdateContactPointRequest,
|
|
22
24
|
marshalRegionalApiUpdateDataSourceRequest,
|
|
@@ -36,6 +38,7 @@ export {
|
|
|
36
38
|
unmarshalListGrafanaProductDashboardsResponse,
|
|
37
39
|
unmarshalListGrafanaUsersResponse,
|
|
38
40
|
unmarshalListPlansResponse,
|
|
41
|
+
unmarshalListProductsResponse,
|
|
39
42
|
unmarshalListTokensResponse,
|
|
40
43
|
unmarshalPlan,
|
|
41
44
|
unmarshalToken,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { AlertManager, ContactPoint, DataSource, DisableAlertRulesResponse, EnableAlertRulesResponse, GetConfigResponse, GetRulesCountResponse, GlobalApiCreateGrafanaUserRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, ListAlertsResponse, ListContactPointsResponse, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, ListTokensResponse, Plan, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableAlertRulesRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableAlertRulesRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateContactPointRequest, RegionalApiUpdateDataSourceRequest, Token, UsageOverview } from './types.gen.js';
|
|
2
|
+
import type { AlertManager, ContactPoint, DataSource, DisableAlertRulesResponse, EnableAlertRulesResponse, GetConfigResponse, GetRulesCountResponse, GlobalApiCreateGrafanaUserRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, ListAlertsResponse, ListContactPointsResponse, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, ListProductsResponse, ListTokensResponse, Plan, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableAlertRulesRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableAlertRulesRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateContactPointRequest, RegionalApiUpdateDataSourceRequest, Token, UsageOverview } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalContactPoint: (data: unknown) => ContactPoint;
|
|
4
4
|
export declare const unmarshalDataSource: (data: unknown) => DataSource;
|
|
5
5
|
export declare const unmarshalGrafanaProductDashboard: (data: unknown) => GrafanaProductDashboard;
|
|
@@ -18,6 +18,7 @@ export declare const unmarshalListDataSourcesResponse: (data: unknown) => ListDa
|
|
|
18
18
|
export declare const unmarshalListGrafanaProductDashboardsResponse: (data: unknown) => ListGrafanaProductDashboardsResponse;
|
|
19
19
|
export declare const unmarshalListGrafanaUsersResponse: (data: unknown) => ListGrafanaUsersResponse;
|
|
20
20
|
export declare const unmarshalListPlansResponse: (data: unknown) => ListPlansResponse;
|
|
21
|
+
export declare const unmarshalListProductsResponse: (data: unknown) => ListProductsResponse;
|
|
21
22
|
export declare const unmarshalListTokensResponse: (data: unknown) => ListTokensResponse;
|
|
22
23
|
export declare const unmarshalUsageOverview: (data: unknown) => UsageOverview;
|
|
23
24
|
export declare const marshalGlobalApiCreateGrafanaUserRequest: (request: GlobalApiCreateGrafanaUserRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -30,8 +31,10 @@ export declare const marshalRegionalApiCreateTokenRequest: (request: RegionalApi
|
|
|
30
31
|
export declare const marshalRegionalApiDeleteContactPointRequest: (request: RegionalApiDeleteContactPointRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
31
32
|
export declare const marshalRegionalApiDisableAlertManagerRequest: (request: RegionalApiDisableAlertManagerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
32
33
|
export declare const marshalRegionalApiDisableAlertRulesRequest: (request: RegionalApiDisableAlertRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
34
|
+
export declare const marshalRegionalApiDisableManagedAlertsRequest: (request: RegionalApiDisableManagedAlertsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
33
35
|
export declare const marshalRegionalApiEnableAlertManagerRequest: (request: RegionalApiEnableAlertManagerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
34
36
|
export declare const marshalRegionalApiEnableAlertRulesRequest: (request: RegionalApiEnableAlertRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
37
|
+
export declare const marshalRegionalApiEnableManagedAlertsRequest: (request: RegionalApiEnableManagedAlertsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
35
38
|
export declare const marshalRegionalApiTriggerTestAlertRequest: (request: RegionalApiTriggerTestAlertRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
36
39
|
export declare const marshalRegionalApiUpdateContactPointRequest: (request: RegionalApiUpdateContactPointRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
37
40
|
export declare const marshalRegionalApiUpdateDataSourceRequest: (request: RegionalApiUpdateDataSourceRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -29,6 +29,7 @@ const unmarshalDataSource = (data) => {
|
|
|
29
29
|
}
|
|
30
30
|
return {
|
|
31
31
|
createdAt: unmarshalDate(data.created_at),
|
|
32
|
+
currentMonthUsage: data.current_month_usage,
|
|
32
33
|
id: data.id,
|
|
33
34
|
name: data.name,
|
|
34
35
|
origin: data.origin,
|
|
@@ -308,6 +309,30 @@ const unmarshalListPlansResponse = (data) => {
|
|
|
308
309
|
totalCount: data.total_count
|
|
309
310
|
};
|
|
310
311
|
};
|
|
312
|
+
const unmarshalProduct = (data) => {
|
|
313
|
+
if (!isJSONObject(data)) {
|
|
314
|
+
throw new TypeError(
|
|
315
|
+
`Unmarshalling the type 'Product' failed as data isn't a dictionary.`
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
return {
|
|
319
|
+
displayName: data.display_name,
|
|
320
|
+
familyName: data.family_name,
|
|
321
|
+
name: data.name,
|
|
322
|
+
resourceTypes: data.resource_types
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
const unmarshalListProductsResponse = (data) => {
|
|
326
|
+
if (!isJSONObject(data)) {
|
|
327
|
+
throw new TypeError(
|
|
328
|
+
`Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary.`
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
return {
|
|
332
|
+
productsList: unmarshalArrayOfObject(data.products_list, unmarshalProduct),
|
|
333
|
+
totalCount: data.total_count
|
|
334
|
+
};
|
|
335
|
+
};
|
|
311
336
|
const unmarshalListTokensResponse = (data) => {
|
|
312
337
|
if (!isJSONObject(data)) {
|
|
313
338
|
throw new TypeError(
|
|
@@ -405,6 +430,9 @@ const marshalRegionalApiDisableAlertRulesRequest = (request, defaults) => ({
|
|
|
405
430
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
406
431
|
rule_ids: request.ruleIds
|
|
407
432
|
});
|
|
433
|
+
const marshalRegionalApiDisableManagedAlertsRequest = (request, defaults) => ({
|
|
434
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
435
|
+
});
|
|
408
436
|
const marshalRegionalApiEnableAlertManagerRequest = (request, defaults) => ({
|
|
409
437
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
410
438
|
});
|
|
@@ -412,6 +440,9 @@ const marshalRegionalApiEnableAlertRulesRequest = (request, defaults) => ({
|
|
|
412
440
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
413
441
|
rule_ids: request.ruleIds
|
|
414
442
|
});
|
|
443
|
+
const marshalRegionalApiEnableManagedAlertsRequest = (request, defaults) => ({
|
|
444
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
445
|
+
});
|
|
415
446
|
const marshalRegionalApiTriggerTestAlertRequest = (request, defaults) => ({
|
|
416
447
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
417
448
|
});
|
|
@@ -440,8 +471,10 @@ export {
|
|
|
440
471
|
marshalRegionalApiDeleteContactPointRequest,
|
|
441
472
|
marshalRegionalApiDisableAlertManagerRequest,
|
|
442
473
|
marshalRegionalApiDisableAlertRulesRequest,
|
|
474
|
+
marshalRegionalApiDisableManagedAlertsRequest,
|
|
443
475
|
marshalRegionalApiEnableAlertManagerRequest,
|
|
444
476
|
marshalRegionalApiEnableAlertRulesRequest,
|
|
477
|
+
marshalRegionalApiEnableManagedAlertsRequest,
|
|
445
478
|
marshalRegionalApiTriggerTestAlertRequest,
|
|
446
479
|
marshalRegionalApiUpdateContactPointRequest,
|
|
447
480
|
marshalRegionalApiUpdateDataSourceRequest,
|
|
@@ -461,6 +494,7 @@ export {
|
|
|
461
494
|
unmarshalListGrafanaProductDashboardsResponse,
|
|
462
495
|
unmarshalListGrafanaUsersResponse,
|
|
463
496
|
unmarshalListPlansResponse,
|
|
497
|
+
unmarshalListProductsResponse,
|
|
464
498
|
unmarshalListTokensResponse,
|
|
465
499
|
unmarshalPlan,
|
|
466
500
|
unmarshalToken,
|