diff --git a/packages/clients/src/api/instance/v1/api.gen.ts b/packages/clients/src/api/instance/v1/api.gen.ts index ac19b5856..4fc8bcd6b 100644 --- a/packages/clients/src/api/instance/v1/api.gen.ts +++ b/packages/clients/src/api/instance/v1/api.gen.ts @@ -55,7 +55,6 @@ import { unmarshalExportSnapshotResponse, unmarshalGetBootscriptResponse, unmarshalGetDashboardResponse, - unmarshalGetEncryptedRdpPasswordResponse, unmarshalGetImageResponse, unmarshalGetIpResponse, unmarshalGetPlacementGroupResponse, @@ -124,7 +123,6 @@ import type { CreateSnapshotResponse, CreateVolumeRequest, CreateVolumeResponse, - DeleteEncryptedRdpPasswordRequest, DeleteImageRequest, DeleteIpRequest, DeletePlacementGroupRequest, @@ -143,8 +141,6 @@ import type { GetBootscriptResponse, GetDashboardRequest, GetDashboardResponse, - GetEncryptedRdpPasswordRequest, - GetEncryptedRdpPasswordResponse, GetImageRequest, GetImageResponse, GetIpRequest, @@ -1626,37 +1622,4 @@ export class API extends ParentAPI { method: 'POST', path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/apply`, }) - - /** - * Get the encrypted RDP password. Get the initial administrator password for - * Windows RDP. This password is encrypted using the SSH RSA key specified at - * the time of Instance creation. - * - * @param request - The request {@link GetEncryptedRdpPasswordRequest} - * @returns A Promise of GetEncryptedRdpPasswordResponse - */ - getEncryptedRdpPassword = ( - request: Readonly, - ) => - this.client.fetch( - { - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/encrypted_rdp_password`, - }, - unmarshalGetEncryptedRdpPasswordResponse, - ) - - /** - * Delete the encrypted RDP password. Delete the initial administrator - * password for Windows RDP. - * - * @param request - The request {@link DeleteEncryptedRdpPasswordRequest} - */ - deleteEncryptedRdpPassword = ( - request: Readonly, - ) => - this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/encrypted_rdp_password`, - }) } diff --git a/packages/clients/src/api/instance/v1/index.gen.ts b/packages/clients/src/api/instance/v1/index.gen.ts index f0a83fa8e..34e0654d2 100644 --- a/packages/clients/src/api/instance/v1/index.gen.ts +++ b/packages/clients/src/api/instance/v1/index.gen.ts @@ -29,7 +29,6 @@ export type { CreateVolumeRequest, CreateVolumeResponse, Dashboard, - DeleteEncryptedRdpPasswordRequest, DeleteImageRequest, DeleteIpRequest, DeletePlacementGroupRequest, @@ -48,8 +47,6 @@ export type { GetBootscriptResponse, GetDashboardRequest, GetDashboardResponse, - GetEncryptedRdpPasswordRequest, - GetEncryptedRdpPasswordResponse, GetImageRequest, GetImageResponse, GetIpRequest, diff --git a/packages/clients/src/api/instance/v1/marshalling.gen.ts b/packages/clients/src/api/instance/v1/marshalling.gen.ts index 01b800d88..f9e753bf5 100644 --- a/packages/clients/src/api/instance/v1/marshalling.gen.ts +++ b/packages/clients/src/api/instance/v1/marshalling.gen.ts @@ -39,7 +39,6 @@ import type { ExportSnapshotResponse, GetBootscriptResponse, GetDashboardResponse, - GetEncryptedRdpPasswordResponse, GetImageResponse, GetIpResponse, GetPlacementGroupResponse, @@ -395,6 +394,8 @@ const unmarshalServer = (data: unknown): Server => { } return { + adminPasswordEncryptedValue: data.admin_password_encrypted_value, + adminPasswordEncryptionSshKeyId: data.admin_password_encryption_ssh_key_id, allowedActions: data.allowed_actions, arch: data.arch, bootType: data.boot_type, @@ -801,23 +802,6 @@ export const unmarshalGetDashboardResponse = ( } as GetDashboardResponse } -export const unmarshalGetEncryptedRdpPasswordResponse = ( - data: unknown, -): GetEncryptedRdpPasswordResponse => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'GetEncryptedRdpPasswordResponse' failed as data isn't a dictionary.`, - ) - } - - return { - adminPasswordEncryptionSshKeyDescription: - data.admin_password_encryption_ssh_key_description, - adminPasswordEncryptionSshKeyId: data.admin_password_encryption_ssh_key_id, - value: data.value, - } as GetEncryptedRdpPasswordResponse -} - export const unmarshalGetImageResponse = (data: unknown): GetImageResponse => { if (!isJSONObject(data)) { throw new TypeError( @@ -2267,6 +2251,7 @@ export const marshalSetServerRequest = ( request: SetServerRequest, defaults: DefaultValues, ): Record => ({ + admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId, allowed_actions: request.allowedActions !== undefined ? request.allowedActions : undefined, arch: request.arch, @@ -2467,6 +2452,7 @@ export const marshalUpdateServerRequest = ( request: UpdateServerRequest, defaults: DefaultValues, ): Record => ({ + admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId, boot_type: request.bootType, bootscript: request.bootscript, commercial_type: request.commercialType, diff --git a/packages/clients/src/api/instance/v1/types.gen.ts b/packages/clients/src/api/instance/v1/types.gen.ts index 50daffcdd..01773acb4 100644 --- a/packages/clients/src/api/instance/v1/types.gen.ts +++ b/packages/clients/src/api/instance/v1/types.gen.ts @@ -464,6 +464,18 @@ export interface Server { privateNics: PrivateNIC[] /** Zone in which the Instance is located. */ zone: Zone + /** + * The public_key value of this key is used to encrypt the admin password. + * When set to an empty string, reset this value and + * admin_password_encrypted_value to an empty string so a new password may be + * generated. + */ + adminPasswordEncryptionSshKeyId?: string + /** + * This value is reset when admin_password_encryption_ssh_key_id is set to an + * empty string. + */ + adminPasswordEncryptedValue?: string } export interface VolumeTemplate { @@ -1035,10 +1047,7 @@ export type CreateServerRequest = { securityGroup?: string /** Placement group ID if Instance must be part of a placement group. */ placementGroup?: string - /** - * UUID of the SSH RSA key that will be used to encrypt the initial admin - * password for OS requiring it. Mandatory for Windows OS. - */ + /** The public_key value of this key is used to encrypt the admin password. */ adminPasswordEncryptionSshKeyId?: string } @@ -1128,13 +1137,6 @@ export interface CreateVolumeResponse { volume?: Volume } -export type DeleteEncryptedRdpPasswordRequest = { - /** Zone to target. If none is passed will use default zone from the config. */ - zone?: Zone - /** UUID of the Instance. */ - serverId: string -} - export type DeleteImageRequest = { /** Zone to target. If none is passed will use default zone from the config. */ zone?: Zone @@ -1255,22 +1257,6 @@ export interface GetDashboardResponse { dashboard?: Dashboard } -export type GetEncryptedRdpPasswordRequest = { - /** Zone to target. If none is passed will use default zone from the config. */ - zone?: Zone - /** UUID of the Instance. */ - serverId: string -} - -export interface GetEncryptedRdpPasswordResponse { - /** The encrypted RDP password. */ - value?: string - /** The description of the SSH key used for ciphering. */ - adminPasswordEncryptionSshKeyDescription?: string - /** The UUID of the SSH key used for ciphering. */ - adminPasswordEncryptionSshKeyId?: string -} - export type GetImageRequest = { /** Zone to target. If none is passed will use default zone from the config. */ zone?: Zone @@ -2068,6 +2054,13 @@ export type UpdateServerRequest = { * DEV1-S, which has only 20GB). */ commercialType?: string + /** + * The public_key value of this key is used to encrypt the admin password. + * When set to an empty string, reset this value and + * admin_password_encrypted_value to an empty string so a new password may be + * generated. + */ + adminPasswordEncryptionSshKeyId?: string } export interface UpdateServerResponse { diff --git a/packages/clients/src/api/instance/v1/types.private.gen.ts b/packages/clients/src/api/instance/v1/types.private.gen.ts index 639795101..53ca7d2cd 100644 --- a/packages/clients/src/api/instance/v1/types.private.gen.ts +++ b/packages/clients/src/api/instance/v1/types.private.gen.ts @@ -177,6 +177,13 @@ export type SetServerRequest = { placementGroup?: PlacementGroup /** Instance private NICs. */ privateNics?: PrivateNIC[] + /** + * The public_key value of this key is used to encrypt the admin password. + * When set to an empty string, reset this value and + * admin_password_encrypted_value to an empty string so a new password may be + * generated. + */ + adminPasswordEncryptionSshKeyId?: string } export interface SetServerResponse {