Skip to content

Commit 2e89339

Browse files
authored
feat(apple_silicon): add public bandwidth configuration feature (#2170)
1 parent 4c819f5 commit 2e89339

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => {
138138

139139
return {
140140
publicBandwidthBps: data.public_bandwidth_bps,
141+
supportedBandwidth: data.supported_bandwidth,
141142
} as ServerTypeNetwork
142143
}
143144

@@ -197,6 +198,7 @@ export const unmarshalServer = (data: unknown): Server => {
197198
organizationId: data.organization_id,
198199
os: data.os ? unmarshalOS(data.os) : undefined,
199200
projectId: data.project_id,
201+
publicBandwidthBps: data.public_bandwidth_bps,
200202
sshUsername: data.ssh_username,
201203
status: data.status,
202204
sudoPassword: data.sudo_password,
@@ -349,6 +351,7 @@ export const marshalCreateServerRequest = (
349351
name: request.name || randomName('as'),
350352
os_id: request.osId,
351353
project_id: request.projectId ?? defaults.defaultProjectId,
354+
public_bandwidth_bps: request.publicBandwidthBps,
352355
type: request.type,
353356
})
354357

@@ -398,5 +401,6 @@ export const marshalUpdateServerRequest = (
398401
: undefined,
399402
enable_vpc: request.enableVpc,
400403
name: request.name,
404+
public_bandwidth_bps: request.publicBandwidthBps,
401405
schedule_deletion: request.scheduleDeletion,
402406
})

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export interface ServerTypeMemory {
116116

117117
export interface ServerTypeNetwork {
118118
publicBandwidthBps: number
119+
supportedBandwidth: number[]
119120
}
120121

121122
export interface Commitment {
@@ -291,6 +292,10 @@ export interface Server {
291292
* Commitment scheme applied to this server.
292293
*/
293294
commitment?: Commitment
295+
/**
296+
* Public bandwidth configured for this server. Expressed in bits per second.
297+
*/
298+
publicBandwidthBps: number
294299
}
295300

296301
export interface CommitmentTypeValue {
@@ -335,6 +340,10 @@ export type CreateServerRequest = {
335340
* Activate commitment for this server. 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.
336341
*/
337342
commitmentType?: CommitmentType
343+
/**
344+
* Public bandwidth to configure for this server. This defaults to the minimum bandwidth for this server type. For compatible server types, the bandwidth can be increased which incurs additional costs.
345+
*/
346+
publicBandwidthBps: number
338347
}
339348

340349
export type DeleteServerRequest = {
@@ -644,4 +653,8 @@ export type UpdateServerRequest = {
644653
* Change commitment. Use 'none' to automatically cancel a renewing commitment.
645654
*/
646655
commitmentType?: CommitmentTypeValue
656+
/**
657+
* Public bandwidth to configure for this server. Setting an higher bandwidth incurs additional costs. Supported bandwidth levels depends on server type and can be queried using the `/server-types` endpoint.
658+
*/
659+
publicBandwidthBps?: number
647660
}

0 commit comments

Comments
 (0)