@scaleway/sdk 2.30.0 → 2.32.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/api/applesilicon/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.cjs +23 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +23 -0
- package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +11 -0
- package/dist/api/baremetal/v1/api.gen.cjs +1 -0
- package/dist/api/baremetal/v1/api.gen.js +1 -0
- package/dist/api/baremetal/v1/types.gen.d.ts +2 -0
- package/dist/api/block/v1alpha1/api.gen.cjs +44 -0
- package/dist/api/block/v1alpha1/api.gen.d.ts +19 -1
- package/dist/api/block/v1alpha1/api.gen.js +45 -1
- package/dist/api/block/v1alpha1/content.gen.cjs +4 -2
- package/dist/api/block/v1alpha1/content.gen.js +4 -2
- package/dist/api/block/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/block/v1alpha1/marshalling.gen.cjs +14 -0
- package/dist/api/block/v1alpha1/marshalling.gen.d.ts +3 -1
- package/dist/api/block/v1alpha1/marshalling.gen.js +14 -0
- package/dist/api/block/v1alpha1/types.gen.d.ts +28 -2
- package/dist/api/block/v1alpha1/validation-rules.gen.cjs +6 -0
- package/dist/api/block/v1alpha1/validation-rules.gen.d.ts +5 -0
- package/dist/api/block/v1alpha1/validation-rules.gen.js +6 -0
- package/dist/api/instance/v1/marshalling.gen.cjs +5 -0
- package/dist/api/instance/v1/marshalling.gen.js +5 -0
- package/dist/api/instance/v1/types.gen.d.ts +21 -0
- package/dist/api/instance/v1/types.private.gen.d.ts +7 -0
- package/dist/api/k8s/v1/api.gen.cjs +0 -22
- package/dist/api/k8s/v1/api.gen.d.ts +1 -10
- package/dist/api/k8s/v1/api.gen.js +1 -23
- package/dist/api/k8s/v1/index.gen.d.ts +1 -1
- package/dist/api/k8s/v1/marshalling.gen.cjs +0 -4
- package/dist/api/k8s/v1/marshalling.gen.d.ts +1 -2
- package/dist/api/k8s/v1/marshalling.gen.js +0 -4
- package/dist/api/k8s/v1/types.gen.d.ts +0 -11
- package/dist/api/secret/v1beta1/types.gen.d.ts +4 -4
- package/dist/api/tem/v1alpha1/api.gen.cjs +49 -0
- package/dist/api/tem/v1alpha1/api.gen.d.ts +13 -1
- package/dist/api/tem/v1alpha1/api.gen.js +50 -1
- package/dist/api/tem/v1alpha1/index.gen.cjs +2 -0
- package/dist/api/tem/v1alpha1/index.gen.d.ts +2 -1
- package/dist/api/tem/v1alpha1/index.gen.js +3 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.cjs +71 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.d.ts +5 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.js +72 -1
- package/dist/api/tem/v1alpha1/types.gen.d.ts +115 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.cjs +33 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.d.ts +28 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.js +33 -0
- package/dist/api/vpc/v2/api.gen.cjs +28 -1
- package/dist/api/vpc/v2/api.gen.d.ts +14 -2
- package/dist/api/vpc/v2/api.gen.js +29 -2
- package/dist/api/vpc/v2/index.gen.d.ts +1 -1
- package/dist/api/vpc/v2/marshalling.gen.cjs +16 -1
- package/dist/api/vpc/v2/marshalling.gen.d.ts +2 -1
- package/dist/api/vpc/v2/marshalling.gen.js +16 -1
- package/dist/api/vpc/v2/types.gen.d.ts +41 -0
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -6,6 +6,10 @@ export type EmailFlag = 'unknown_flag' | 'soft_bounce' | 'hard_bounce' | 'spam'
|
|
|
6
6
|
export type EmailRcptType = 'unknown_rcpt_type' | 'to' | 'cc' | 'bcc';
|
|
7
7
|
export type EmailStatus = 'unknown' | 'new' | 'sending' | 'sent' | 'failed' | 'canceled';
|
|
8
8
|
export type ListEmailsRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'updated_at_desc' | 'updated_at_asc' | 'status_desc' | 'status_asc' | 'mail_from_desc' | 'mail_from_asc' | 'mail_rcpt_desc' | 'mail_rcpt_asc' | 'subject_desc' | 'subject_asc';
|
|
9
|
+
export type ListWebhookEventsRequestOrderBy = 'created_at_desc' | 'created_at_asc';
|
|
10
|
+
export type ListWebhooksRequestOrderBy = 'created_at_desc' | 'created_at_asc';
|
|
11
|
+
export type WebhookEventStatus = 'unknown_status' | 'waiting' | 'sending' | 'sent' | 'error';
|
|
12
|
+
export type WebhookEventType = 'unknown_type' | 'email_queued' | 'email_dropped' | 'email_deferred' | 'email_delivered' | 'email_spam' | 'email_mailbox_not_found';
|
|
9
13
|
export interface DomainRecordsDMARC {
|
|
10
14
|
/** Name of the DMARC TXT record. */
|
|
11
15
|
name: string;
|
|
@@ -173,6 +177,48 @@ export interface Domain {
|
|
|
173
177
|
*/
|
|
174
178
|
region: Region;
|
|
175
179
|
}
|
|
180
|
+
export interface WebhookEvent {
|
|
181
|
+
/** ID of the Webhook Event. */
|
|
182
|
+
id: string;
|
|
183
|
+
/** ID of the Webhook that triggers the Event. */
|
|
184
|
+
webhookId: string;
|
|
185
|
+
/** ID of the Webhook Event Organization. */
|
|
186
|
+
organizationId: string;
|
|
187
|
+
/** ID of the Webhook Event Project. */
|
|
188
|
+
projectId: string;
|
|
189
|
+
/** Type of the Webhook Event. */
|
|
190
|
+
type: WebhookEventType;
|
|
191
|
+
/** Status of the Webhook Event. */
|
|
192
|
+
status: WebhookEventStatus;
|
|
193
|
+
/** Data sent to the Webhook destination. */
|
|
194
|
+
data: string;
|
|
195
|
+
/** Date and time of the Webhook Event creation. */
|
|
196
|
+
createdAt?: Date;
|
|
197
|
+
/** Date and time of last Webhook Event updates. */
|
|
198
|
+
updatedAt?: Date;
|
|
199
|
+
/** Optional Email ID if the event is triggered by an Email resource. */
|
|
200
|
+
emailId?: string;
|
|
201
|
+
}
|
|
202
|
+
export interface Webhook {
|
|
203
|
+
/** ID of the Webhook. */
|
|
204
|
+
id: string;
|
|
205
|
+
/** ID of the Domain to watch for triggering events. */
|
|
206
|
+
domainId: string;
|
|
207
|
+
/** ID of the Webhook Organization. */
|
|
208
|
+
organizationId: string;
|
|
209
|
+
/** ID of the Webhook Project. */
|
|
210
|
+
projectId: string;
|
|
211
|
+
/** Name of the Webhook. */
|
|
212
|
+
name: string;
|
|
213
|
+
/** List of event types that will trigger a Webhook Event. */
|
|
214
|
+
eventTypes: WebhookEventType[];
|
|
215
|
+
/** Scaleway SNS ARN topic to push the events to. */
|
|
216
|
+
snsArn: string;
|
|
217
|
+
/** Date and time of the Webhook creation. */
|
|
218
|
+
createdAt?: Date;
|
|
219
|
+
/** Date and time of last Webhook updates. */
|
|
220
|
+
updatedAt?: Date;
|
|
221
|
+
}
|
|
176
222
|
export type CancelEmailRequest = {
|
|
177
223
|
/**
|
|
178
224
|
* Region to target. If none is passed will use default region from the
|
|
@@ -237,6 +283,15 @@ export interface CreateEmailResponse {
|
|
|
237
283
|
/** Single page of emails matching the requested criteria. */
|
|
238
284
|
emails: Email[];
|
|
239
285
|
}
|
|
286
|
+
export type DeleteWebhookRequest = {
|
|
287
|
+
/**
|
|
288
|
+
* Region to target. If none is passed will use default region from the
|
|
289
|
+
* config.
|
|
290
|
+
*/
|
|
291
|
+
region?: Region;
|
|
292
|
+
/** ID of the Webhook to delete. */
|
|
293
|
+
webhookId: string;
|
|
294
|
+
};
|
|
240
295
|
export interface DomainLastStatus {
|
|
241
296
|
/** The ID of the domain. */
|
|
242
297
|
domainId: string;
|
|
@@ -318,6 +373,7 @@ export type ListDomainsRequest = {
|
|
|
318
373
|
export interface ListDomainsResponse {
|
|
319
374
|
/** Number of domains that match the request (without pagination). */
|
|
320
375
|
totalCount: number;
|
|
376
|
+
/** Single page of domains matching the requested criteria. */
|
|
321
377
|
domains: Domain[];
|
|
322
378
|
}
|
|
323
379
|
export type ListEmailsRequest = {
|
|
@@ -361,6 +417,50 @@ export interface ListEmailsResponse {
|
|
|
361
417
|
/** Single page of emails matching the requested criteria. */
|
|
362
418
|
emails: Email[];
|
|
363
419
|
}
|
|
420
|
+
export type ListWebhookEventsRequest = {
|
|
421
|
+
/**
|
|
422
|
+
* Region to target. If none is passed will use default region from the
|
|
423
|
+
* config.
|
|
424
|
+
*/
|
|
425
|
+
region?: Region;
|
|
426
|
+
/** ID of the Webhook linked to the events. */
|
|
427
|
+
webhookId: string;
|
|
428
|
+
/** (Optional) List Webhook events corresponding to specific criteria. */
|
|
429
|
+
orderBy?: ListWebhookEventsRequestOrderBy;
|
|
430
|
+
/** Requested page number. Value must be greater or equal to 1. */
|
|
431
|
+
page?: number;
|
|
432
|
+
/** Requested page size. Value must be between 1 and 100. */
|
|
433
|
+
pageSize?: number;
|
|
434
|
+
};
|
|
435
|
+
export interface ListWebhookEventsResponse {
|
|
436
|
+
/** Number of Webhook events matching the requested criteria. */
|
|
437
|
+
totalCount: number;
|
|
438
|
+
/** Single page of Webhook events matching the requested criteria. */
|
|
439
|
+
webhookEvents: WebhookEvent[];
|
|
440
|
+
}
|
|
441
|
+
export type ListWebhooksRequest = {
|
|
442
|
+
/**
|
|
443
|
+
* Region to target. If none is passed will use default region from the
|
|
444
|
+
* config.
|
|
445
|
+
*/
|
|
446
|
+
region?: Region;
|
|
447
|
+
/** (Optional) List Webhooks corresponding to specific criteria. */
|
|
448
|
+
orderBy?: ListWebhooksRequestOrderBy;
|
|
449
|
+
/** (Optional) Requested page number. Value must be greater or equal to 1. */
|
|
450
|
+
page?: number;
|
|
451
|
+
/** (Optional) Requested page size. Value must be between 1 and 100. */
|
|
452
|
+
pageSize?: number;
|
|
453
|
+
/** (Optional) ID of the Project for which to list the Webhooks. */
|
|
454
|
+
projectId?: string;
|
|
455
|
+
/** (Optional) ID of the Organization for which to list the Webhooks. */
|
|
456
|
+
organizationId?: string;
|
|
457
|
+
};
|
|
458
|
+
export interface ListWebhooksResponse {
|
|
459
|
+
/** Number of Webhooks matching the requested criteria. */
|
|
460
|
+
totalCount: number;
|
|
461
|
+
/** Single page of Webhooks matching the requested criteria. */
|
|
462
|
+
webhooks: Webhook[];
|
|
463
|
+
}
|
|
364
464
|
export type RevokeDomainRequest = {
|
|
365
465
|
/**
|
|
366
466
|
* Region to target. If none is passed will use default region from the
|
|
@@ -399,3 +499,18 @@ export interface Statistics {
|
|
|
399
499
|
*/
|
|
400
500
|
canceledCount: number;
|
|
401
501
|
}
|
|
502
|
+
export type UpdateWebhookRequest = {
|
|
503
|
+
/**
|
|
504
|
+
* Region to target. If none is passed will use default region from the
|
|
505
|
+
* config.
|
|
506
|
+
*/
|
|
507
|
+
region?: Region;
|
|
508
|
+
/** ID of the Webhook to update. */
|
|
509
|
+
webhookId: string;
|
|
510
|
+
/** Name of the Webhook to update. */
|
|
511
|
+
name?: string;
|
|
512
|
+
/** List of event types to update. */
|
|
513
|
+
eventTypes?: WebhookEventType[];
|
|
514
|
+
/** Scaleway SNS ARN topic to update. */
|
|
515
|
+
snsArn?: string;
|
|
516
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const ListWebhookEventsRequest = {
|
|
4
|
+
page: {
|
|
5
|
+
greaterThan: 0
|
|
6
|
+
},
|
|
7
|
+
pageSize: {
|
|
8
|
+
greaterThanOrEqual: 1,
|
|
9
|
+
lessThanOrEqual: 100
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const ListWebhooksRequest = {
|
|
13
|
+
page: {
|
|
14
|
+
greaterThan: 0
|
|
15
|
+
},
|
|
16
|
+
pageSize: {
|
|
17
|
+
greaterThanOrEqual: 1,
|
|
18
|
+
lessThanOrEqual: 100
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const UpdateWebhookRequest = {
|
|
22
|
+
name: {
|
|
23
|
+
maxLength: 127,
|
|
24
|
+
minLength: 3
|
|
25
|
+
},
|
|
26
|
+
snsArn: {
|
|
27
|
+
maxLength: 127,
|
|
28
|
+
minLength: 3
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.ListWebhookEventsRequest = ListWebhookEventsRequest;
|
|
32
|
+
exports.ListWebhooksRequest = ListWebhooksRequest;
|
|
33
|
+
exports.UpdateWebhookRequest = UpdateWebhookRequest;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const ListWebhookEventsRequest: {
|
|
2
|
+
page: {
|
|
3
|
+
greaterThan: number;
|
|
4
|
+
};
|
|
5
|
+
pageSize: {
|
|
6
|
+
greaterThanOrEqual: number;
|
|
7
|
+
lessThanOrEqual: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare const ListWebhooksRequest: {
|
|
11
|
+
page: {
|
|
12
|
+
greaterThan: number;
|
|
13
|
+
};
|
|
14
|
+
pageSize: {
|
|
15
|
+
greaterThanOrEqual: number;
|
|
16
|
+
lessThanOrEqual: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const UpdateWebhookRequest: {
|
|
20
|
+
name: {
|
|
21
|
+
maxLength: number;
|
|
22
|
+
minLength: number;
|
|
23
|
+
};
|
|
24
|
+
snsArn: {
|
|
25
|
+
maxLength: number;
|
|
26
|
+
minLength: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const ListWebhookEventsRequest = {
|
|
2
|
+
page: {
|
|
3
|
+
greaterThan: 0
|
|
4
|
+
},
|
|
5
|
+
pageSize: {
|
|
6
|
+
greaterThanOrEqual: 1,
|
|
7
|
+
lessThanOrEqual: 100
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
const ListWebhooksRequest = {
|
|
11
|
+
page: {
|
|
12
|
+
greaterThan: 0
|
|
13
|
+
},
|
|
14
|
+
pageSize: {
|
|
15
|
+
greaterThanOrEqual: 1,
|
|
16
|
+
lessThanOrEqual: 100
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const UpdateWebhookRequest = {
|
|
20
|
+
name: {
|
|
21
|
+
maxLength: 127,
|
|
22
|
+
minLength: 3
|
|
23
|
+
},
|
|
24
|
+
snsArn: {
|
|
25
|
+
maxLength: 127,
|
|
26
|
+
minLength: 3
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
ListWebhookEventsRequest,
|
|
31
|
+
ListWebhooksRequest,
|
|
32
|
+
UpdateWebhookRequest
|
|
33
|
+
};
|
|
@@ -244,8 +244,35 @@ class API extends api.API {
|
|
|
244
244
|
},
|
|
245
245
|
marshalling_gen.unmarshalVPC
|
|
246
246
|
);
|
|
247
|
+
pageOfListSubnets = (request = {}) => this.client.fetch(
|
|
248
|
+
{
|
|
249
|
+
method: "GET",
|
|
250
|
+
path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subnets`,
|
|
251
|
+
urlParams: marshalling.urlParams(
|
|
252
|
+
["order_by", request.orderBy],
|
|
253
|
+
["organization_id", request.organizationId],
|
|
254
|
+
["page", request.page],
|
|
255
|
+
[
|
|
256
|
+
"page_size",
|
|
257
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
258
|
+
],
|
|
259
|
+
["project_id", request.projectId],
|
|
260
|
+
["subnet_ids", request.subnetIds],
|
|
261
|
+
["vpc_id", request.vpcId]
|
|
262
|
+
)
|
|
263
|
+
},
|
|
264
|
+
marshalling_gen.unmarshalListSubnetsResponse
|
|
265
|
+
);
|
|
266
|
+
/**
|
|
267
|
+
* List subnets. List any Private Network's subnets. See ListPrivateNetworks
|
|
268
|
+
* to list a specific Private Network's subnets.
|
|
269
|
+
*
|
|
270
|
+
* @param request - The request {@link ListSubnetsRequest}
|
|
271
|
+
* @returns A Promise of ListSubnetsResponse
|
|
272
|
+
*/
|
|
273
|
+
listSubnets = (request = {}) => resourcePaginator.enrichForPagination("subnets", this.pageOfListSubnets, request);
|
|
247
274
|
/**
|
|
248
|
-
* Set
|
|
275
|
+
* Set a Private Network's subnets. Set subnets for an existing Private
|
|
249
276
|
* Network. Note that the method is PUT and not PATCH. Any existing subnets
|
|
250
277
|
* will be removed in favor of the new specified set of subnets.
|
|
251
278
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as ParentAPI } from '../../../bridge';
|
|
2
2
|
import type { Region } from '../../../bridge';
|
|
3
|
-
import type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableDHCPRequest, EnableRoutingRequest, GetPrivateNetworkRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksResponse, ListVPCsRequest, ListVPCsResponse, MigrateZonalPrivateNetworksRequest, PrivateNetwork, SetSubnetsRequest, SetSubnetsResponse, UpdatePrivateNetworkRequest, UpdateVPCRequest, VPC } from './types.gen';
|
|
3
|
+
import type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableDHCPRequest, EnableRoutingRequest, GetPrivateNetworkRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsResponse, ListVPCsRequest, ListVPCsResponse, MigrateZonalPrivateNetworksRequest, PrivateNetwork, SetSubnetsRequest, SetSubnetsResponse, UpdatePrivateNetworkRequest, UpdateVPCRequest, VPC } from './types.gen';
|
|
4
4
|
/**
|
|
5
5
|
* VPC API.
|
|
6
6
|
*
|
|
@@ -121,8 +121,20 @@ export declare class API extends ParentAPI {
|
|
|
121
121
|
* @returns A Promise of VPC
|
|
122
122
|
*/
|
|
123
123
|
enableRouting: (request: Readonly<EnableRoutingRequest>) => Promise<VPC>;
|
|
124
|
+
protected pageOfListSubnets: (request?: Readonly<ListSubnetsRequest>) => Promise<ListSubnetsResponse>;
|
|
124
125
|
/**
|
|
125
|
-
*
|
|
126
|
+
* List subnets. List any Private Network's subnets. See ListPrivateNetworks
|
|
127
|
+
* to list a specific Private Network's subnets.
|
|
128
|
+
*
|
|
129
|
+
* @param request - The request {@link ListSubnetsRequest}
|
|
130
|
+
* @returns A Promise of ListSubnetsResponse
|
|
131
|
+
*/
|
|
132
|
+
listSubnets: (request?: Readonly<ListSubnetsRequest>) => Promise<ListSubnetsResponse> & {
|
|
133
|
+
all: () => Promise<import("./types.gen").Subnet[]>;
|
|
134
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").Subnet[], void, void>;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Set a Private Network's subnets. Set subnets for an existing Private
|
|
126
138
|
* Network. Note that the method is PUT and not PATCH. Any existing subnets
|
|
127
139
|
* will be removed in favor of the new specified set of subnets.
|
|
128
140
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { API as API$1 } from "../../../scw/api.js";
|
|
2
2
|
import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
|
|
3
3
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
4
|
-
import { unmarshalListVPCsResponse, marshalCreateVPCRequest, unmarshalVPC, marshalUpdateVPCRequest, unmarshalListPrivateNetworksResponse, marshalCreatePrivateNetworkRequest, unmarshalPrivateNetwork, marshalUpdatePrivateNetworkRequest, marshalMigrateZonalPrivateNetworksRequest, marshalSetSubnetsRequest, unmarshalSetSubnetsResponse, marshalAddSubnetsRequest, unmarshalAddSubnetsResponse, marshalDeleteSubnetsRequest, unmarshalDeleteSubnetsResponse } from "./marshalling.gen.js";
|
|
4
|
+
import { unmarshalListVPCsResponse, marshalCreateVPCRequest, unmarshalVPC, marshalUpdateVPCRequest, unmarshalListPrivateNetworksResponse, marshalCreatePrivateNetworkRequest, unmarshalPrivateNetwork, marshalUpdatePrivateNetworkRequest, marshalMigrateZonalPrivateNetworksRequest, unmarshalListSubnetsResponse, marshalSetSubnetsRequest, unmarshalSetSubnetsResponse, marshalAddSubnetsRequest, unmarshalAddSubnetsResponse, marshalDeleteSubnetsRequest, unmarshalDeleteSubnetsResponse } from "./marshalling.gen.js";
|
|
5
5
|
const jsonContentHeaders = {
|
|
6
6
|
"Content-Type": "application/json; charset=utf-8"
|
|
7
7
|
};
|
|
@@ -242,8 +242,35 @@ class API extends API$1 {
|
|
|
242
242
|
},
|
|
243
243
|
unmarshalVPC
|
|
244
244
|
);
|
|
245
|
+
pageOfListSubnets = (request = {}) => this.client.fetch(
|
|
246
|
+
{
|
|
247
|
+
method: "GET",
|
|
248
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subnets`,
|
|
249
|
+
urlParams: urlParams(
|
|
250
|
+
["order_by", request.orderBy],
|
|
251
|
+
["organization_id", request.organizationId],
|
|
252
|
+
["page", request.page],
|
|
253
|
+
[
|
|
254
|
+
"page_size",
|
|
255
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
256
|
+
],
|
|
257
|
+
["project_id", request.projectId],
|
|
258
|
+
["subnet_ids", request.subnetIds],
|
|
259
|
+
["vpc_id", request.vpcId]
|
|
260
|
+
)
|
|
261
|
+
},
|
|
262
|
+
unmarshalListSubnetsResponse
|
|
263
|
+
);
|
|
264
|
+
/**
|
|
265
|
+
* List subnets. List any Private Network's subnets. See ListPrivateNetworks
|
|
266
|
+
* to list a specific Private Network's subnets.
|
|
267
|
+
*
|
|
268
|
+
* @param request - The request {@link ListSubnetsRequest}
|
|
269
|
+
* @returns A Promise of ListSubnetsResponse
|
|
270
|
+
*/
|
|
271
|
+
listSubnets = (request = {}) => enrichForPagination("subnets", this.pageOfListSubnets, request);
|
|
245
272
|
/**
|
|
246
|
-
* Set
|
|
273
|
+
* Set a Private Network's subnets. Set subnets for an existing Private
|
|
247
274
|
* Network. Note that the method is PUT and not PATCH. Any existing subnets
|
|
248
275
|
* will be removed in favor of the new specified set of subnets.
|
|
249
276
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { API } from './api.gen';
|
|
2
|
-
export type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableDHCPRequest, EnableRoutingRequest, GetPrivateNetworkRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksRequestOrderBy, ListPrivateNetworksResponse, ListVPCsRequest, ListVPCsRequestOrderBy, ListVPCsResponse, MigrateZonalPrivateNetworksRequest, PrivateNetwork, SetSubnetsRequest, SetSubnetsResponse, Subnet, UpdatePrivateNetworkRequest, UpdateVPCRequest, VPC, } from './types.gen';
|
|
2
|
+
export type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableDHCPRequest, EnableRoutingRequest, GetPrivateNetworkRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksRequestOrderBy, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsRequestOrderBy, ListSubnetsResponse, ListVPCsRequest, ListVPCsRequestOrderBy, ListVPCsResponse, MigrateZonalPrivateNetworksRequest, PrivateNetwork, SetSubnetsRequest, SetSubnetsResponse, Subnet, UpdatePrivateNetworkRequest, UpdateVPCRequest, VPC, } from './types.gen';
|
|
@@ -12,8 +12,11 @@ const unmarshalSubnet = (data) => {
|
|
|
12
12
|
return {
|
|
13
13
|
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
14
14
|
id: data.id,
|
|
15
|
+
privateNetworkId: data.private_network_id,
|
|
16
|
+
projectId: data.project_id,
|
|
15
17
|
subnet: data.subnet,
|
|
16
|
-
updatedAt: marshalling.unmarshalDate(data.updated_at)
|
|
18
|
+
updatedAt: marshalling.unmarshalDate(data.updated_at),
|
|
19
|
+
vpcId: data.vpc_id
|
|
17
20
|
};
|
|
18
21
|
};
|
|
19
22
|
const unmarshalPrivateNetwork = (data) => {
|
|
@@ -90,6 +93,17 @@ const unmarshalListPrivateNetworksResponse = (data) => {
|
|
|
90
93
|
totalCount: data.total_count
|
|
91
94
|
};
|
|
92
95
|
};
|
|
96
|
+
const unmarshalListSubnetsResponse = (data) => {
|
|
97
|
+
if (!json.isJSONObject(data)) {
|
|
98
|
+
throw new TypeError(
|
|
99
|
+
`Unmarshalling the type 'ListSubnetsResponse' failed as data isn't a dictionary.`
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
subnets: marshalling.unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
|
|
104
|
+
totalCount: data.total_count
|
|
105
|
+
};
|
|
106
|
+
};
|
|
93
107
|
const unmarshalListVPCsResponse = (data) => {
|
|
94
108
|
if (!json.isJSONObject(data)) {
|
|
95
109
|
throw new TypeError(
|
|
@@ -167,6 +181,7 @@ exports.marshalUpdateVPCRequest = marshalUpdateVPCRequest;
|
|
|
167
181
|
exports.unmarshalAddSubnetsResponse = unmarshalAddSubnetsResponse;
|
|
168
182
|
exports.unmarshalDeleteSubnetsResponse = unmarshalDeleteSubnetsResponse;
|
|
169
183
|
exports.unmarshalListPrivateNetworksResponse = unmarshalListPrivateNetworksResponse;
|
|
184
|
+
exports.unmarshalListSubnetsResponse = unmarshalListSubnetsResponse;
|
|
170
185
|
exports.unmarshalListVPCsResponse = unmarshalListVPCsResponse;
|
|
171
186
|
exports.unmarshalPrivateNetwork = unmarshalPrivateNetwork;
|
|
172
187
|
exports.unmarshalSetSubnetsResponse = unmarshalSetSubnetsResponse;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { DefaultValues } from '../../../bridge';
|
|
2
|
-
import type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateVPCRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, ListPrivateNetworksResponse, ListVPCsResponse, MigrateZonalPrivateNetworksRequest, PrivateNetwork, SetSubnetsRequest, SetSubnetsResponse, UpdatePrivateNetworkRequest, UpdateVPCRequest, VPC } from './types.gen';
|
|
2
|
+
import type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateVPCRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, ListPrivateNetworksResponse, ListSubnetsResponse, ListVPCsResponse, MigrateZonalPrivateNetworksRequest, PrivateNetwork, SetSubnetsRequest, SetSubnetsResponse, UpdatePrivateNetworkRequest, UpdateVPCRequest, VPC } from './types.gen';
|
|
3
3
|
export declare const unmarshalPrivateNetwork: (data: unknown) => PrivateNetwork;
|
|
4
4
|
export declare const unmarshalVPC: (data: unknown) => VPC;
|
|
5
5
|
export declare const unmarshalAddSubnetsResponse: (data: unknown) => AddSubnetsResponse;
|
|
6
6
|
export declare const unmarshalDeleteSubnetsResponse: (data: unknown) => DeleteSubnetsResponse;
|
|
7
7
|
export declare const unmarshalListPrivateNetworksResponse: (data: unknown) => ListPrivateNetworksResponse;
|
|
8
|
+
export declare const unmarshalListSubnetsResponse: (data: unknown) => ListSubnetsResponse;
|
|
8
9
|
export declare const unmarshalListVPCsResponse: (data: unknown) => ListVPCsResponse;
|
|
9
10
|
export declare const unmarshalSetSubnetsResponse: (data: unknown) => SetSubnetsResponse;
|
|
10
11
|
export declare const marshalAddSubnetsRequest: (request: AddSubnetsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -10,8 +10,11 @@ const unmarshalSubnet = (data) => {
|
|
|
10
10
|
return {
|
|
11
11
|
createdAt: unmarshalDate(data.created_at),
|
|
12
12
|
id: data.id,
|
|
13
|
+
privateNetworkId: data.private_network_id,
|
|
14
|
+
projectId: data.project_id,
|
|
13
15
|
subnet: data.subnet,
|
|
14
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
16
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
17
|
+
vpcId: data.vpc_id
|
|
15
18
|
};
|
|
16
19
|
};
|
|
17
20
|
const unmarshalPrivateNetwork = (data) => {
|
|
@@ -88,6 +91,17 @@ const unmarshalListPrivateNetworksResponse = (data) => {
|
|
|
88
91
|
totalCount: data.total_count
|
|
89
92
|
};
|
|
90
93
|
};
|
|
94
|
+
const unmarshalListSubnetsResponse = (data) => {
|
|
95
|
+
if (!isJSONObject(data)) {
|
|
96
|
+
throw new TypeError(
|
|
97
|
+
`Unmarshalling the type 'ListSubnetsResponse' failed as data isn't a dictionary.`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
|
|
102
|
+
totalCount: data.total_count
|
|
103
|
+
};
|
|
104
|
+
};
|
|
91
105
|
const unmarshalListVPCsResponse = (data) => {
|
|
92
106
|
if (!isJSONObject(data)) {
|
|
93
107
|
throw new TypeError(
|
|
@@ -166,6 +180,7 @@ export {
|
|
|
166
180
|
unmarshalAddSubnetsResponse,
|
|
167
181
|
unmarshalDeleteSubnetsResponse,
|
|
168
182
|
unmarshalListPrivateNetworksResponse,
|
|
183
|
+
unmarshalListSubnetsResponse,
|
|
169
184
|
unmarshalListVPCsResponse,
|
|
170
185
|
unmarshalPrivateNetwork,
|
|
171
186
|
unmarshalSetSubnetsResponse,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Region } from '../../../bridge';
|
|
2
2
|
export type ListPrivateNetworksRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
|
|
3
|
+
export type ListSubnetsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
|
|
3
4
|
export type ListVPCsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
|
|
4
5
|
export interface Subnet {
|
|
5
6
|
/** ID of the subnet. */
|
|
@@ -10,6 +11,12 @@ export interface Subnet {
|
|
|
10
11
|
updatedAt?: Date;
|
|
11
12
|
/** Subnet CIDR. */
|
|
12
13
|
subnet: string;
|
|
14
|
+
/** Scaleway Project the subnet belongs to. */
|
|
15
|
+
projectId: string;
|
|
16
|
+
/** Private Network the subnet belongs to. */
|
|
17
|
+
privateNetworkId: string;
|
|
18
|
+
/** VPC the subnet belongs to. */
|
|
19
|
+
vpcId: string;
|
|
13
20
|
}
|
|
14
21
|
export interface PrivateNetwork {
|
|
15
22
|
/** Private Network ID. */
|
|
@@ -224,6 +231,40 @@ export interface ListPrivateNetworksResponse {
|
|
|
224
231
|
privateNetworks: PrivateNetwork[];
|
|
225
232
|
totalCount: number;
|
|
226
233
|
}
|
|
234
|
+
export type ListSubnetsRequest = {
|
|
235
|
+
/**
|
|
236
|
+
* Region to target. If none is passed will use default region from the
|
|
237
|
+
* config.
|
|
238
|
+
*/
|
|
239
|
+
region?: Region;
|
|
240
|
+
/** Sort order of the returned subnets. */
|
|
241
|
+
orderBy?: ListSubnetsRequestOrderBy;
|
|
242
|
+
/** Page number to return, from the paginated results. */
|
|
243
|
+
page?: number;
|
|
244
|
+
/** Maximum number of Private Networks to return per page. */
|
|
245
|
+
pageSize?: number;
|
|
246
|
+
/**
|
|
247
|
+
* Organization ID to filter for. Only subnets belonging to this Organization
|
|
248
|
+
* will be returned.
|
|
249
|
+
*/
|
|
250
|
+
organizationId?: string;
|
|
251
|
+
/**
|
|
252
|
+
* Project ID to filter for. Only subnets belonging to this Project will be
|
|
253
|
+
* returned.
|
|
254
|
+
*/
|
|
255
|
+
projectId?: string;
|
|
256
|
+
/**
|
|
257
|
+
* Subnet IDs to filter for. Only subnets matching the specified IDs will be
|
|
258
|
+
* returned.
|
|
259
|
+
*/
|
|
260
|
+
subnetIds?: string[];
|
|
261
|
+
/** VPC ID to filter for. Only subnets belonging to this VPC will be returned. */
|
|
262
|
+
vpcId?: string;
|
|
263
|
+
};
|
|
264
|
+
export interface ListSubnetsResponse {
|
|
265
|
+
subnets: Subnet[];
|
|
266
|
+
totalCount: number;
|
|
267
|
+
}
|
|
227
268
|
export type ListVPCsRequest = {
|
|
228
269
|
/**
|
|
229
270
|
* Region to target. If none is passed will use default region from the
|
package/dist/scw/constants.cjs
CHANGED
package/dist/scw/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "v2.
|
|
2
|
-
export declare const userAgent = "scaleway-sdk-js/v2.
|
|
1
|
+
export declare const version = "v2.31.0";
|
|
2
|
+
export declare const userAgent = "scaleway-sdk-js/v2.31.0";
|
package/dist/scw/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.32.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Scaleway SDK.",
|
|
6
6
|
"keywords": [
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"bundledDependencies": [
|
|
40
40
|
"@scaleway/random-name"
|
|
41
41
|
],
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "8cdb5b0a6e64ec28b1e39627fb0de8b6ce0ef2e8"
|
|
43
43
|
}
|