Skip to content

Commit 4a7248c

Browse files
authored
Merge branch 'main' into v1.6745.0
2 parents 4c0f263 + babbfe9 commit 4a7248c

File tree

6 files changed

+128
-0
lines changed

6 files changed

+128
-0
lines changed

packages_generated/applesilicon/src/v1alpha1/api.gen.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ import {
1414
SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_APPLESILICON,
1515
} from './content.gen'
1616
import {
17+
marshalBatchCreateServersRequest,
1718
marshalCreateServerRequest,
1819
marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
1920
marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
2021
marshalReinstallServerRequest,
2122
marshalStartConnectivityDiagnosticRequest,
2223
marshalUpdateServerRequest,
24+
unmarshalBatchCreateServersResponse,
2325
unmarshalConnectivityDiagnostic,
2426
unmarshalListOSResponse,
2527
unmarshalListServerPrivateNetworksResponse,
@@ -33,6 +35,8 @@ import {
3335
unmarshalStartConnectivityDiagnosticResponse,
3436
} from './marshalling.gen'
3537
import type {
38+
BatchCreateServersRequest,
39+
BatchCreateServersResponse,
3640
ConnectivityDiagnostic,
3741
CreateServerRequest,
3842
DeleteServerRequest,
@@ -131,6 +135,25 @@ export class API extends ParentAPI {
131135
unmarshalServer,
132136
)
133137

138+
/**
139+
* Create multiple servers atomically. Create multiple servers in the targeted zone specifying their configurations. If the request cannot entirely be fullfilled, no servers are created.
140+
*
141+
* @param request - The request {@link BatchCreateServersRequest}
142+
* @returns A Promise of BatchCreateServersResponse
143+
*/
144+
batchCreateServers = (request: Readonly<BatchCreateServersRequest>) =>
145+
this.client.fetch<BatchCreateServersResponse>(
146+
{
147+
body: JSON.stringify(
148+
marshalBatchCreateServersRequest(request, this.client.settings),
149+
),
150+
headers: jsonContentHeaders,
151+
method: 'POST',
152+
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/batch-create-servers`,
153+
},
154+
unmarshalBatchCreateServersResponse,
155+
)
156+
134157
protected pageOfListServers = (request: Readonly<ListServersRequest> = {}) =>
135158
this.client.fetch<ListServersResponse>(
136159
{

packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import {
88
} from '@scaleway/sdk-client'
99
import type { DefaultValues } from '@scaleway/sdk-client'
1010
import type {
11+
BatchCreateServersRequest,
12+
BatchCreateServersRequestBatchInnerCreateServerRequest,
13+
BatchCreateServersResponse,
1114
Commitment,
1215
CommitmentTypeValue,
1316
ConnectivityDiagnostic,
@@ -211,6 +214,20 @@ export const unmarshalServerType = (data: unknown): ServerType => {
211214
} as ServerType
212215
}
213216

217+
export const unmarshalBatchCreateServersResponse = (
218+
data: unknown,
219+
): BatchCreateServersResponse => {
220+
if (!isJSONObject(data)) {
221+
throw new TypeError(
222+
`Unmarshalling the type 'BatchCreateServersResponse' failed as data isn't a dictionary.`,
223+
)
224+
}
225+
226+
return {
227+
servers: unmarshalArrayOfObject(data.servers, unmarshalServer),
228+
} as BatchCreateServersResponse
229+
}
230+
214231
const unmarshalConnectivityDiagnosticServerHealth = (
215232
data: unknown,
216233
): ConnectivityDiagnosticServerHealth => {
@@ -342,6 +359,34 @@ export const unmarshalStartConnectivityDiagnosticResponse = (
342359
} as StartConnectivityDiagnosticResponse
343360
}
344361

362+
const marshalBatchCreateServersRequestBatchInnerCreateServerRequest = (
363+
request: BatchCreateServersRequestBatchInnerCreateServerRequest,
364+
defaults: DefaultValues,
365+
): Record<string, unknown> => ({
366+
name: request.name,
367+
})
368+
369+
export const marshalBatchCreateServersRequest = (
370+
request: BatchCreateServersRequest,
371+
defaults: DefaultValues,
372+
): Record<string, unknown> => ({
373+
commitment_type: request.commitmentType,
374+
enable_vpc: request.enableVpc,
375+
os_id: request.osId,
376+
project_id: request.projectId ?? defaults.defaultProjectId,
377+
public_bandwidth_bps: request.publicBandwidthBps,
378+
requests:
379+
request.requests !== undefined
380+
? request.requests.map(elt =>
381+
marshalBatchCreateServersRequestBatchInnerCreateServerRequest(
382+
elt,
383+
defaults,
384+
),
385+
)
386+
: undefined,
387+
type: request.type,
388+
})
389+
345390
export const marshalCreateServerRequest = (
346391
request: CreateServerRequest,
347392
defaults: DefaultValues,

packages_generated/applesilicon/src/v1alpha1/types.gen.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ export interface ServerTypeNetwork {
124124
supportedBandwidth: number[]
125125
}
126126

127+
export interface BatchCreateServersRequestBatchInnerCreateServerRequest {
128+
name: string
129+
}
130+
127131
export interface Server {
128132
/**
129133
* UUID of the server.
@@ -302,6 +306,48 @@ export interface CommitmentTypeValue {
302306
commitmentType: CommitmentType
303307
}
304308

309+
export type BatchCreateServersRequest = {
310+
/**
311+
* Zone to target. If none is passed will use default zone from the config.
312+
*/
313+
zone?: ScwZone
314+
/**
315+
* Create servers in the given project ID.
316+
*/
317+
projectId?: string
318+
/**
319+
* Create servers of the given type.
320+
*/
321+
type: string
322+
/**
323+
* Create servers & install the given os_id, when no os_id provided the default OS for this server type is chosen. Requesting a non-default OS will induce an extended delivery time.
324+
*/
325+
osId?: string
326+
/**
327+
* Activate the Private Network feature for these servers. This feature is configured through the Apple Silicon - Private Networks API.
328+
*/
329+
enableVpc: boolean
330+
/**
331+
* Activate commitment for these servers. If not specified, there is a 24h commitment due to Apple licensing (commitment_type `duration_24h`). It can be updated with the Update Server request. Available commitment depends on server type.
332+
*/
333+
commitmentType?: CommitmentType
334+
/**
335+
* Public bandwidth to configure for these servers. This defaults to the minimum bandwidth for the corresponding server type. For compatible server types, the bandwidth can be increased which incurs additional costs.
336+
*/
337+
publicBandwidthBps: number
338+
/**
339+
* List of servers to create.
340+
*/
341+
requests?: BatchCreateServersRequestBatchInnerCreateServerRequest[]
342+
}
343+
344+
export interface BatchCreateServersResponse {
345+
/**
346+
* List of created servers.
347+
*/
348+
servers: Server[]
349+
}
350+
305351
export interface ConnectivityDiagnostic {
306352
id: string
307353
status: ConnectivityDiagnosticDiagnosticStatus

packages_generated/k8s/src/v1/marshalling.gen.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ export const unmarshalNodeMetadata = (data: unknown): NodeMetadata => {
528528
externalIp: data.external_ip,
529529
hasGpu: data.has_gpu,
530530
id: data.id,
531+
installerTags: data.installer_tags,
531532
kubeletConfig: data.kubelet_config,
532533
name: data.name,
533534
nodeLabels: data.node_labels,
@@ -536,7 +537,12 @@ export const unmarshalNodeMetadata = (data: unknown): NodeMetadata => {
536537
unmarshalNodeMetadataCoreV1Taint,
537538
),
538539
poolVersion: data.pool_version,
540+
providerId: data.provider_id,
539541
repoUri: data.repo_uri,
542+
resolvconfPath: data.resolvconf_path,
543+
updaterBinPath: data.updater_bin_path,
544+
updaterBinUrl: data.updater_bin_url,
545+
updaterBinVersion: data.updater_bin_version,
540546
} as NodeMetadata
541547
}
542548

packages_generated/k8s/src/v1/types.gen.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,9 +1500,15 @@ export interface NodeMetadata {
15001500
kubeletConfig: string
15011501
nodeLabels: Record<string, string>
15021502
nodeTaints: NodeMetadataCoreV1Taint[]
1503+
providerId: string
1504+
resolvconfPath: string
15031505
hasGpu: boolean
15041506
externalIp: string
15051507
repoUri: string
1508+
installerTags: string[]
1509+
updaterBinUrl: string
1510+
updaterBinVersion: string
1511+
updaterBinPath: string
15061512
}
15071513

15081514
export type RebootNodeRequest = {

packages_generated/tem/src/v1alpha1/validation-rules.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const CreateDomainRequest = {
1616

1717
export const CreateEmailRequest = {
1818
subject: {
19+
maxLength: 998,
1920
minLength: 6,
2021
},
2122
}
@@ -88,6 +89,7 @@ export const ListEmailsRequest = {
8889
minLength: 3,
8990
},
9091
subject: {
92+
maxLength: 998,
9193
minLength: 6,
9294
},
9395
}

0 commit comments

Comments
 (0)