@scaleway/sdk 3.0.0-alpha.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.gen.d.ts +362 -0
- package/dist/index.gen.js +323 -0
- package/package.json +71 -25
- package/README.md +0 -46
- package/dist/api/account/index.js +0 -4
- package/dist/api/account/v2/api.gen.js +0 -147
- package/dist/api/account/v2/index.gen.js +0 -4
- package/dist/api/account/v2/marshalling.gen.js +0 -39
- package/dist/api/account/v3/api.gen.js +0 -129
- package/dist/api/account/v3/index.gen.js +0 -6
- package/dist/api/account/v3/marshalling.gen.js +0 -39
- package/dist/api/account/v3/validation-rules.gen.js +0 -39
- package/dist/api/applesilicon/index.js +0 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
- package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
- package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
- package/dist/api/baremetal/index.js +0 -2
- package/dist/api/baremetal/v1/api.gen.js +0 -523
- package/dist/api/baremetal/v1/api.utils.js +0 -27
- package/dist/api/baremetal/v1/content.gen.js +0 -13
- package/dist/api/baremetal/v1/index.js +0 -5
- package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
- package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
- package/dist/api/billing/index.js +0 -2
- package/dist/api/billing/v2alpha1/api.gen.js +0 -80
- package/dist/api/billing/v2alpha1/index.gen.js +0 -4
- package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
- package/dist/api/block/index.js +0 -2
- package/dist/api/block/v1alpha1/api.gen.js +0 -245
- package/dist/api/block/v1alpha1/content.gen.js +0 -13
- package/dist/api/block/v1alpha1/index.gen.js +0 -7
- package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
- package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
- package/dist/api/cockpit/index.js +0 -2
- package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
- package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
- package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
- package/dist/api/container/index.js +0 -2
- package/dist/api/container/v1beta1/api.gen.js +0 -549
- package/dist/api/container/v1beta1/content.gen.js +0 -22
- package/dist/api/container/v1beta1/index.gen.js +0 -5
- package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
- package/dist/api/document_db/index.js +0 -2
- package/dist/api/document_db/v1beta1/api.gen.js +0 -830
- package/dist/api/document_db/v1beta1/content.gen.js +0 -19
- package/dist/api/document_db/v1beta1/index.gen.js +0 -7
- package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
- package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
- package/dist/api/domain/index.js +0 -2
- package/dist/api/domain/v2beta1/api.gen.js +0 -875
- package/dist/api/domain/v2beta1/content.gen.js +0 -28
- package/dist/api/domain/v2beta1/index.gen.js +0 -7
- package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
- package/dist/api/flexibleip/index.js +0 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
- package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
- package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
- package/dist/api/function/index.js +0 -2
- package/dist/api/function/v1beta1/api.gen.js +0 -560
- package/dist/api/function/v1beta1/content.gen.js +0 -22
- package/dist/api/function/v1beta1/index.gen.js +0 -5
- package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
- package/dist/api/iam/index.js +0 -2
- package/dist/api/iam/v1alpha1/api.gen.js +0 -799
- package/dist/api/iam/v1alpha1/index.gen.js +0 -6
- package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
- package/dist/api/instance/index.js +0 -2
- package/dist/api/instance/v1/api.gen.js +0 -1003
- package/dist/api/instance/v1/api.utils.js +0 -369
- package/dist/api/instance/v1/content.gen.js +0 -31
- package/dist/api/instance/v1/index.js +0 -2
- package/dist/api/instance/v1/marshalling.gen.js +0 -1206
- package/dist/api/instance/v1/marshalling.utils.js +0 -63
- package/dist/api/iot/index.js +0 -2
- package/dist/api/iot/v1/api.gen.js +0 -581
- package/dist/api/iot/v1/content.gen.js +0 -7
- package/dist/api/iot/v1/index.gen.js +0 -5
- package/dist/api/iot/v1/marshalling.gen.js +0 -388
- package/dist/api/ipfs/index.js +0 -2
- package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
- package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
- package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/k8s/index.js +0 -2
- package/dist/api/k8s/v1/api.gen.js +0 -454
- package/dist/api/k8s/v1/api.utils.js +0 -13
- package/dist/api/k8s/v1/content.gen.js +0 -13
- package/dist/api/k8s/v1/index.js +0 -4
- package/dist/api/k8s/v1/marshalling.gen.js +0 -333
- package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
- package/dist/api/lb/index.js +0 -2
- package/dist/api/lb/v1/api.gen.js +0 -1669
- package/dist/api/lb/v1/api.utils.js +0 -81
- package/dist/api/lb/v1/content.gen.js +0 -16
- package/dist/api/lb/v1/index.js +0 -2
- package/dist/api/lb/v1/marshalling.gen.js +0 -923
- package/dist/api/marketplace/index.js +0 -4
- package/dist/api/marketplace/v1/api.gen.js +0 -60
- package/dist/api/marketplace/v1/index.gen.js +0 -4
- package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
- package/dist/api/marketplace/v2/api.gen.js +0 -162
- package/dist/api/marketplace/v2/index.gen.js +0 -4
- package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
- package/dist/api/mnq/index.js +0 -2
- package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
- package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/rdb/index.js +0 -2
- package/dist/api/rdb/v1/api.gen.js +0 -972
- package/dist/api/rdb/v1/content.gen.js +0 -22
- package/dist/api/rdb/v1/index.gen.js +0 -7
- package/dist/api/rdb/v1/marshalling.gen.js +0 -636
- package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
- package/dist/api/redis/index.js +0 -2
- package/dist/api/redis/v1/api.gen.js +0 -389
- package/dist/api/redis/v1/content.gen.js +0 -7
- package/dist/api/redis/v1/index.gen.js +0 -5
- package/dist/api/redis/v1/marshalling.gen.js +0 -259
- package/dist/api/registry/index.js +0 -2
- package/dist/api/registry/v1/api.gen.js +0 -252
- package/dist/api/registry/v1/content.gen.js +0 -13
- package/dist/api/registry/v1/index.gen.js +0 -5
- package/dist/api/registry/v1/marshalling.gen.js +0 -106
- package/dist/api/secret/index.js +0 -2
- package/dist/api/secret/v1alpha1/api.gen.js +0 -415
- package/dist/api/secret/v1alpha1/index.gen.js +0 -4
- package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
- package/dist/api/tem/index.js +0 -2
- package/dist/api/tem/v1alpha1/api.gen.js +0 -229
- package/dist/api/tem/v1alpha1/content.gen.js +0 -10
- package/dist/api/tem/v1alpha1/index.gen.js +0 -5
- package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
- package/dist/api/test/index.js +0 -2
- package/dist/api/test/v1/api.gen.js +0 -152
- package/dist/api/test/v1/content.gen.js +0 -7
- package/dist/api/test/v1/index.gen.js +0 -5
- package/dist/api/test/v1/marshalling.gen.js +0 -79
- package/dist/api/vpc/index.js +0 -4
- package/dist/api/vpc/v1/api.gen.js +0 -110
- package/dist/api/vpc/v1/index.gen.js +0 -4
- package/dist/api/vpc/v1/marshalling.gen.js +0 -44
- package/dist/api/vpc/v2/api.gen.js +0 -276
- package/dist/api/vpc/v2/index.gen.js +0 -4
- package/dist/api/vpc/v2/marshalling.gen.js +0 -135
- package/dist/api/vpcgw/index.js +0 -2
- package/dist/api/vpcgw/v1/api.gen.js +0 -669
- package/dist/api/vpcgw/v1/content.gen.js +0 -10
- package/dist/api/vpcgw/v1/index.gen.js +0 -5
- package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
- package/dist/api/webhosting/index.js +0 -2
- package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
- package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
- package/dist/helpers/is-browser.js +0 -5
- package/dist/helpers/is-response.js +0 -10
- package/dist/helpers/json.js +0 -11
- package/dist/helpers/marshalling.js +0 -130
- package/dist/index.cjs +0 -24364
- package/dist/index.d.ts +0 -27584
- package/dist/index.js +0 -69
- package/dist/internal/async/interval-retrier.js +0 -105
- package/dist/internal/async/sleep.js +0 -13
- package/dist/internal/interceptors/composer.js +0 -46
- package/dist/internal/interceptors/helpers.js +0 -32
- package/dist/internal/logger/console-logger.js +0 -38
- package/dist/internal/logger/index.js +0 -41
- package/dist/internal/logger/level-resolver.js +0 -13
- package/dist/internal/validations/string-validation.js +0 -38
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/dist/scw/api.js +0 -12
- package/dist/scw/auth.js +0 -68
- package/dist/scw/client-ini-factory.js +0 -174
- package/dist/scw/client-ini-profile.js +0 -54
- package/dist/scw/client-settings.js +0 -78
- package/dist/scw/client.js +0 -98
- package/dist/scw/constants.js +0 -4
- package/dist/scw/custom-marshalling.js +0 -131
- package/dist/scw/errors/error-parser.js +0 -107
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
- package/dist/scw/errors/scw-error.js +0 -66
- package/dist/scw/errors/standard/already-exists-error.js +0 -26
- package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
- package/dist/scw/errors/standard/index.js +0 -13
- package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
- package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
- package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
- package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
- package/dist/scw/errors/standard/resource-expired-error.js +0 -26
- package/dist/scw/errors/standard/resource-locked-error.js +0 -25
- package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
- package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
- package/dist/scw/errors/standard/transient-state-error.js +0 -26
- package/dist/scw/errors/types.js +0 -23
- package/dist/scw/fetch/build-fetcher.js +0 -72
- package/dist/scw/fetch/http-dumper.js +0 -54
- package/dist/scw/fetch/http-interceptors.js +0 -99
- package/dist/scw/fetch/resource-paginator.js +0 -84
- package/dist/scw/fetch/response-parser.js +0 -72
- package/node_modules/@scaleway/random-name/.npmignore +0 -4
- package/node_modules/@scaleway/random-name/CHANGELOG.md +0 -129
- package/node_modules/@scaleway/random-name/LICENSE.md +0 -21
- package/node_modules/@scaleway/random-name/README.md +0 -26
- package/node_modules/@scaleway/random-name/dist/index.d.ts +0 -3
- package/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/node_modules/@scaleway/random-name/package.json +0 -23
|
@@ -1,448 +0,0 @@
|
|
|
1
|
-
import { waitForResource } from '../../../internal/async/interval-retrier.js';
|
|
2
|
-
import { API as API$1 } from '../../../scw/api.js';
|
|
3
|
-
import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
|
|
4
|
-
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
|
-
import { COCKPIT_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { marshalActivateCockpitRequest, unmarshalCockpit, unmarshalCockpitMetrics, marshalDeactivateCockpitRequest, marshalResetCockpitGrafanaRequest, marshalCreateDatasourceRequest, unmarshalDatasource, marshalCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, marshalCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalDeleteContactPointRequest, marshalEnableManagedAlertsRequest, marshalDisableManagedAlertsRequest, marshalTriggerTestAlertRequest, marshalCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalDeleteGrafanaUserRequest, marshalResetGrafanaUserPasswordRequest, unmarshalListPlansResponse, marshalSelectPlanRequest, unmarshalSelectPlanResponse } from './marshalling.gen.js';
|
|
7
|
-
|
|
8
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
9
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
10
|
-
const jsonContentHeaders = {
|
|
11
|
-
'Content-Type': 'application/json; charset=utf-8'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Cockpit API.
|
|
16
|
-
*
|
|
17
|
-
* Cockpit's API allows you to activate your Cockpit on your Projects.
|
|
18
|
-
* Scaleway's Cockpit stores metrics and logs and provides a dedicated Grafana
|
|
19
|
-
* for dashboarding to visualize them.
|
|
20
|
-
*/
|
|
21
|
-
class API extends API$1 {
|
|
22
|
-
/**
|
|
23
|
-
* Activate the Cockpit of the specified Project ID.
|
|
24
|
-
*
|
|
25
|
-
* @param request - The request {@link ActivateCockpitRequest}
|
|
26
|
-
* @returns A Promise of Cockpit
|
|
27
|
-
*/
|
|
28
|
-
activateCockpit = (() => {
|
|
29
|
-
var _this = this;
|
|
30
|
-
return function (request) {
|
|
31
|
-
if (request === void 0) {
|
|
32
|
-
request = {};
|
|
33
|
-
}
|
|
34
|
-
return _this.client.fetch({
|
|
35
|
-
body: JSON.stringify(marshalActivateCockpitRequest(request, _this.client.settings)),
|
|
36
|
-
headers: jsonContentHeaders,
|
|
37
|
-
method: 'POST',
|
|
38
|
-
path: `/cockpit/v1beta1/activate`
|
|
39
|
-
}, unmarshalCockpit);
|
|
40
|
-
};
|
|
41
|
-
})();
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Retrieve the Cockpit of the specified Project ID.
|
|
45
|
-
*
|
|
46
|
-
* @param request - The request {@link GetCockpitRequest}
|
|
47
|
-
* @returns A Promise of Cockpit
|
|
48
|
-
*/
|
|
49
|
-
getCockpit = (() => {
|
|
50
|
-
var _this2 = this;
|
|
51
|
-
return function (request) {
|
|
52
|
-
if (request === void 0) {
|
|
53
|
-
request = {};
|
|
54
|
-
}
|
|
55
|
-
return _this2.client.fetch({
|
|
56
|
-
method: 'GET',
|
|
57
|
-
path: `/cockpit/v1beta1/cockpit`,
|
|
58
|
-
urlParams: urlParams(['project_id', request.projectId ?? _this2.client.settings.defaultProjectId])
|
|
59
|
-
}, unmarshalCockpit);
|
|
60
|
-
};
|
|
61
|
-
})();
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Waits for {@link Cockpit} to be in a final state.
|
|
65
|
-
*
|
|
66
|
-
* @param request - The request {@link GetCockpitRequest}
|
|
67
|
-
* @param options - The waiting options
|
|
68
|
-
* @returns A Promise of Cockpit
|
|
69
|
-
*/
|
|
70
|
-
waitForCockpit = (() => {
|
|
71
|
-
var _this3 = this;
|
|
72
|
-
return function (request, options) {
|
|
73
|
-
if (request === void 0) {
|
|
74
|
-
request = {};
|
|
75
|
-
}
|
|
76
|
-
return waitForResource(options?.stop ?? (res => Promise.resolve(!COCKPIT_TRANSIENT_STATUSES.includes(res.status))), _this3.getCockpit, request, options);
|
|
77
|
-
};
|
|
78
|
-
})();
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Get metrics from your Cockpit with the specified Project ID.
|
|
82
|
-
*
|
|
83
|
-
* @param request - The request {@link GetCockpitMetricsRequest}
|
|
84
|
-
* @returns A Promise of CockpitMetrics
|
|
85
|
-
*/
|
|
86
|
-
getCockpitMetrics = (() => {
|
|
87
|
-
var _this4 = this;
|
|
88
|
-
return function (request) {
|
|
89
|
-
if (request === void 0) {
|
|
90
|
-
request = {};
|
|
91
|
-
}
|
|
92
|
-
return _this4.client.fetch({
|
|
93
|
-
method: 'GET',
|
|
94
|
-
path: `/cockpit/v1beta1/cockpit/metrics`,
|
|
95
|
-
urlParams: urlParams(['end_date', request.endDate], ['metric_name', request.metricName], ['project_id', request.projectId ?? _this4.client.settings.defaultProjectId], ['start_date', request.startDate])
|
|
96
|
-
}, unmarshalCockpitMetrics);
|
|
97
|
-
};
|
|
98
|
-
})();
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Deactivate the Cockpit of the specified Project ID.
|
|
102
|
-
*
|
|
103
|
-
* @param request - The request {@link DeactivateCockpitRequest}
|
|
104
|
-
* @returns A Promise of Cockpit
|
|
105
|
-
*/
|
|
106
|
-
deactivateCockpit = (() => {
|
|
107
|
-
var _this5 = this;
|
|
108
|
-
return function (request) {
|
|
109
|
-
if (request === void 0) {
|
|
110
|
-
request = {};
|
|
111
|
-
}
|
|
112
|
-
return _this5.client.fetch({
|
|
113
|
-
body: JSON.stringify(marshalDeactivateCockpitRequest(request, _this5.client.settings)),
|
|
114
|
-
headers: jsonContentHeaders,
|
|
115
|
-
method: 'POST',
|
|
116
|
-
path: `/cockpit/v1beta1/deactivate`
|
|
117
|
-
}, unmarshalCockpit);
|
|
118
|
-
};
|
|
119
|
-
})();
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Reset your Cockpit's Grafana associated with the specified Project ID.
|
|
123
|
-
*
|
|
124
|
-
* @param request - The request {@link ResetCockpitGrafanaRequest}
|
|
125
|
-
* @returns A Promise of Cockpit
|
|
126
|
-
*/
|
|
127
|
-
resetCockpitGrafana = (() => {
|
|
128
|
-
var _this6 = this;
|
|
129
|
-
return function (request) {
|
|
130
|
-
if (request === void 0) {
|
|
131
|
-
request = {};
|
|
132
|
-
}
|
|
133
|
-
return _this6.client.fetch({
|
|
134
|
-
body: JSON.stringify(marshalResetCockpitGrafanaRequest(request, _this6.client.settings)),
|
|
135
|
-
headers: jsonContentHeaders,
|
|
136
|
-
method: 'POST',
|
|
137
|
-
path: `/cockpit/v1beta1/reset-grafana`
|
|
138
|
-
}, unmarshalCockpit);
|
|
139
|
-
};
|
|
140
|
-
})();
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Create a datasource for the specified Project ID and the given type.
|
|
144
|
-
*
|
|
145
|
-
* @param request - The request {@link CreateDatasourceRequest}
|
|
146
|
-
* @returns A Promise of Datasource
|
|
147
|
-
*/
|
|
148
|
-
createDatasource = request => this.client.fetch({
|
|
149
|
-
body: JSON.stringify(marshalCreateDatasourceRequest(request, this.client.settings)),
|
|
150
|
-
headers: jsonContentHeaders,
|
|
151
|
-
method: 'POST',
|
|
152
|
-
path: `/cockpit/v1beta1/datasources`
|
|
153
|
-
}, unmarshalDatasource);
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Create a token associated with the specified Project ID.
|
|
157
|
-
*
|
|
158
|
-
* @param request - The request {@link CreateTokenRequest}
|
|
159
|
-
* @returns A Promise of Token
|
|
160
|
-
*/
|
|
161
|
-
createToken = request => this.client.fetch({
|
|
162
|
-
body: JSON.stringify(marshalCreateTokenRequest(request, this.client.settings)),
|
|
163
|
-
headers: jsonContentHeaders,
|
|
164
|
-
method: 'POST',
|
|
165
|
-
path: `/cockpit/v1beta1/tokens`
|
|
166
|
-
}, unmarshalToken);
|
|
167
|
-
pageOfListTokens = (() => {
|
|
168
|
-
var _this7 = this;
|
|
169
|
-
return function (request) {
|
|
170
|
-
if (request === void 0) {
|
|
171
|
-
request = {};
|
|
172
|
-
}
|
|
173
|
-
return _this7.client.fetch({
|
|
174
|
-
method: 'GET',
|
|
175
|
-
path: `/cockpit/v1beta1/tokens`,
|
|
176
|
-
urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this7.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this7.client.settings.defaultProjectId])
|
|
177
|
-
}, unmarshalListTokensResponse);
|
|
178
|
-
};
|
|
179
|
-
})();
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Get a list of tokens associated with the specified Project ID.
|
|
183
|
-
*
|
|
184
|
-
* @param request - The request {@link ListTokensRequest}
|
|
185
|
-
* @returns A Promise of ListTokensResponse
|
|
186
|
-
*/
|
|
187
|
-
listTokens = (() => {
|
|
188
|
-
var _this8 = this;
|
|
189
|
-
return function (request) {
|
|
190
|
-
if (request === void 0) {
|
|
191
|
-
request = {};
|
|
192
|
-
}
|
|
193
|
-
return enrichForPagination('tokens', _this8.pageOfListTokens, request);
|
|
194
|
-
};
|
|
195
|
-
})();
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Retrieve the token associated with the specified token ID.
|
|
199
|
-
*
|
|
200
|
-
* @param request - The request {@link GetTokenRequest}
|
|
201
|
-
* @returns A Promise of Token
|
|
202
|
-
*/
|
|
203
|
-
getToken = request => this.client.fetch({
|
|
204
|
-
method: 'GET',
|
|
205
|
-
path: `/cockpit/v1beta1/tokens/${validatePathParam('tokenId', request.tokenId)}`
|
|
206
|
-
}, unmarshalToken);
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Delete the token associated with the specified token ID.
|
|
210
|
-
*
|
|
211
|
-
* @param request - The request {@link DeleteTokenRequest}
|
|
212
|
-
*/
|
|
213
|
-
deleteToken = request => this.client.fetch({
|
|
214
|
-
method: 'DELETE',
|
|
215
|
-
path: `/cockpit/v1beta1/tokens/${validatePathParam('tokenId', request.tokenId)}`
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Create a contact point to receive alerts for the default receiver.
|
|
220
|
-
*
|
|
221
|
-
* @param request - The request {@link CreateContactPointRequest}
|
|
222
|
-
* @returns A Promise of ContactPoint
|
|
223
|
-
*/
|
|
224
|
-
createContactPoint = request => this.client.fetch({
|
|
225
|
-
body: JSON.stringify(marshalCreateContactPointRequest(request, this.client.settings)),
|
|
226
|
-
headers: jsonContentHeaders,
|
|
227
|
-
method: 'POST',
|
|
228
|
-
path: `/cockpit/v1beta1/contact-points`
|
|
229
|
-
}, unmarshalContactPoint);
|
|
230
|
-
pageOfListContactPoints = (() => {
|
|
231
|
-
var _this9 = this;
|
|
232
|
-
return function (request) {
|
|
233
|
-
if (request === void 0) {
|
|
234
|
-
request = {};
|
|
235
|
-
}
|
|
236
|
-
return _this9.client.fetch({
|
|
237
|
-
method: 'GET',
|
|
238
|
-
path: `/cockpit/v1beta1/contact-points`,
|
|
239
|
-
urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this9.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this9.client.settings.defaultProjectId])
|
|
240
|
-
}, unmarshalListContactPointsResponse);
|
|
241
|
-
};
|
|
242
|
-
})();
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Get a list of contact points for the Cockpit associated with the specified
|
|
246
|
-
* Project ID.
|
|
247
|
-
*
|
|
248
|
-
* @param request - The request {@link ListContactPointsRequest}
|
|
249
|
-
* @returns A Promise of ListContactPointsResponse
|
|
250
|
-
*/
|
|
251
|
-
listContactPoints = (() => {
|
|
252
|
-
var _this10 = this;
|
|
253
|
-
return function (request) {
|
|
254
|
-
if (request === void 0) {
|
|
255
|
-
request = {};
|
|
256
|
-
}
|
|
257
|
-
return enrichForPagination('contactPoints', _this10.pageOfListContactPoints, request);
|
|
258
|
-
};
|
|
259
|
-
})();
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Delete a contact point for the default receiver.
|
|
263
|
-
*
|
|
264
|
-
* @param request - The request {@link DeleteContactPointRequest}
|
|
265
|
-
*/
|
|
266
|
-
deleteContactPoint = request => this.client.fetch({
|
|
267
|
-
body: JSON.stringify(marshalDeleteContactPointRequest(request, this.client.settings)),
|
|
268
|
-
headers: jsonContentHeaders,
|
|
269
|
-
method: 'POST',
|
|
270
|
-
path: `/cockpit/v1beta1/delete-contact-point`
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Enable the sending of managed alerts for the specified Project's Cockpit.
|
|
275
|
-
*
|
|
276
|
-
* @param request - The request {@link EnableManagedAlertsRequest}
|
|
277
|
-
*/
|
|
278
|
-
enableManagedAlerts = (() => {
|
|
279
|
-
var _this11 = this;
|
|
280
|
-
return function (request) {
|
|
281
|
-
if (request === void 0) {
|
|
282
|
-
request = {};
|
|
283
|
-
}
|
|
284
|
-
return _this11.client.fetch({
|
|
285
|
-
body: JSON.stringify(marshalEnableManagedAlertsRequest(request, _this11.client.settings)),
|
|
286
|
-
headers: jsonContentHeaders,
|
|
287
|
-
method: 'POST',
|
|
288
|
-
path: `/cockpit/v1beta1/enable-managed-alerts`
|
|
289
|
-
});
|
|
290
|
-
};
|
|
291
|
-
})();
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Disable the sending of managed alerts for the specified Project's Cockpit.
|
|
295
|
-
*
|
|
296
|
-
* @param request - The request {@link DisableManagedAlertsRequest}
|
|
297
|
-
*/
|
|
298
|
-
disableManagedAlerts = (() => {
|
|
299
|
-
var _this12 = this;
|
|
300
|
-
return function (request) {
|
|
301
|
-
if (request === void 0) {
|
|
302
|
-
request = {};
|
|
303
|
-
}
|
|
304
|
-
return _this12.client.fetch({
|
|
305
|
-
body: JSON.stringify(marshalDisableManagedAlertsRequest(request, _this12.client.settings)),
|
|
306
|
-
headers: jsonContentHeaders,
|
|
307
|
-
method: 'POST',
|
|
308
|
-
path: `/cockpit/v1beta1/disable-managed-alerts`
|
|
309
|
-
});
|
|
310
|
-
};
|
|
311
|
-
})();
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Trigger a test alert to all of the Cockpit's receivers.
|
|
315
|
-
*
|
|
316
|
-
* @param request - The request {@link TriggerTestAlertRequest}
|
|
317
|
-
*/
|
|
318
|
-
triggerTestAlert = (() => {
|
|
319
|
-
var _this13 = this;
|
|
320
|
-
return function (request) {
|
|
321
|
-
if (request === void 0) {
|
|
322
|
-
request = {};
|
|
323
|
-
}
|
|
324
|
-
return _this13.client.fetch({
|
|
325
|
-
body: JSON.stringify(marshalTriggerTestAlertRequest(request, _this13.client.settings)),
|
|
326
|
-
headers: jsonContentHeaders,
|
|
327
|
-
method: 'POST',
|
|
328
|
-
path: `/cockpit/v1beta1/trigger-test-alert`
|
|
329
|
-
});
|
|
330
|
-
};
|
|
331
|
-
})();
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Create a Grafana user for your Cockpit's Grafana instance. Make sure you
|
|
335
|
-
* save the automatically-generated password and the Grafana user ID.
|
|
336
|
-
*
|
|
337
|
-
* @param request - The request {@link CreateGrafanaUserRequest}
|
|
338
|
-
* @returns A Promise of GrafanaUser
|
|
339
|
-
*/
|
|
340
|
-
createGrafanaUser = request => this.client.fetch({
|
|
341
|
-
body: JSON.stringify(marshalCreateGrafanaUserRequest(request, this.client.settings)),
|
|
342
|
-
headers: jsonContentHeaders,
|
|
343
|
-
method: 'POST',
|
|
344
|
-
path: `/cockpit/v1beta1/grafana-users`
|
|
345
|
-
}, unmarshalGrafanaUser);
|
|
346
|
-
pageOfListGrafanaUsers = (() => {
|
|
347
|
-
var _this14 = this;
|
|
348
|
-
return function (request) {
|
|
349
|
-
if (request === void 0) {
|
|
350
|
-
request = {};
|
|
351
|
-
}
|
|
352
|
-
return _this14.client.fetch({
|
|
353
|
-
method: 'GET',
|
|
354
|
-
path: `/cockpit/v1beta1/grafana-users`,
|
|
355
|
-
urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this14.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this14.client.settings.defaultProjectId])
|
|
356
|
-
}, unmarshalListGrafanaUsersResponse);
|
|
357
|
-
};
|
|
358
|
-
})();
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* Get a list of Grafana users who are able to connect to the Cockpit's
|
|
362
|
-
* Grafana instance.
|
|
363
|
-
*
|
|
364
|
-
* @param request - The request {@link ListGrafanaUsersRequest}
|
|
365
|
-
* @returns A Promise of ListGrafanaUsersResponse
|
|
366
|
-
*/
|
|
367
|
-
listGrafanaUsers = (() => {
|
|
368
|
-
var _this15 = this;
|
|
369
|
-
return function (request) {
|
|
370
|
-
if (request === void 0) {
|
|
371
|
-
request = {};
|
|
372
|
-
}
|
|
373
|
-
return enrichForPagination('grafanaUsers', _this15.pageOfListGrafanaUsers, request);
|
|
374
|
-
};
|
|
375
|
-
})();
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Delete a Grafana user from a Grafana instance, specified by the Cockpit's
|
|
379
|
-
* Project ID and the Grafana user ID.
|
|
380
|
-
*
|
|
381
|
-
* @param request - The request {@link DeleteGrafanaUserRequest}
|
|
382
|
-
*/
|
|
383
|
-
deleteGrafanaUser = request => this.client.fetch({
|
|
384
|
-
body: JSON.stringify(marshalDeleteGrafanaUserRequest(request, this.client.settings)),
|
|
385
|
-
headers: jsonContentHeaders,
|
|
386
|
-
method: 'POST',
|
|
387
|
-
path: `/cockpit/v1beta1/grafana-users/${validatePathParam('grafanaUserId', request.grafanaUserId)}/delete`
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* Reset a Grafana user's password specified by the Cockpit's Project ID and
|
|
392
|
-
* the Grafana user ID.
|
|
393
|
-
*
|
|
394
|
-
* @param request - The request {@link ResetGrafanaUserPasswordRequest}
|
|
395
|
-
* @returns A Promise of GrafanaUser
|
|
396
|
-
*/
|
|
397
|
-
resetGrafanaUserPassword = request => this.client.fetch({
|
|
398
|
-
body: JSON.stringify(marshalResetGrafanaUserPasswordRequest(request, this.client.settings)),
|
|
399
|
-
headers: jsonContentHeaders,
|
|
400
|
-
method: 'POST',
|
|
401
|
-
path: `/cockpit/v1beta1/grafana-users/${validatePathParam('grafanaUserId', request.grafanaUserId)}/reset-password`
|
|
402
|
-
}, unmarshalGrafanaUser);
|
|
403
|
-
pageOfListPlans = (() => {
|
|
404
|
-
var _this16 = this;
|
|
405
|
-
return function (request) {
|
|
406
|
-
if (request === void 0) {
|
|
407
|
-
request = {};
|
|
408
|
-
}
|
|
409
|
-
return _this16.client.fetch({
|
|
410
|
-
method: 'GET',
|
|
411
|
-
path: `/cockpit/v1beta1/plans`,
|
|
412
|
-
urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this16.client.settings.defaultPageSize])
|
|
413
|
-
}, unmarshalListPlansResponse);
|
|
414
|
-
};
|
|
415
|
-
})();
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* Get a list of all pricing plans available.
|
|
419
|
-
*
|
|
420
|
-
* @param request - The request {@link ListPlansRequest}
|
|
421
|
-
* @returns A Promise of ListPlansResponse
|
|
422
|
-
*/
|
|
423
|
-
listPlans = (() => {
|
|
424
|
-
var _this17 = this;
|
|
425
|
-
return function (request) {
|
|
426
|
-
if (request === void 0) {
|
|
427
|
-
request = {};
|
|
428
|
-
}
|
|
429
|
-
return enrichForPagination('plans', _this17.pageOfListPlans, request);
|
|
430
|
-
};
|
|
431
|
-
})();
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* Select your chosen pricing plan for your Cockpit, specifying the Cockpit's
|
|
435
|
-
* Project ID and the pricing plan's ID in the request.
|
|
436
|
-
*
|
|
437
|
-
* @param request - The request {@link SelectPlanRequest}
|
|
438
|
-
* @returns A Promise of SelectPlanResponse
|
|
439
|
-
*/
|
|
440
|
-
selectPlan = request => this.client.fetch({
|
|
441
|
-
body: JSON.stringify(marshalSelectPlanRequest(request, this.client.settings)),
|
|
442
|
-
headers: jsonContentHeaders,
|
|
443
|
-
method: 'POST',
|
|
444
|
-
path: `/cockpit/v1beta1/select-plan`
|
|
445
|
-
}, unmarshalSelectPlanResponse);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
export { API };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
2
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
|
-
|
|
4
|
-
/** Lists transient statutes of the enum {@link CockpitStatus}. */
|
|
5
|
-
const COCKPIT_TRANSIENT_STATUSES = ['creating', 'deleting', 'updating'];
|
|
6
|
-
|
|
7
|
-
export { COCKPIT_TRANSIENT_STATUSES };
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
|
|
2
|
-
import { isJSONObject } from '../../../helpers/json.js';
|
|
3
|
-
import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
|
|
4
|
-
import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
|
|
5
|
-
|
|
6
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
7
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
8
|
-
const unmarshalContactPointEmail = data => {
|
|
9
|
-
if (!isJSONObject(data)) {
|
|
10
|
-
throw new TypeError(`Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.`);
|
|
11
|
-
}
|
|
12
|
-
return {
|
|
13
|
-
to: data.to
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
const unmarshalContactPoint = data => {
|
|
17
|
-
if (!isJSONObject(data)) {
|
|
18
|
-
throw new TypeError(`Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.`);
|
|
19
|
-
}
|
|
20
|
-
return {
|
|
21
|
-
email: data.email ? unmarshalContactPointEmail(data.email) : undefined
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
const unmarshalGrafanaUser = data => {
|
|
25
|
-
if (!isJSONObject(data)) {
|
|
26
|
-
throw new TypeError(`Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`);
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
id: data.id,
|
|
30
|
-
login: data.login,
|
|
31
|
-
password: data.password ? data.password : undefined,
|
|
32
|
-
role: data.role
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
const unmarshalTokenScopes = data => {
|
|
36
|
-
if (!isJSONObject(data)) {
|
|
37
|
-
throw new TypeError(`Unmarshalling the type 'TokenScopes' failed as data isn't a dictionary.`);
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
queryLogs: data.query_logs,
|
|
41
|
-
queryMetrics: data.query_metrics,
|
|
42
|
-
queryTraces: data.query_traces,
|
|
43
|
-
setupAlerts: data.setup_alerts,
|
|
44
|
-
setupLogsRules: data.setup_logs_rules,
|
|
45
|
-
setupMetricsRules: data.setup_metrics_rules,
|
|
46
|
-
writeLogs: data.write_logs,
|
|
47
|
-
writeMetrics: data.write_metrics,
|
|
48
|
-
writeTraces: data.write_traces
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
const unmarshalToken = data => {
|
|
52
|
-
if (!isJSONObject(data)) {
|
|
53
|
-
throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
createdAt: unmarshalDate(data.created_at),
|
|
57
|
-
id: data.id,
|
|
58
|
-
name: data.name,
|
|
59
|
-
projectId: data.project_id,
|
|
60
|
-
scopes: unmarshalTokenScopes(data.scopes),
|
|
61
|
-
secretKey: data.secret_key ? data.secret_key : undefined,
|
|
62
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
const unmarshalPlan = data => {
|
|
66
|
-
if (!isJSONObject(data)) {
|
|
67
|
-
throw new TypeError(`Unmarshalling the type 'Plan' failed as data isn't a dictionary.`);
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
id: data.id,
|
|
71
|
-
logsIngestionPrice: data.logs_ingestion_price,
|
|
72
|
-
name: data.name,
|
|
73
|
-
retentionLogsInterval: data.retention_logs_interval ? data.retention_logs_interval : undefined,
|
|
74
|
-
retentionMetricsInterval: data.retention_metrics_interval ? data.retention_metrics_interval : undefined,
|
|
75
|
-
retentionPrice: data.retention_price,
|
|
76
|
-
sampleIngestionPrice: data.sample_ingestion_price
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
const unmarshalCockpitEndpoints = data => {
|
|
80
|
-
if (!isJSONObject(data)) {
|
|
81
|
-
throw new TypeError(`Unmarshalling the type 'CockpitEndpoints' failed as data isn't a dictionary.`);
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
alertmanagerUrl: data.alertmanager_url,
|
|
85
|
-
grafanaUrl: data.grafana_url,
|
|
86
|
-
logsUrl: data.logs_url,
|
|
87
|
-
metricsUrl: data.metrics_url
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
const unmarshalCockpit = data => {
|
|
91
|
-
if (!isJSONObject(data)) {
|
|
92
|
-
throw new TypeError(`Unmarshalling the type 'Cockpit' failed as data isn't a dictionary.`);
|
|
93
|
-
}
|
|
94
|
-
return {
|
|
95
|
-
createdAt: unmarshalDate(data.created_at),
|
|
96
|
-
endpoints: unmarshalCockpitEndpoints(data.endpoints),
|
|
97
|
-
managedAlertsEnabled: data.managed_alerts_enabled,
|
|
98
|
-
plan: unmarshalPlan(data.plan),
|
|
99
|
-
projectId: data.project_id,
|
|
100
|
-
status: data.status,
|
|
101
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
const unmarshalCockpitMetrics = data => {
|
|
105
|
-
if (!isJSONObject(data)) {
|
|
106
|
-
throw new TypeError(`Unmarshalling the type 'CockpitMetrics' failed as data isn't a dictionary.`);
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
const unmarshalDatasource = data => {
|
|
113
|
-
if (!isJSONObject(data)) {
|
|
114
|
-
throw new TypeError(`Unmarshalling the type 'Datasource' failed as data isn't a dictionary.`);
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
id: data.id,
|
|
118
|
-
name: data.name,
|
|
119
|
-
projectId: data.project_id,
|
|
120
|
-
type: data.type,
|
|
121
|
-
url: data.url
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
const unmarshalListContactPointsResponse = data => {
|
|
125
|
-
if (!isJSONObject(data)) {
|
|
126
|
-
throw new TypeError(`Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`);
|
|
127
|
-
}
|
|
128
|
-
return {
|
|
129
|
-
contactPoints: unmarshalArrayOfObject(data.contact_points, unmarshalContactPoint),
|
|
130
|
-
hasAdditionalContactPoints: data.has_additional_contact_points,
|
|
131
|
-
hasAdditionalReceivers: data.has_additional_receivers,
|
|
132
|
-
totalCount: data.total_count
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
const unmarshalListGrafanaUsersResponse = data => {
|
|
136
|
-
if (!isJSONObject(data)) {
|
|
137
|
-
throw new TypeError(`Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`);
|
|
138
|
-
}
|
|
139
|
-
return {
|
|
140
|
-
grafanaUsers: unmarshalArrayOfObject(data.grafana_users, unmarshalGrafanaUser),
|
|
141
|
-
totalCount: data.total_count
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
const unmarshalListPlansResponse = data => {
|
|
145
|
-
if (!isJSONObject(data)) {
|
|
146
|
-
throw new TypeError(`Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`);
|
|
147
|
-
}
|
|
148
|
-
return {
|
|
149
|
-
plans: unmarshalArrayOfObject(data.plans, unmarshalPlan),
|
|
150
|
-
totalCount: data.total_count
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
const unmarshalListTokensResponse = data => {
|
|
154
|
-
if (!isJSONObject(data)) {
|
|
155
|
-
throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);
|
|
156
|
-
}
|
|
157
|
-
return {
|
|
158
|
-
tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
|
|
159
|
-
totalCount: data.total_count
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
const unmarshalSelectPlanResponse = data => {
|
|
163
|
-
if (!isJSONObject(data)) {
|
|
164
|
-
throw new TypeError(`Unmarshalling the type 'SelectPlanResponse' failed as data isn't a dictionary.`);
|
|
165
|
-
}
|
|
166
|
-
return {};
|
|
167
|
-
};
|
|
168
|
-
const marshalActivateCockpitRequest = (request, defaults) => ({
|
|
169
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
170
|
-
});
|
|
171
|
-
const marshalCreateContactPointRequest = (request, defaults) => ({
|
|
172
|
-
contact_point: request.contactPoint,
|
|
173
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
174
|
-
});
|
|
175
|
-
const marshalCreateDatasourceRequest = (request, defaults) => ({
|
|
176
|
-
name: request.name,
|
|
177
|
-
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
178
|
-
type: request.type
|
|
179
|
-
});
|
|
180
|
-
const marshalCreateGrafanaUserRequest = (request, defaults) => ({
|
|
181
|
-
login: request.login,
|
|
182
|
-
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
183
|
-
role: request.role
|
|
184
|
-
});
|
|
185
|
-
const marshalCreateTokenRequest = (request, defaults) => ({
|
|
186
|
-
name: request.name || randomName('token'),
|
|
187
|
-
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
188
|
-
scopes: request.scopes
|
|
189
|
-
});
|
|
190
|
-
const marshalDeactivateCockpitRequest = (request, defaults) => ({
|
|
191
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
192
|
-
});
|
|
193
|
-
const marshalDeleteContactPointRequest = (request, defaults) => ({
|
|
194
|
-
contact_point: request.contactPoint,
|
|
195
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
196
|
-
});
|
|
197
|
-
const marshalDeleteGrafanaUserRequest = (request, defaults) => ({
|
|
198
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
199
|
-
});
|
|
200
|
-
const marshalDisableManagedAlertsRequest = (request, defaults) => ({
|
|
201
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
202
|
-
});
|
|
203
|
-
const marshalEnableManagedAlertsRequest = (request, defaults) => ({
|
|
204
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
205
|
-
});
|
|
206
|
-
const marshalResetCockpitGrafanaRequest = (request, defaults) => ({
|
|
207
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
208
|
-
});
|
|
209
|
-
const marshalResetGrafanaUserPasswordRequest = (request, defaults) => ({
|
|
210
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
211
|
-
});
|
|
212
|
-
const marshalSelectPlanRequest = (request, defaults) => ({
|
|
213
|
-
plan_id: request.planId,
|
|
214
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
215
|
-
});
|
|
216
|
-
const marshalTriggerTestAlertRequest = (request, defaults) => ({
|
|
217
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
export { marshalActivateCockpitRequest, marshalCreateContactPointRequest, marshalCreateDatasourceRequest, marshalCreateGrafanaUserRequest, marshalCreateTokenRequest, marshalDeactivateCockpitRequest, marshalDeleteContactPointRequest, marshalDeleteGrafanaUserRequest, marshalDisableManagedAlertsRequest, marshalEnableManagedAlertsRequest, marshalResetCockpitGrafanaRequest, marshalResetGrafanaUserPasswordRequest, marshalSelectPlanRequest, marshalTriggerTestAlertRequest, unmarshalCockpit, unmarshalCockpitMetrics, unmarshalContactPoint, unmarshalDatasource, unmarshalGrafanaUser, unmarshalListContactPointsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListTokensResponse, unmarshalSelectPlanResponse, unmarshalToken };
|