Skip to content
Merged
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
4 changes: 2 additions & 2 deletions packages_generated/baremetal/src/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,11 @@ export class API extends ParentAPI {
* @param request - The request {@link InstallServerRequest}
* @returns A Promise of Server
*/
installServer = (request: Readonly<InstallServerRequest>) =>
installServer = async (request: Readonly<InstallServerRequest>) =>
this.client.fetch<Server>(
{
body: JSON.stringify(
marshalInstallServerRequest(request, this.client.settings),
await marshalInstallServerRequest(request, this.client.settings),
),
headers: jsonContentHeaders,
method: 'POST',
Expand Down
12 changes: 10 additions & 2 deletions packages_generated/baremetal/src/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// If you have any remark or suggestion do not hesitate to open an issue.
import {
isJSONObject,
marshalBlobToScwFile,
resolveOneOf,
unmarshalArrayOfObject,
unmarshalDate,
Expand Down Expand Up @@ -338,6 +339,7 @@ export const unmarshalServer = (data: unknown): Server => {
status: data.status,
tags: data.tags,
updatedAt: unmarshalDate(data.updated_at),
userData: data.user_data,
zone: data.zone,
} as Server
}
Expand Down Expand Up @@ -879,6 +881,7 @@ export const marshalCreateServerRequest = (
option_ids: request.optionIds,
protected: request.protected,
tags: request.tags,
user_data: request.userData,
...resolveOneOf([
{
default: defaults.defaultProjectId,
Expand All @@ -900,10 +903,10 @@ export const marshalAddOptionServerRequest = (
expires_at: request.expiresAt,
})

export const marshalInstallServerRequest = (
export const marshalInstallServerRequest = async (
request: InstallServerRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
): Promise<Record<string, unknown>> => ({
hostname: request.hostname,
os_id: request.osId,
partitioning_schema:
Expand All @@ -915,6 +918,10 @@ export const marshalInstallServerRequest = (
service_user: request.serviceUser,
ssh_key_ids: request.sshKeyIds,
user: request.user,
user_data:
request.userData !== undefined
? await marshalBlobToScwFile(request.userData)
: undefined,
})

export const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (
Expand Down Expand Up @@ -969,6 +976,7 @@ export const marshalUpdateServerRequest = (
name: request.name,
protected: request.protected,
tags: request.tags,
user_data: request.userData,
})

export const marshalUpdateSettingRequest = (
Expand Down
16 changes: 16 additions & 0 deletions packages_generated/baremetal/src/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,10 @@ export type CreateServerRequest = {
* If enabled, the server can not be deleted.
*/
protected: boolean
/**
* Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
*/
userData?: string
}

export interface Server {
Expand Down Expand Up @@ -608,6 +612,10 @@ export interface Server {
* If enabled, the server can not be deleted.
*/
protected: boolean
/**
* Optional configuration data passed to cloud-init.
*/
userData?: string
}

export interface OS {
Expand Down Expand Up @@ -1087,6 +1095,10 @@ export type InstallServerRequest = {
* Partitioning schema.
*/
partitioningSchema?: Schema
/**
* @deprecated Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
*/
userData?: Blob
}

export type ListOSRequest = {
Expand Down Expand Up @@ -1528,6 +1540,10 @@ export type UpdateServerRequest = {
* If enabled, the server can not be deleted.
*/
protected?: boolean
/**
* Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
*/
userData?: string
}

export type UpdateSettingRequest = {
Expand Down
Loading