Skip to content

Commit 217b6aa

Browse files
authored
feat(baremetal): add protected flag on servers (#2255)
1 parent 4569b7f commit 217b6aa

File tree

5 files changed

+39
-20
lines changed

5 files changed

+39
-20
lines changed

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
3+
4+
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client'
35
import {
4-
API as ParentAPI,
56
enrichForPagination,
7+
API as ParentAPI,
68
toApiLocality,
79
urlParams,
810
validatePathParam,
911
waitForResource,
1012
} from '@scaleway/sdk-client'
11-
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client'
1213
import { SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_BAREMETAL } from './content.gen'
1314
import {
1415
marshalAddOptionServerRequest,
@@ -26,16 +27,16 @@ import {
2627
unmarshalBMCAccess,
2728
unmarshalGetServerMetricsResponse,
2829
unmarshalIP,
29-
unmarshalListOSResponse,
3030
unmarshalListOffersResponse,
3131
unmarshalListOptionsResponse,
32+
unmarshalListOSResponse,
3233
unmarshalListServerEventsResponse,
3334
unmarshalListServerPrivateNetworksResponse,
3435
unmarshalListServersResponse,
3536
unmarshalListSettingsResponse,
36-
unmarshalOS,
3737
unmarshalOffer,
3838
unmarshalOption,
39+
unmarshalOS,
3940
unmarshalSchema,
4041
unmarshalServer,
4142
unmarshalServerPrivateNetwork,
@@ -50,20 +51,20 @@ import type {
5051
DeleteServerRequest,
5152
GetBMCAccessRequest,
5253
GetDefaultPartitioningSchemaRequest,
53-
GetOSRequest,
5454
GetOfferRequest,
5555
GetOptionRequest,
56+
GetOSRequest,
5657
GetServerMetricsRequest,
5758
GetServerMetricsResponse,
5859
GetServerRequest,
59-
IP,
6060
InstallServerRequest,
61-
ListOSRequest,
62-
ListOSResponse,
61+
IP,
6362
ListOffersRequest,
6463
ListOffersResponse,
6564
ListOptionsRequest,
6665
ListOptionsResponse,
66+
ListOSRequest,
67+
ListOSResponse,
6768
ListServerEventsRequest,
6869
ListServerEventsResponse,
6970
ListServerPrivateNetworksResponse,
@@ -72,9 +73,9 @@ import type {
7273
ListSettingsRequest,
7374
ListSettingsResponse,
7475
MigrateServerToMonthlyOfferRequest,
75-
OS,
7676
Offer,
7777
Option,
78+
OS,
7879
PrivateNetworkApiAddServerPrivateNetworkRequest,
7980
PrivateNetworkApiDeleteServerPrivateNetworkRequest,
8081
PrivateNetworkApiListServerPrivateNetworksRequest,
@@ -209,7 +210,7 @@ export class API extends ParentAPI {
209210
)
210211

211212
/**
212-
* Update an Elastic Metal server. Update the server associated with the ID. You can update parameters such as the server's name, tags and description. Any parameters left null in the request body are not updated.
213+
* Update an Elastic Metal server. Update the server associated with the ID. You can update parameters such as the server's name, tags, description and protection flag. Any parameters left null in the request body are not updated.
213214
*
214215
* @param request - The request {@link UpdateServerRequest}
215216
* @returns A Promise of Server

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
3+
4+
import type { DefaultValues } from '@scaleway/sdk-client'
35
import {
46
isJSONObject,
57
resolveOneOf,
@@ -8,33 +10,32 @@ import {
810
unmarshalMoney,
911
unmarshalTimeSeries,
1012
} from '@scaleway/sdk-client'
11-
import type { DefaultValues } from '@scaleway/sdk-client'
1213
import type {
1314
AddOptionServerRequest,
1415
BMCAccess,
15-
CPU,
1616
CertificationOption,
17+
CPU,
1718
CreateServerRequest,
1819
CreateServerRequestInstall,
1920
Disk,
20-
GPU,
2121
GetServerMetricsResponse,
22-
IP,
22+
GPU,
2323
InstallServerRequest,
24+
IP,
2425
LicenseOption,
25-
ListOSResponse,
2626
ListOffersResponse,
2727
ListOptionsResponse,
28+
ListOSResponse,
2829
ListServerEventsResponse,
2930
ListServerPrivateNetworksResponse,
3031
ListServersResponse,
3132
ListSettingsResponse,
3233
Memory,
33-
OS,
34-
OSOSField,
3534
Offer,
3635
OfferOptionOffer,
3736
Option,
37+
OS,
38+
OSOSField,
3839
PersistentMemory,
3940
PrivateNetworkApiAddServerPrivateNetworkRequest,
4041
PrivateNetworkApiSetServerPrivateNetworksRequest,
@@ -582,6 +583,7 @@ export const unmarshalServer = (data: unknown): Server => {
582583
organizationId: data.organization_id,
583584
pingStatus: data.ping_status,
584585
projectId: data.project_id,
586+
protected: data.protected,
585587
rescueServer: data.rescue_server
586588
? unmarshalServerRescueServer(data.rescue_server)
587589
: undefined,
@@ -881,6 +883,7 @@ export const marshalCreateServerRequest = (
881883
name: request.name,
882884
offer_id: request.offerId,
883885
option_ids: request.optionIds,
886+
protected: request.protected,
884887
tags: request.tags,
885888
...resolveOneOf([
886889
{
@@ -961,6 +964,7 @@ export const marshalUpdateServerRequest = (
961964
): Record<string, unknown> => ({
962965
description: request.description,
963966
name: request.name,
967+
protected: request.protected,
964968
tags: request.tags,
965969
})
966970

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,10 @@ export interface Server {
814814
* Configuration of rescue boot.
815815
*/
816816
rescueServer?: ServerRescueServer
817+
/**
818+
* If enabled, the server can not be deleted.
819+
*/
820+
protected: boolean
817821
}
818822

819823
export interface Setting {
@@ -914,6 +918,10 @@ export type CreateServerRequest = {
914918
* IDs of options to enable on server.
915919
*/
916920
optionIds?: string[]
921+
/**
922+
* If enabled, the server can not be deleted.
923+
*/
924+
protected: boolean
917925
}
918926

919927
export type DeleteOptionServerRequest = {
@@ -1500,6 +1508,10 @@ export type UpdateServerRequest = {
15001508
* Tags associated with the server, not updated if null.
15011509
*/
15021510
tags?: string[]
1511+
/**
1512+
* If enabled, the server can not be deleted.
1513+
*/
1514+
protected?: boolean
15031515
}
15041516

15051517
export type UpdateSettingRequest = {

packages_generated/baremetal/src/v3/api.gen.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
3+
4+
import type { ApiLocality } from '@scaleway/sdk-client'
35
import {
4-
API as ParentAPI,
56
enrichForPagination,
7+
API as ParentAPI,
68
toApiLocality,
79
urlParams,
810
validatePathParam,
911
} from '@scaleway/sdk-client'
10-
import type { ApiLocality } from '@scaleway/sdk-client'
1112
import {
1213
marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
1314
marshalPrivateNetworkApiSetServerPrivateNetworksRequest,

packages_generated/baremetal/src/v3/marshalling.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
3+
4+
import type { DefaultValues } from '@scaleway/sdk-client'
35
import {
46
isJSONObject,
57
unmarshalArrayOfObject,
68
unmarshalDate,
79
} from '@scaleway/sdk-client'
8-
import type { DefaultValues } from '@scaleway/sdk-client'
910
import type {
1011
ListServerPrivateNetworksResponse,
1112
PrivateNetworkApiAddServerPrivateNetworkRequest,

0 commit comments

Comments
 (0)