@scaleway/sdk-audit-trail 2.4.1 → 2.5.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/dist/v1alpha1/api.gen.d.ts +33 -1
- package/dist/v1alpha1/api.gen.js +72 -1
- package/dist/v1alpha1/content.gen.d.ts +3 -0
- package/dist/v1alpha1/content.gen.js +7 -0
- package/dist/v1alpha1/index.gen.d.ts +2 -1
- package/dist/v1alpha1/index.gen.js +11 -2
- package/dist/v1alpha1/marshalling.gen.d.ts +8 -1
- package/dist/v1alpha1/marshalling.gen.js +74 -1
- package/dist/v1alpha1/types.gen.d.ts +105 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ApiLocality } from '@scaleway/sdk-client';
|
|
2
2
|
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
|
-
import type { CreateExportJobRequest, DeleteExportJobRequest, ExportJob, ListAuthenticationEventsRequest, ListAuthenticationEventsResponse, ListCombinedEventsRequest, ListCombinedEventsResponse, ListEventsRequest, ListEventsResponse, ListExportJobsRequest, ListExportJobsResponse, ListProductsRequest, ListProductsResponse } from './types.gen.js';
|
|
3
|
+
import type { CreateExportJobRequest, DeleteExportJobRequest, DisableAlertRulesRequest, DisableAlertRulesResponse, EnableAlertRulesRequest, EnableAlertRulesResponse, ExportJob, ListAlertRulesRequest, ListAlertRulesResponse, ListAuthenticationEventsRequest, ListAuthenticationEventsResponse, ListCombinedEventsRequest, ListCombinedEventsResponse, ListEventsRequest, ListEventsResponse, ListExportJobsRequest, ListExportJobsResponse, ListProductsRequest, ListProductsResponse, SetEnabledAlertRulesRequest, SetEnabledAlertRulesResponse } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Audit Trail API.
|
|
6
6
|
|
|
@@ -52,4 +52,36 @@ export declare class API extends ParentAPI {
|
|
|
52
52
|
all: () => Promise<ExportJob[]>;
|
|
53
53
|
[Symbol.asyncIterator]: () => AsyncGenerator<ExportJob[], void, void>;
|
|
54
54
|
};
|
|
55
|
+
protected pageOfListAlertRules: (request?: Readonly<ListAlertRulesRequest>) => Promise<ListAlertRulesResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* List alert rules for a specified organization and their current status (enabled or disabled).
|
|
58
|
+
*
|
|
59
|
+
* @param request - The request {@link ListAlertRulesRequest}
|
|
60
|
+
* @returns A Promise of ListAlertRulesResponse
|
|
61
|
+
*/
|
|
62
|
+
listAlertRules: (request?: Readonly<ListAlertRulesRequest>) => Promise<ListAlertRulesResponse> & {
|
|
63
|
+
all: () => Promise<import("./types.gen.js").AlertRule[]>;
|
|
64
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").AlertRule[], void, void>;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Enable alert rules. Enable alert rules for a specified organization. Enabled rules will trigger alerts when matching events occur.
|
|
68
|
+
*
|
|
69
|
+
* @param request - The request {@link EnableAlertRulesRequest}
|
|
70
|
+
* @returns A Promise of EnableAlertRulesResponse
|
|
71
|
+
*/
|
|
72
|
+
enableAlertRules: (request?: Readonly<EnableAlertRulesRequest>) => Promise<EnableAlertRulesResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Disable alert rules. Disable alert rules for a specified organization. Disabled rules will no longer trigger alerts when matching events occur.
|
|
75
|
+
*
|
|
76
|
+
* @param request - The request {@link DisableAlertRulesRequest}
|
|
77
|
+
* @returns A Promise of DisableAlertRulesResponse
|
|
78
|
+
*/
|
|
79
|
+
disableAlertRules: (request?: Readonly<DisableAlertRulesRequest>) => Promise<DisableAlertRulesResponse>;
|
|
80
|
+
/**
|
|
81
|
+
* Set the alert rules to enabled. Set the alert rules to enabled by replacing the set of enabled alert rules for a specified organization. The provided list defines the complete set of rules that should be enabled. Any previously enabled rule not included in the request will be disabled.
|
|
82
|
+
*
|
|
83
|
+
* @param request - The request {@link SetEnabledAlertRulesRequest}
|
|
84
|
+
* @returns A Promise of SetEnabledAlertRulesResponse
|
|
85
|
+
*/
|
|
86
|
+
setEnabledAlertRules: (request?: Readonly<SetEnabledAlertRulesRequest>) => Promise<SetEnabledAlertRulesResponse>;
|
|
55
87
|
}
|
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination } from "@scaleway/sdk-client";
|
|
2
|
-
import { unmarshalListEventsResponse, unmarshalListAuthenticationEventsResponse, unmarshalListCombinedEventsResponse, unmarshalListProductsResponse, marshalCreateExportJobRequest, unmarshalExportJob, unmarshalListExportJobsResponse } from "./marshalling.gen.js";
|
|
2
|
+
import { unmarshalListEventsResponse, unmarshalListAuthenticationEventsResponse, unmarshalListCombinedEventsResponse, unmarshalListProductsResponse, marshalCreateExportJobRequest, unmarshalExportJob, unmarshalListExportJobsResponse, unmarshalListAlertRulesResponse, marshalEnableAlertRulesRequest, unmarshalEnableAlertRulesResponse, marshalDisableAlertRulesRequest, unmarshalDisableAlertRulesResponse, marshalSetEnabledAlertRulesRequest, unmarshalSetEnabledAlertRulesResponse } from "./marshalling.gen.js";
|
|
3
3
|
const jsonContentHeaders = {
|
|
4
4
|
"Content-Type": "application/json; charset=utf-8"
|
|
5
5
|
};
|
|
@@ -142,6 +142,77 @@ class API extends API$1 {
|
|
|
142
142
|
unmarshalListExportJobsResponse
|
|
143
143
|
);
|
|
144
144
|
listExportJobs = (request = {}) => enrichForPagination("exportJobs", this.pageOfListExportJobs, request);
|
|
145
|
+
pageOfListAlertRules = (request = {}) => this.client.fetch(
|
|
146
|
+
{
|
|
147
|
+
method: "GET",
|
|
148
|
+
path: `/audit-trail/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-rules`,
|
|
149
|
+
urlParams: urlParams(
|
|
150
|
+
["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
|
|
151
|
+
["page", request.page],
|
|
152
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
153
|
+
["status", request.status]
|
|
154
|
+
)
|
|
155
|
+
},
|
|
156
|
+
unmarshalListAlertRulesResponse
|
|
157
|
+
);
|
|
158
|
+
/**
|
|
159
|
+
* List alert rules for a specified organization and their current status (enabled or disabled).
|
|
160
|
+
*
|
|
161
|
+
* @param request - The request {@link ListAlertRulesRequest}
|
|
162
|
+
* @returns A Promise of ListAlertRulesResponse
|
|
163
|
+
*/
|
|
164
|
+
listAlertRules = (request = {}) => enrichForPagination("alertRules", this.pageOfListAlertRules, request);
|
|
165
|
+
/**
|
|
166
|
+
* Enable alert rules. Enable alert rules for a specified organization. Enabled rules will trigger alerts when matching events occur.
|
|
167
|
+
*
|
|
168
|
+
* @param request - The request {@link EnableAlertRulesRequest}
|
|
169
|
+
* @returns A Promise of EnableAlertRulesResponse
|
|
170
|
+
*/
|
|
171
|
+
enableAlertRules = (request = {}) => this.client.fetch(
|
|
172
|
+
{
|
|
173
|
+
body: JSON.stringify(
|
|
174
|
+
marshalEnableAlertRulesRequest(request, this.client.settings)
|
|
175
|
+
),
|
|
176
|
+
headers: jsonContentHeaders,
|
|
177
|
+
method: "POST",
|
|
178
|
+
path: `/audit-trail/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/enable-alert-rules`
|
|
179
|
+
},
|
|
180
|
+
unmarshalEnableAlertRulesResponse
|
|
181
|
+
);
|
|
182
|
+
/**
|
|
183
|
+
* Disable alert rules. Disable alert rules for a specified organization. Disabled rules will no longer trigger alerts when matching events occur.
|
|
184
|
+
*
|
|
185
|
+
* @param request - The request {@link DisableAlertRulesRequest}
|
|
186
|
+
* @returns A Promise of DisableAlertRulesResponse
|
|
187
|
+
*/
|
|
188
|
+
disableAlertRules = (request = {}) => this.client.fetch(
|
|
189
|
+
{
|
|
190
|
+
body: JSON.stringify(
|
|
191
|
+
marshalDisableAlertRulesRequest(request, this.client.settings)
|
|
192
|
+
),
|
|
193
|
+
headers: jsonContentHeaders,
|
|
194
|
+
method: "POST",
|
|
195
|
+
path: `/audit-trail/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/disable-alert-rules`
|
|
196
|
+
},
|
|
197
|
+
unmarshalDisableAlertRulesResponse
|
|
198
|
+
);
|
|
199
|
+
/**
|
|
200
|
+
* Set the alert rules to enabled. Set the alert rules to enabled by replacing the set of enabled alert rules for a specified organization. The provided list defines the complete set of rules that should be enabled. Any previously enabled rule not included in the request will be disabled.
|
|
201
|
+
*
|
|
202
|
+
* @param request - The request {@link SetEnabledAlertRulesRequest}
|
|
203
|
+
* @returns A Promise of SetEnabledAlertRulesResponse
|
|
204
|
+
*/
|
|
205
|
+
setEnabledAlertRules = (request = {}) => this.client.fetch(
|
|
206
|
+
{
|
|
207
|
+
body: JSON.stringify(
|
|
208
|
+
marshalSetEnabledAlertRulesRequest(request, this.client.settings)
|
|
209
|
+
),
|
|
210
|
+
headers: jsonContentHeaders,
|
|
211
|
+
method: "PATCH",
|
|
212
|
+
path: `/audit-trail/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-rules`
|
|
213
|
+
},
|
|
214
|
+
unmarshalSetEnabledAlertRulesResponse
|
|
215
|
+
);
|
|
145
216
|
}
|
|
146
217
|
export {
|
|
147
218
|
API
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { API, } from './api.gen.js';
|
|
2
|
+
export * from './content.gen.js';
|
|
2
3
|
export * from './marshalling.gen.js';
|
|
3
|
-
export type { AccountContractSignatureInfo, AccountContractSignatureInfoAccountContractInfo, AccountOrganizationInfo, AccountProjectInfo, AccountUserInfo, AppleSiliconServerInfo, AuditTrailExportJobInfo, AuthenticationEvent, AuthenticationEventFailureReason, AuthenticationEventMethod, AuthenticationEventMFAType, AuthenticationEventOrigin, AuthenticationEventResult, BaremetalServerInfo, BaremetalSettingInfo, CreateExportJobRequest, DeleteExportJobRequest, EdgeServicesBackendStageInfo, EdgeServicesCacheStageInfo, EdgeServicesDNSStageInfo, EdgeServicesPipelineInfo, EdgeServicesPlanInfo, EdgeServicesRouteRulesInfo, EdgeServicesRouteStageInfo, EdgeServicesTLSStageInfo, EdgeServicesWAFStageInfo, Event, EventPrincipal, ExportJob, ExportJobS3, ExportJobStatus, ExportJobStatusCode, InstanceServerInfo, IpamIpInfo, KeyManagerKeyInfo, KubernetesACLInfo, KubernetesClusterInfo, KubernetesNodeInfo, KubernetesPoolInfo, ListAuthenticationEventsRequest, ListAuthenticationEventsRequestOrderBy, ListAuthenticationEventsResponse, ListCombinedEventsRequest, ListCombinedEventsRequestOrderBy, ListCombinedEventsResponse, ListCombinedEventsResponseCombinedEvent, ListEventsRequest, ListEventsRequestOrderBy, ListEventsResponse, ListExportJobsRequest, ListExportJobsRequestOrderBy, ListExportJobsResponse, ListProductsRequest, ListProductsResponse, LoadBalancerAclInfo, LoadBalancerBackendInfo, LoadBalancerCertificateInfo, LoadBalancerFrontendInfo, LoadBalancerIpInfo, LoadBalancerLbInfo, LoadBalancerRouteInfo, Product, ProductService, Resource, ResourceType, SecretManagerSecretInfo, SecretManagerSecretVersionInfo, SystemEvent, SystemEventKind, VpcGwGatewayInfo, VpcGwGatewayNetworkInfo, VpcPrivateNetworkInfo, VpcRouteInfo, VpcSubnetInfo, } from './types.gen.js';
|
|
4
|
+
export type { AccountContractSignatureInfo, AccountContractSignatureInfoAccountContractInfo, AccountOrganizationInfo, AccountProjectInfo, AccountUserInfo, AlertRule, AlertRuleStatus, AppleSiliconServerInfo, AuditTrailExportJobInfo, AuthenticationEvent, AuthenticationEventFailureReason, AuthenticationEventMethod, AuthenticationEventMFAType, AuthenticationEventOrigin, AuthenticationEventResult, BaremetalServerInfo, BaremetalSettingInfo, CreateExportJobRequest, DeleteExportJobRequest, DisableAlertRulesRequest, DisableAlertRulesResponse, EdgeServicesBackendStageInfo, EdgeServicesCacheStageInfo, EdgeServicesDNSStageInfo, EdgeServicesPipelineInfo, EdgeServicesPlanInfo, EdgeServicesRouteRulesInfo, EdgeServicesRouteStageInfo, EdgeServicesTLSStageInfo, EdgeServicesWAFStageInfo, EnableAlertRulesRequest, EnableAlertRulesResponse, Event, EventPrincipal, ExportJob, ExportJobS3, ExportJobStatus, ExportJobStatusCode, InstanceServerInfo, IpamIpInfo, KeyManagerKeyInfo, KubernetesACLInfo, KubernetesClusterInfo, KubernetesNodeInfo, KubernetesPoolInfo, ListAlertRulesRequest, ListAlertRulesResponse, ListAuthenticationEventsRequest, ListAuthenticationEventsRequestOrderBy, ListAuthenticationEventsResponse, ListCombinedEventsRequest, ListCombinedEventsRequestOrderBy, ListCombinedEventsResponse, ListCombinedEventsResponseCombinedEvent, ListEventsRequest, ListEventsRequestOrderBy, ListEventsResponse, ListExportJobsRequest, ListExportJobsRequestOrderBy, ListExportJobsResponse, ListProductsRequest, ListProductsResponse, LoadBalancerAclInfo, LoadBalancerBackendInfo, LoadBalancerCertificateInfo, LoadBalancerFrontendInfo, LoadBalancerIpInfo, LoadBalancerLbInfo, LoadBalancerRouteInfo, Product, ProductService, Resource, ResourceType, SecretManagerSecretInfo, SecretManagerSecretVersionInfo, SetEnabledAlertRulesRequest, SetEnabledAlertRulesResponse, SystemEvent, SystemEventKind, VpcGwGatewayInfo, VpcGwGatewayNetworkInfo, VpcPrivateNetworkInfo, VpcRouteInfo, VpcSubnetInfo, } from './types.gen.js';
|
|
4
5
|
export * as ValidationRules from './validation-rules.gen.js';
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { API } from "./api.gen.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ALERT_RULE_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
+
import { marshalCreateExportJobRequest, marshalDisableAlertRulesRequest, marshalEnableAlertRulesRequest, marshalSetEnabledAlertRulesRequest, unmarshalDisableAlertRulesResponse, unmarshalEnableAlertRulesResponse, unmarshalEvent, unmarshalExportJob, unmarshalListAlertRulesResponse, unmarshalListAuthenticationEventsResponse, unmarshalListCombinedEventsResponse, unmarshalListEventsResponse, unmarshalListExportJobsResponse, unmarshalListProductsResponse, unmarshalResource, unmarshalSetEnabledAlertRulesResponse } from "./marshalling.gen.js";
|
|
3
4
|
import * as validationRules_gen from "./validation-rules.gen.js";
|
|
4
5
|
export {
|
|
6
|
+
ALERT_RULE_TRANSIENT_STATUSES,
|
|
5
7
|
API,
|
|
6
8
|
validationRules_gen as ValidationRules,
|
|
7
9
|
marshalCreateExportJobRequest,
|
|
10
|
+
marshalDisableAlertRulesRequest,
|
|
11
|
+
marshalEnableAlertRulesRequest,
|
|
12
|
+
marshalSetEnabledAlertRulesRequest,
|
|
13
|
+
unmarshalDisableAlertRulesResponse,
|
|
14
|
+
unmarshalEnableAlertRulesResponse,
|
|
8
15
|
unmarshalEvent,
|
|
9
16
|
unmarshalExportJob,
|
|
17
|
+
unmarshalListAlertRulesResponse,
|
|
10
18
|
unmarshalListAuthenticationEventsResponse,
|
|
11
19
|
unmarshalListCombinedEventsResponse,
|
|
12
20
|
unmarshalListEventsResponse,
|
|
13
21
|
unmarshalListExportJobsResponse,
|
|
14
22
|
unmarshalListProductsResponse,
|
|
15
|
-
unmarshalResource
|
|
23
|
+
unmarshalResource,
|
|
24
|
+
unmarshalSetEnabledAlertRulesResponse
|
|
16
25
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { CreateExportJobRequest, Event, ExportJob, ListAuthenticationEventsResponse, ListCombinedEventsResponse, ListEventsResponse, ListExportJobsResponse, ListProductsResponse, Resource } from './types.gen.js';
|
|
2
|
+
import type { CreateExportJobRequest, DisableAlertRulesRequest, DisableAlertRulesResponse, EnableAlertRulesRequest, EnableAlertRulesResponse, Event, ExportJob, ListAlertRulesResponse, ListAuthenticationEventsResponse, ListCombinedEventsResponse, ListEventsResponse, ListExportJobsResponse, ListProductsResponse, Resource, SetEnabledAlertRulesRequest, SetEnabledAlertRulesResponse } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalExportJob: (data: unknown) => ExportJob;
|
|
4
|
+
export declare const unmarshalDisableAlertRulesResponse: (data: unknown) => DisableAlertRulesResponse;
|
|
5
|
+
export declare const unmarshalEnableAlertRulesResponse: (data: unknown) => EnableAlertRulesResponse;
|
|
6
|
+
export declare const unmarshalListAlertRulesResponse: (data: unknown) => ListAlertRulesResponse;
|
|
4
7
|
export declare const unmarshalResource: (data: unknown) => Resource;
|
|
5
8
|
export declare const unmarshalListAuthenticationEventsResponse: (data: unknown) => ListAuthenticationEventsResponse;
|
|
6
9
|
export declare const unmarshalEvent: (data: unknown) => Event;
|
|
@@ -8,4 +11,8 @@ export declare const unmarshalListCombinedEventsResponse: (data: unknown) => Lis
|
|
|
8
11
|
export declare const unmarshalListEventsResponse: (data: unknown) => ListEventsResponse;
|
|
9
12
|
export declare const unmarshalListExportJobsResponse: (data: unknown) => ListExportJobsResponse;
|
|
10
13
|
export declare const unmarshalListProductsResponse: (data: unknown) => ListProductsResponse;
|
|
14
|
+
export declare const unmarshalSetEnabledAlertRulesResponse: (data: unknown) => SetEnabledAlertRulesResponse;
|
|
11
15
|
export declare const marshalCreateExportJobRequest: (request: CreateExportJobRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
16
|
+
export declare const marshalDisableAlertRulesRequest: (request: DisableAlertRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
17
|
+
export declare const marshalEnableAlertRulesRequest: (request: EnableAlertRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
18
|
+
export declare const marshalSetEnabledAlertRulesRequest: (request: SetEnabledAlertRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -40,6 +40,50 @@ const unmarshalExportJob = (data) => {
|
|
|
40
40
|
tags: data.tags
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
|
+
const unmarshalAlertRule = (data) => {
|
|
44
|
+
if (!isJSONObject(data)) {
|
|
45
|
+
throw new TypeError(
|
|
46
|
+
`Unmarshalling the type 'AlertRule' failed as data isn't a dictionary.`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
description: data.description,
|
|
51
|
+
id: data.id,
|
|
52
|
+
name: data.name,
|
|
53
|
+
status: data.status
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const unmarshalDisableAlertRulesResponse = (data) => {
|
|
57
|
+
if (!isJSONObject(data)) {
|
|
58
|
+
throw new TypeError(
|
|
59
|
+
`Unmarshalling the type 'DisableAlertRulesResponse' failed as data isn't a dictionary.`
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
alertRules: unmarshalArrayOfObject(data.alert_rules, unmarshalAlertRule)
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const unmarshalEnableAlertRulesResponse = (data) => {
|
|
67
|
+
if (!isJSONObject(data)) {
|
|
68
|
+
throw new TypeError(
|
|
69
|
+
`Unmarshalling the type 'EnableAlertRulesResponse' failed as data isn't a dictionary.`
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
alertRules: unmarshalArrayOfObject(data.alert_rules, unmarshalAlertRule)
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
const unmarshalListAlertRulesResponse = (data) => {
|
|
77
|
+
if (!isJSONObject(data)) {
|
|
78
|
+
throw new TypeError(
|
|
79
|
+
`Unmarshalling the type 'ListAlertRulesResponse' failed as data isn't a dictionary.`
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
alertRules: unmarshalArrayOfObject(data.alert_rules, unmarshalAlertRule),
|
|
84
|
+
totalCount: data.total_count
|
|
85
|
+
};
|
|
86
|
+
};
|
|
43
87
|
const unmarshalAccountContractSignatureInfoAccountContractInfo = (data) => {
|
|
44
88
|
if (!isJSONObject(data)) {
|
|
45
89
|
throw new TypeError(
|
|
@@ -666,6 +710,16 @@ const unmarshalListProductsResponse = (data) => {
|
|
|
666
710
|
totalCount: data.total_count
|
|
667
711
|
};
|
|
668
712
|
};
|
|
713
|
+
const unmarshalSetEnabledAlertRulesResponse = (data) => {
|
|
714
|
+
if (!isJSONObject(data)) {
|
|
715
|
+
throw new TypeError(
|
|
716
|
+
`Unmarshalling the type 'SetEnabledAlertRulesResponse' failed as data isn't a dictionary.`
|
|
717
|
+
);
|
|
718
|
+
}
|
|
719
|
+
return {
|
|
720
|
+
alertRules: unmarshalArrayOfObject(data.alert_rules, unmarshalAlertRule)
|
|
721
|
+
};
|
|
722
|
+
};
|
|
669
723
|
const marshalExportJobS3 = (request, defaults) => ({
|
|
670
724
|
bucket: request.bucket,
|
|
671
725
|
prefix: request.prefix,
|
|
@@ -683,14 +737,33 @@ const marshalCreateExportJobRequest = (request, defaults) => ({
|
|
|
683
737
|
}
|
|
684
738
|
])
|
|
685
739
|
});
|
|
740
|
+
const marshalDisableAlertRulesRequest = (request, defaults) => ({
|
|
741
|
+
alert_rule_ids: request.alertRuleIds,
|
|
742
|
+
organization_id: request.organizationId ?? defaults.defaultOrganizationId
|
|
743
|
+
});
|
|
744
|
+
const marshalEnableAlertRulesRequest = (request, defaults) => ({
|
|
745
|
+
alert_rule_ids: request.alertRuleIds,
|
|
746
|
+
organization_id: request.organizationId ?? defaults.defaultOrganizationId
|
|
747
|
+
});
|
|
748
|
+
const marshalSetEnabledAlertRulesRequest = (request, defaults) => ({
|
|
749
|
+
enabled_alert_rule_ids: request.enabledAlertRuleIds,
|
|
750
|
+
organization_id: request.organizationId ?? defaults.defaultOrganizationId
|
|
751
|
+
});
|
|
686
752
|
export {
|
|
687
753
|
marshalCreateExportJobRequest,
|
|
754
|
+
marshalDisableAlertRulesRequest,
|
|
755
|
+
marshalEnableAlertRulesRequest,
|
|
756
|
+
marshalSetEnabledAlertRulesRequest,
|
|
757
|
+
unmarshalDisableAlertRulesResponse,
|
|
758
|
+
unmarshalEnableAlertRulesResponse,
|
|
688
759
|
unmarshalEvent,
|
|
689
760
|
unmarshalExportJob,
|
|
761
|
+
unmarshalListAlertRulesResponse,
|
|
690
762
|
unmarshalListAuthenticationEventsResponse,
|
|
691
763
|
unmarshalListCombinedEventsResponse,
|
|
692
764
|
unmarshalListEventsResponse,
|
|
693
765
|
unmarshalListExportJobsResponse,
|
|
694
766
|
unmarshalListProductsResponse,
|
|
695
|
-
unmarshalResource
|
|
767
|
+
unmarshalResource,
|
|
768
|
+
unmarshalSetEnabledAlertRulesResponse
|
|
696
769
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Region as ScwRegion } from '@scaleway/sdk-client';
|
|
2
2
|
import type { CountryCode as StdCountryCode } from '@scaleway/sdk-std';
|
|
3
|
+
export type AlertRuleStatus = 'unknown_status' | 'enabled' | 'disabled' | 'enabling' | 'disabling';
|
|
3
4
|
export type AuthenticationEventFailureReason = 'unknown_failure_reason' | 'invalid_mfa' | 'invalid_password';
|
|
4
5
|
export type AuthenticationEventMFAType = 'unknown_mfa_type' | 'totp';
|
|
5
6
|
export type AuthenticationEventMethod = 'unknown_method' | 'password' | 'authentication_code' | 'oauth2' | 'saml';
|
|
@@ -514,6 +515,24 @@ export interface ProductService {
|
|
|
514
515
|
name: string;
|
|
515
516
|
methods: string[];
|
|
516
517
|
}
|
|
518
|
+
export interface AlertRule {
|
|
519
|
+
/**
|
|
520
|
+
* ID of the alert rule.
|
|
521
|
+
*/
|
|
522
|
+
id: string;
|
|
523
|
+
/**
|
|
524
|
+
* Name of the alert rule.
|
|
525
|
+
*/
|
|
526
|
+
name: string;
|
|
527
|
+
/**
|
|
528
|
+
* Description of the alert rule.
|
|
529
|
+
*/
|
|
530
|
+
description: string;
|
|
531
|
+
/**
|
|
532
|
+
* Current status of the alert rule.
|
|
533
|
+
*/
|
|
534
|
+
status: AlertRuleStatus;
|
|
535
|
+
}
|
|
517
536
|
export interface ListCombinedEventsResponseCombinedEvent {
|
|
518
537
|
/**
|
|
519
538
|
*
|
|
@@ -615,6 +634,72 @@ export type DeleteExportJobRequest = {
|
|
|
615
634
|
*/
|
|
616
635
|
exportJobId: string;
|
|
617
636
|
};
|
|
637
|
+
export type DisableAlertRulesRequest = {
|
|
638
|
+
/**
|
|
639
|
+
* Region to target. If none is passed will use default region from the config.
|
|
640
|
+
*/
|
|
641
|
+
region?: ScwRegion;
|
|
642
|
+
/**
|
|
643
|
+
* ID of the Organization to target.
|
|
644
|
+
*/
|
|
645
|
+
organizationId?: string;
|
|
646
|
+
/**
|
|
647
|
+
* List of IDs of the rules to disable.
|
|
648
|
+
*/
|
|
649
|
+
alertRuleIds?: string[];
|
|
650
|
+
};
|
|
651
|
+
export interface DisableAlertRulesResponse {
|
|
652
|
+
/**
|
|
653
|
+
* List of the rules that were disabled.
|
|
654
|
+
*/
|
|
655
|
+
alertRules: AlertRule[];
|
|
656
|
+
}
|
|
657
|
+
export type EnableAlertRulesRequest = {
|
|
658
|
+
/**
|
|
659
|
+
* Region to target. If none is passed will use default region from the config.
|
|
660
|
+
*/
|
|
661
|
+
region?: ScwRegion;
|
|
662
|
+
/**
|
|
663
|
+
* ID of the Organization to target.
|
|
664
|
+
*/
|
|
665
|
+
organizationId?: string;
|
|
666
|
+
/**
|
|
667
|
+
* List of IDs of the rules to enable.
|
|
668
|
+
*/
|
|
669
|
+
alertRuleIds?: string[];
|
|
670
|
+
};
|
|
671
|
+
export interface EnableAlertRulesResponse {
|
|
672
|
+
/**
|
|
673
|
+
* List of the rules that were enabled.
|
|
674
|
+
*/
|
|
675
|
+
alertRules: AlertRule[];
|
|
676
|
+
}
|
|
677
|
+
export type ListAlertRulesRequest = {
|
|
678
|
+
/**
|
|
679
|
+
* Region to target. If none is passed will use default region from the config.
|
|
680
|
+
*/
|
|
681
|
+
region?: ScwRegion;
|
|
682
|
+
/**
|
|
683
|
+
* ID of the Organization to target.
|
|
684
|
+
*/
|
|
685
|
+
organizationId?: string;
|
|
686
|
+
/**
|
|
687
|
+
* (Optional) Status of the alert rule.
|
|
688
|
+
*/
|
|
689
|
+
status?: AlertRuleStatus;
|
|
690
|
+
page?: number;
|
|
691
|
+
pageSize?: number;
|
|
692
|
+
};
|
|
693
|
+
export interface ListAlertRulesResponse {
|
|
694
|
+
/**
|
|
695
|
+
* Single page of alert rules matching the requested criteria.
|
|
696
|
+
*/
|
|
697
|
+
alertRules: AlertRule[];
|
|
698
|
+
/**
|
|
699
|
+
* Total count of alert rules matching the requested criteria.
|
|
700
|
+
*/
|
|
701
|
+
totalCount: number;
|
|
702
|
+
}
|
|
618
703
|
export type ListAuthenticationEventsRequest = {
|
|
619
704
|
/**
|
|
620
705
|
* Region to target. If none is passed will use default region from the config.
|
|
@@ -767,3 +852,23 @@ export interface ListProductsResponse {
|
|
|
767
852
|
*/
|
|
768
853
|
totalCount: number;
|
|
769
854
|
}
|
|
855
|
+
export type SetEnabledAlertRulesRequest = {
|
|
856
|
+
/**
|
|
857
|
+
* Region to target. If none is passed will use default region from the config.
|
|
858
|
+
*/
|
|
859
|
+
region?: ScwRegion;
|
|
860
|
+
/**
|
|
861
|
+
* ID of the Organization to target.
|
|
862
|
+
*/
|
|
863
|
+
organizationId?: string;
|
|
864
|
+
/**
|
|
865
|
+
* List of IDs of the rules that must be enabled after the update.
|
|
866
|
+
*/
|
|
867
|
+
enabledAlertRuleIds?: string[];
|
|
868
|
+
};
|
|
869
|
+
export interface SetEnabledAlertRulesResponse {
|
|
870
|
+
/**
|
|
871
|
+
* List of the rules that were enabled.
|
|
872
|
+
*/
|
|
873
|
+
alertRules: AlertRule[];
|
|
874
|
+
}
|