Skip to content

Commit 0c1af30

Browse files
scaleway-botyfodil
andauthored
fix(apple_silicon): add missing servertype infos for PCU (#2434)
Co-authored-by: Yacine Fodil <105779815+yfodil@users.noreply.github.com>
1 parent 57f2c6a commit 0c1af30

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export type {
5151
ServerTypeGPU,
5252
ServerTypeMemory,
5353
ServerTypeNetwork,
54+
ServerTypeNPU,
5455
ServerTypeStock,
5556
SetServerPrivateNetworksResponse,
5657
StartConnectivityDiagnosticRequest,

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import type {
3232
ServerTypeGPU,
3333
ServerTypeMemory,
3434
ServerTypeNetwork,
35+
ServerTypeNPU,
3536
SetServerPrivateNetworksResponse,
3637
StartConnectivityDiagnosticRequest,
3738
StartConnectivityDiagnosticResponse,
@@ -138,6 +139,8 @@ const unmarshalServerTypeCPU = (data: unknown): ServerTypeCPU => {
138139
coreCount: data.core_count,
139140
frequency: data.frequency,
140141
name: data.name,
142+
sockets: data.sockets,
143+
threadsPerCore: data.threads_per_core,
141144
} as ServerTypeCPU
142145
}
143146

@@ -179,6 +182,18 @@ const unmarshalServerTypeMemory = (data: unknown): ServerTypeMemory => {
179182
} as ServerTypeMemory
180183
}
181184

185+
const unmarshalServerTypeNPU = (data: unknown): ServerTypeNPU => {
186+
if (!isJSONObject(data)) {
187+
throw new TypeError(
188+
`Unmarshalling the type 'ServerTypeNPU' failed as data isn't a dictionary.`,
189+
)
190+
}
191+
192+
return {
193+
count: data.count,
194+
} as ServerTypeNPU
195+
}
196+
182197
const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => {
183198
if (!isJSONObject(data)) {
184199
throw new TypeError(
@@ -187,6 +202,7 @@ const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => {
187202
}
188203

189204
return {
205+
defaultPublicBandwidth: data.default_public_bandwidth,
190206
publicBandwidthBps: data.public_bandwidth_bps,
191207
supportedBandwidth: data.supported_bandwidth,
192208
} as ServerTypeNetwork
@@ -210,6 +226,7 @@ export const unmarshalServerType = (data: unknown): ServerType => {
210226
network: data.network
211227
? unmarshalServerTypeNetwork(data.network)
212228
: undefined,
229+
npu: data.npu ? unmarshalServerTypeNPU(data.npu) : undefined,
213230
stock: data.stock,
214231
} as ServerType
215232
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ export interface ServerTypeCPU {
103103
name: string
104104
coreCount: number
105105
frequency: number
106+
sockets: number
107+
threadsPerCore: number
106108
}
107109

108110
export interface ServerTypeDisk {
@@ -119,9 +121,14 @@ export interface ServerTypeMemory {
119121
type: string
120122
}
121123

124+
export interface ServerTypeNPU {
125+
count: number
126+
}
127+
122128
export interface ServerTypeNetwork {
123129
publicBandwidthBps: number
124130
supportedBandwidth: number[]
131+
defaultPublicBandwidth: number
125132
}
126133

127134
export interface BatchCreateServersRequestBatchInnerCreateServerRequest {
@@ -300,6 +307,10 @@ export interface ServerType {
300307
* The default OS for this server type.
301308
*/
302309
defaultOs?: OS
310+
/**
311+
* NPU description.
312+
*/
313+
npu?: ServerTypeNPU
303314
}
304315

305316
export interface CommitmentTypeValue {

0 commit comments

Comments
 (0)