Skip to content

feat(baremetal): add protected flag on servers #2255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions packages_generated/baremetal/src/v1/api.gen.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.

import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client'
import {
API as ParentAPI,
enrichForPagination,
API as ParentAPI,
toApiLocality,
urlParams,
validatePathParam,
waitForResource,
} from '@scaleway/sdk-client'
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client'
import { SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_BAREMETAL } from './content.gen'
import {
marshalAddOptionServerRequest,
Expand All @@ -26,16 +27,16 @@ import {
unmarshalBMCAccess,
unmarshalGetServerMetricsResponse,
unmarshalIP,
unmarshalListOSResponse,
unmarshalListOffersResponse,
unmarshalListOptionsResponse,
unmarshalListOSResponse,
unmarshalListServerEventsResponse,
unmarshalListServerPrivateNetworksResponse,
unmarshalListServersResponse,
unmarshalListSettingsResponse,
unmarshalOS,
unmarshalOffer,
unmarshalOption,
unmarshalOS,
unmarshalSchema,
unmarshalServer,
unmarshalServerPrivateNetwork,
Expand All @@ -50,20 +51,20 @@ import type {
DeleteServerRequest,
GetBMCAccessRequest,
GetDefaultPartitioningSchemaRequest,
GetOSRequest,
GetOfferRequest,
GetOptionRequest,
GetOSRequest,
GetServerMetricsRequest,
GetServerMetricsResponse,
GetServerRequest,
IP,
InstallServerRequest,
ListOSRequest,
ListOSResponse,
IP,
ListOffersRequest,
ListOffersResponse,
ListOptionsRequest,
ListOptionsResponse,
ListOSRequest,
ListOSResponse,
ListServerEventsRequest,
ListServerEventsResponse,
ListServerPrivateNetworksResponse,
Expand All @@ -72,9 +73,9 @@ import type {
ListSettingsRequest,
ListSettingsResponse,
MigrateServerToMonthlyOfferRequest,
OS,
Offer,
Option,
OS,
PrivateNetworkApiAddServerPrivateNetworkRequest,
PrivateNetworkApiDeleteServerPrivateNetworkRequest,
PrivateNetworkApiListServerPrivateNetworksRequest,
Expand Down Expand Up @@ -209,7 +210,7 @@ export class API extends ParentAPI {
)

/**
* 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.
* 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.
*
* @param request - The request {@link UpdateServerRequest}
* @returns A Promise of Server
Expand Down
18 changes: 11 additions & 7 deletions packages_generated/baremetal/src/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.

import type { DefaultValues } from '@scaleway/sdk-client'
import {
isJSONObject,
resolveOneOf,
Expand All @@ -8,33 +10,32 @@ import {
unmarshalMoney,
unmarshalTimeSeries,
} from '@scaleway/sdk-client'
import type { DefaultValues } from '@scaleway/sdk-client'
import type {
AddOptionServerRequest,
BMCAccess,
CPU,
CertificationOption,
CPU,
CreateServerRequest,
CreateServerRequestInstall,
Disk,
GPU,
GetServerMetricsResponse,
IP,
GPU,
InstallServerRequest,
IP,
LicenseOption,
ListOSResponse,
ListOffersResponse,
ListOptionsResponse,
ListOSResponse,
ListServerEventsResponse,
ListServerPrivateNetworksResponse,
ListServersResponse,
ListSettingsResponse,
Memory,
OS,
OSOSField,
Offer,
OfferOptionOffer,
Option,
OS,
OSOSField,
PersistentMemory,
PrivateNetworkApiAddServerPrivateNetworkRequest,
PrivateNetworkApiSetServerPrivateNetworksRequest,
Expand Down Expand Up @@ -582,6 +583,7 @@ export const unmarshalServer = (data: unknown): Server => {
organizationId: data.organization_id,
pingStatus: data.ping_status,
projectId: data.project_id,
protected: data.protected,
rescueServer: data.rescue_server
? unmarshalServerRescueServer(data.rescue_server)
: undefined,
Expand Down Expand Up @@ -881,6 +883,7 @@ export const marshalCreateServerRequest = (
name: request.name,
offer_id: request.offerId,
option_ids: request.optionIds,
protected: request.protected,
tags: request.tags,
...resolveOneOf([
{
Expand Down Expand Up @@ -961,6 +964,7 @@ export const marshalUpdateServerRequest = (
): Record<string, unknown> => ({
description: request.description,
name: request.name,
protected: request.protected,
tags: request.tags,
})

Expand Down
12 changes: 12 additions & 0 deletions packages_generated/baremetal/src/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,10 @@ export interface Server {
* Configuration of rescue boot.
*/
rescueServer?: ServerRescueServer
/**
* If enabled, the server can not be deleted.
*/
protected: boolean
}

export interface Setting {
Expand Down Expand Up @@ -914,6 +918,10 @@ export type CreateServerRequest = {
* IDs of options to enable on server.
*/
optionIds?: string[]
/**
* If enabled, the server can not be deleted.
*/
protected: boolean
}

export type DeleteOptionServerRequest = {
Expand Down Expand Up @@ -1500,6 +1508,10 @@ export type UpdateServerRequest = {
* Tags associated with the server, not updated if null.
*/
tags?: string[]
/**
* If enabled, the server can not be deleted.
*/
protected?: boolean
}

export type UpdateSettingRequest = {
Expand Down
5 changes: 3 additions & 2 deletions packages_generated/baremetal/src/v3/api.gen.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.

import type { ApiLocality } from '@scaleway/sdk-client'
import {
API as ParentAPI,
enrichForPagination,
API as ParentAPI,
toApiLocality,
urlParams,
validatePathParam,
} from '@scaleway/sdk-client'
import type { ApiLocality } from '@scaleway/sdk-client'
import {
marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
Expand Down
3 changes: 2 additions & 1 deletion packages_generated/baremetal/src/v3/marshalling.gen.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.

import type { DefaultValues } from '@scaleway/sdk-client'
import {
isJSONObject,
unmarshalArrayOfObject,
unmarshalDate,
} from '@scaleway/sdk-client'
import type { DefaultValues } from '@scaleway/sdk-client'
import type {
ListServerPrivateNetworksResponse,
PrivateNetworkApiAddServerPrivateNetworkRequest,
Expand Down
Loading