diff --git a/packages_generated/baremetal/src/v1/api.gen.ts b/packages_generated/baremetal/src/v1/api.gen.ts index c8e1c534c..be5a0c9fa 100644 --- a/packages_generated/baremetal/src/v1/api.gen.ts +++ b/packages_generated/baremetal/src/v1/api.gen.ts @@ -233,11 +233,11 @@ export class API extends ParentAPI { * @param request - The request {@link InstallServerRequest} * @returns A Promise of Server */ - installServer = (request: Readonly) => + installServer = async (request: Readonly) => this.client.fetch( { body: JSON.stringify( - marshalInstallServerRequest(request, this.client.settings), + await marshalInstallServerRequest(request, this.client.settings), ), headers: jsonContentHeaders, method: 'POST', diff --git a/packages_generated/baremetal/src/v1/marshalling.gen.ts b/packages_generated/baremetal/src/v1/marshalling.gen.ts index 35cad8521..6c256b316 100644 --- a/packages_generated/baremetal/src/v1/marshalling.gen.ts +++ b/packages_generated/baremetal/src/v1/marshalling.gen.ts @@ -2,6 +2,7 @@ // If you have any remark or suggestion do not hesitate to open an issue. import { isJSONObject, + marshalBlobToScwFile, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, @@ -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 } @@ -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, @@ -900,10 +903,10 @@ export const marshalAddOptionServerRequest = ( expires_at: request.expiresAt, }) -export const marshalInstallServerRequest = ( +export const marshalInstallServerRequest = async ( request: InstallServerRequest, defaults: DefaultValues, -): Record => ({ +): Promise> => ({ hostname: request.hostname, os_id: request.osId, partitioning_schema: @@ -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 = ( @@ -969,6 +976,7 @@ export const marshalUpdateServerRequest = ( name: request.name, protected: request.protected, tags: request.tags, + user_data: request.userData, }) export const marshalUpdateSettingRequest = ( diff --git a/packages_generated/baremetal/src/v1/types.gen.ts b/packages_generated/baremetal/src/v1/types.gen.ts index 1d0c02eea..127396458 100644 --- a/packages_generated/baremetal/src/v1/types.gen.ts +++ b/packages_generated/baremetal/src/v1/types.gen.ts @@ -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 { @@ -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 { @@ -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 = { @@ -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 = {