Skip to content

Commit 72fbddc

Browse files
authored
Merge branch 'main' into v1.6442.0
2 parents 54110d4 + d0db4ba commit 72fbddc

File tree

9 files changed

+215
-21
lines changed

9 files changed

+215
-21
lines changed

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"packages": ["packages/*"],
2+
"packages": ["packages/*", "packages_generated/*"],
33
"npmClient": "pnpm",
44
"version": "independent",
55
"command": {

packages_generated/instance/src/v1/api.gen.ts

+46
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
import type { Zone as ScwZone } from '@scaleway/sdk-client'
1010
import {
1111
marshalApplyBlockMigrationRequest,
12+
marshalAttachServerFileSystemRequest,
1213
marshalAttachServerVolumeRequest,
1314
marshalCheckBlockMigrationOrganizationQuotasRequest,
1415
marshalCreateImageRequest,
@@ -20,6 +21,7 @@ import {
2021
marshalCreateServerRequest,
2122
marshalCreateSnapshotRequest,
2223
marshalCreateVolumeRequest,
24+
marshalDetachServerFileSystemRequest,
2325
marshalDetachServerVolumeRequest,
2426
marshalExportSnapshotRequest,
2527
marshalPlanBlockMigrationRequest,
@@ -42,6 +44,7 @@ import {
4244
marshalUpdateServerRequest,
4345
marshalUpdateSnapshotRequest,
4446
marshalUpdateVolumeRequest,
47+
unmarshalAttachServerFileSystemResponse,
4548
unmarshalAttachServerVolumeResponse,
4649
unmarshalCreateImageResponse,
4750
unmarshalCreateIpResponse,
@@ -52,6 +55,7 @@ import {
5255
unmarshalCreateServerResponse,
5356
unmarshalCreateSnapshotResponse,
5457
unmarshalCreateVolumeResponse,
58+
unmarshalDetachServerFileSystemResponse,
5559
unmarshalDetachServerVolumeResponse,
5660
unmarshalExportSnapshotResponse,
5761
unmarshalGetDashboardResponse,
@@ -103,6 +107,8 @@ import {
103107
} from './marshalling.gen'
104108
import type {
105109
ApplyBlockMigrationRequest,
110+
AttachServerFileSystemRequest,
111+
AttachServerFileSystemResponse,
106112
AttachServerVolumeRequest,
107113
AttachServerVolumeResponse,
108114
CheckBlockMigrationOrganizationQuotasRequest,
@@ -134,6 +140,8 @@ import type {
134140
DeleteServerUserDataRequest,
135141
DeleteSnapshotRequest,
136142
DeleteVolumeRequest,
143+
DetachServerFileSystemRequest,
144+
DetachServerFileSystemResponse,
137145
DetachServerVolumeRequest,
138146
DetachServerVolumeResponse,
139147
ExportSnapshotRequest,
@@ -556,6 +564,44 @@ If the specified Instance offer is flagged as end of service, the best compatibl
556564
unmarshalDetachServerVolumeResponse,
557565
)
558566

567+
/**
568+
* Attach a filesystem volume to an Instance.
569+
*
570+
* @param request - The request {@link AttachServerFileSystemRequest}
571+
* @returns A Promise of AttachServerFileSystemResponse
572+
*/
573+
attachServerFileSystem = (request: Readonly<AttachServerFileSystemRequest>) =>
574+
this.client.fetch<AttachServerFileSystemResponse>(
575+
{
576+
body: JSON.stringify(
577+
marshalAttachServerFileSystemRequest(request, this.client.settings),
578+
),
579+
headers: jsonContentHeaders,
580+
method: 'POST',
581+
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/attach-filesystem`,
582+
},
583+
unmarshalAttachServerFileSystemResponse,
584+
)
585+
586+
/**
587+
* Detach a filesystem volume to an Instance.
588+
*
589+
* @param request - The request {@link DetachServerFileSystemRequest}
590+
* @returns A Promise of DetachServerFileSystemResponse
591+
*/
592+
detachServerFileSystem = (request: Readonly<DetachServerFileSystemRequest>) =>
593+
this.client.fetch<DetachServerFileSystemResponse>(
594+
{
595+
body: JSON.stringify(
596+
marshalDetachServerFileSystemRequest(request, this.client.settings),
597+
),
598+
headers: jsonContentHeaders,
599+
method: 'POST',
600+
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/detach-filesystem`,
601+
},
602+
unmarshalDetachServerFileSystemResponse,
603+
)
604+
559605
protected pageOfListImages = (request: Readonly<ListImagesRequest> = {}) =>
560606
this.client.fetch<ListImagesResponse>(
561607
{

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

+46
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
import type { DefaultValues } from '@scaleway/sdk-client'
1212
import type {
1313
ApplyBlockMigrationRequest,
14+
AttachServerFileSystemRequest,
15+
AttachServerFileSystemResponse,
1416
AttachServerVolumeRequest,
1517
AttachServerVolumeResponse,
1618
Bootscript,
@@ -34,6 +36,8 @@ import type {
3436
CreateVolumeRequest,
3537
CreateVolumeResponse,
3638
Dashboard,
39+
DetachServerFileSystemRequest,
40+
DetachServerFileSystemResponse,
3741
DetachServerVolumeRequest,
3842
DetachServerVolumeResponse,
3943
ExportSnapshotRequest,
@@ -441,6 +445,20 @@ const unmarshalServer = (data: unknown): Server => {
441445
} as Server
442446
}
443447

448+
export const unmarshalAttachServerFileSystemResponse = (
449+
data: unknown,
450+
): AttachServerFileSystemResponse => {
451+
if (!isJSONObject(data)) {
452+
throw new TypeError(
453+
`Unmarshalling the type 'AttachServerFileSystemResponse' failed as data isn't a dictionary.`,
454+
)
455+
}
456+
457+
return {
458+
server: data.server ? unmarshalServer(data.server) : undefined,
459+
} as AttachServerFileSystemResponse
460+
}
461+
444462
export const unmarshalAttachServerVolumeResponse = (
445463
data: unknown,
446464
): AttachServerVolumeResponse => {
@@ -717,6 +735,20 @@ export const unmarshalCreateVolumeResponse = (
717735
} as CreateVolumeResponse
718736
}
719737

738+
export const unmarshalDetachServerFileSystemResponse = (
739+
data: unknown,
740+
): DetachServerFileSystemResponse => {
741+
if (!isJSONObject(data)) {
742+
throw new TypeError(
743+
`Unmarshalling the type 'DetachServerFileSystemResponse' failed as data isn't a dictionary.`,
744+
)
745+
}
746+
747+
return {
748+
server: data.server ? unmarshalServer(data.server) : undefined,
749+
} as DetachServerFileSystemResponse
750+
}
751+
720752
export const unmarshalDetachServerVolumeResponse = (
721753
data: unknown,
722754
): DetachServerVolumeResponse => {
@@ -1651,6 +1683,13 @@ export const marshalApplyBlockMigrationRequest = (
16511683
]),
16521684
})
16531685

1686+
export const marshalAttachServerFileSystemRequest = (
1687+
request: AttachServerFileSystemRequest,
1688+
defaults: DefaultValues,
1689+
): Record<string, unknown> => ({
1690+
filesystem_id: request.filesystemId,
1691+
})
1692+
16541693
export const marshalAttachServerVolumeRequest = (
16551694
request: AttachServerVolumeRequest,
16561695
defaults: DefaultValues,
@@ -1916,6 +1955,13 @@ export const marshalCreateVolumeRequest = (
19161955
]),
19171956
})
19181957

1958+
export const marshalDetachServerFileSystemRequest = (
1959+
request: DetachServerFileSystemRequest,
1960+
defaults: DefaultValues,
1961+
): Record<string, unknown> => ({
1962+
filesystem_id: request.filesystemId,
1963+
})
1964+
19191965
export const marshalDetachServerVolumeRequest = (
19201966
request: DetachServerVolumeRequest,
19211967
defaults: DefaultValues,

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

+26
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,19 @@ export type ApplyBlockMigrationRequest = {
10991099
validationKey: string
11001100
}
11011101

1102+
export type AttachServerFileSystemRequest = {
1103+
/**
1104+
* Zone to target. If none is passed will use default zone from the config.
1105+
*/
1106+
zone?: ScwZone
1107+
serverId: string
1108+
filesystemId: string
1109+
}
1110+
1111+
export interface AttachServerFileSystemResponse {
1112+
server?: Server
1113+
}
1114+
11021115
export type AttachServerVolumeRequest = {
11031116
/**
11041117
* Zone to target. If none is passed will use default zone from the config.
@@ -1668,6 +1681,19 @@ export type DeleteVolumeRequest = {
16681681
volumeId: string
16691682
}
16701683

1684+
export type DetachServerFileSystemRequest = {
1685+
/**
1686+
* Zone to target. If none is passed will use default zone from the config.
1687+
*/
1688+
zone?: ScwZone
1689+
serverId: string
1690+
filesystemId: string
1691+
}
1692+
1693+
export interface DetachServerFileSystemResponse {
1694+
server?: Server
1695+
}
1696+
16711697
export type DetachServerVolumeRequest = {
16721698
/**
16731699
* Zone to target. If none is passed will use default zone from the config.

packages_generated/product_catalog/src/v2alpha1/marshalling.gen.ts

+27-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
import type {
99
ListPublicCatalogProductsResponse,
1010
PublicCatalogProduct,
11-
PublicCatalogProductEnvironmentalImpact,
11+
PublicCatalogProductEnvironmentalImpactEstimation,
1212
PublicCatalogProductLocality,
1313
PublicCatalogProductPrice,
1414
PublicCatalogProductPriceUnitOfMeasure,
@@ -25,6 +25,7 @@ import type {
2525
PublicCatalogProductPropertiesHardwareRAM,
2626
PublicCatalogProductPropertiesHardwareStorage,
2727
PublicCatalogProductPropertiesInstance,
28+
PublicCatalogProductUnitOfMeasure,
2829
} from './types.gen'
2930

3031
const unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical = (
@@ -247,19 +248,19 @@ const unmarshalPublicCatalogProductPropertiesInstance = (
247248
} as PublicCatalogProductPropertiesInstance
248249
}
249250

250-
const unmarshalPublicCatalogProductEnvironmentalImpact = (
251+
const unmarshalPublicCatalogProductEnvironmentalImpactEstimation = (
251252
data: unknown,
252-
): PublicCatalogProductEnvironmentalImpact => {
253+
): PublicCatalogProductEnvironmentalImpactEstimation => {
253254
if (!isJSONObject(data)) {
254255
throw new TypeError(
255-
`Unmarshalling the type 'PublicCatalogProductEnvironmentalImpact' failed as data isn't a dictionary.`,
256+
`Unmarshalling the type 'PublicCatalogProductEnvironmentalImpactEstimation' failed as data isn't a dictionary.`,
256257
)
257258
}
258259

259260
return {
260261
kgCo2Equivalent: data.kg_co2_equivalent,
261262
m3WaterUsage: data.m3_water_usage,
262-
} as PublicCatalogProductEnvironmentalImpact
263+
} as PublicCatalogProductEnvironmentalImpactEstimation
263264
}
264265

265266
const unmarshalPublicCatalogProductLocality = (
@@ -326,6 +327,21 @@ const unmarshalPublicCatalogProductProperties = (
326327
} as PublicCatalogProductProperties
327328
}
328329

330+
const unmarshalPublicCatalogProductUnitOfMeasure = (
331+
data: unknown,
332+
): PublicCatalogProductUnitOfMeasure => {
333+
if (!isJSONObject(data)) {
334+
throw new TypeError(
335+
`Unmarshalling the type 'PublicCatalogProductUnitOfMeasure' failed as data isn't a dictionary.`,
336+
)
337+
}
338+
339+
return {
340+
size: data.size,
341+
unit: data.unit,
342+
} as PublicCatalogProductUnitOfMeasure
343+
}
344+
329345
const unmarshalPublicCatalogProduct = (data: unknown): PublicCatalogProduct => {
330346
if (!isJSONObject(data)) {
331347
throw new TypeError(
@@ -335,9 +351,9 @@ const unmarshalPublicCatalogProduct = (data: unknown): PublicCatalogProduct => {
335351

336352
return {
337353
description: data.description,
338-
environmentalImpact: data.environmental_impact
339-
? unmarshalPublicCatalogProductEnvironmentalImpact(
340-
data.environmental_impact,
354+
environmentalImpactEstimation: data.environmental_impact_estimation
355+
? unmarshalPublicCatalogProductEnvironmentalImpactEstimation(
356+
data.environmental_impact_estimation,
341357
)
342358
: undefined,
343359
locality: data.locality
@@ -352,6 +368,9 @@ const unmarshalPublicCatalogProduct = (data: unknown): PublicCatalogProduct => {
352368
: undefined,
353369
serviceCategory: data.service_category,
354370
sku: data.sku,
371+
unitOfMeasure: data.unit_of_measure
372+
? unmarshalPublicCatalogProductUnitOfMeasure(data.unit_of_measure)
373+
: undefined,
355374
variant: data.variant,
356375
} as PublicCatalogProduct
357376
}

0 commit comments

Comments
 (0)