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
37 changes: 0 additions & 37 deletions packages/clients/src/api/instance/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import {
unmarshalExportSnapshotResponse,
unmarshalGetBootscriptResponse,
unmarshalGetDashboardResponse,
unmarshalGetEncryptedRdpPasswordResponse,
unmarshalGetImageResponse,
unmarshalGetIpResponse,
unmarshalGetPlacementGroupResponse,
Expand Down Expand Up @@ -124,7 +123,6 @@ import type {
CreateSnapshotResponse,
CreateVolumeRequest,
CreateVolumeResponse,
DeleteEncryptedRdpPasswordRequest,
DeleteImageRequest,
DeleteIpRequest,
DeletePlacementGroupRequest,
Expand All @@ -143,8 +141,6 @@ import type {
GetBootscriptResponse,
GetDashboardRequest,
GetDashboardResponse,
GetEncryptedRdpPasswordRequest,
GetEncryptedRdpPasswordResponse,
GetImageRequest,
GetImageResponse,
GetIpRequest,
Expand Down Expand Up @@ -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<GetEncryptedRdpPasswordRequest>,
) =>
this.client.fetch<GetEncryptedRdpPasswordResponse>(
{
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<DeleteEncryptedRdpPasswordRequest>,
) =>
this.client.fetch<void>({
method: 'DELETE',
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/encrypted_rdp_password`,
})
}
3 changes: 0 additions & 3 deletions packages/clients/src/api/instance/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export type {
CreateVolumeRequest,
CreateVolumeResponse,
Dashboard,
DeleteEncryptedRdpPasswordRequest,
DeleteImageRequest,
DeleteIpRequest,
DeletePlacementGroupRequest,
Expand All @@ -48,8 +47,6 @@ export type {
GetBootscriptResponse,
GetDashboardRequest,
GetDashboardResponse,
GetEncryptedRdpPasswordRequest,
GetEncryptedRdpPasswordResponse,
GetImageRequest,
GetImageResponse,
GetIpRequest,
Expand Down
22 changes: 4 additions & 18 deletions packages/clients/src/api/instance/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import type {
ExportSnapshotResponse,
GetBootscriptResponse,
GetDashboardResponse,
GetEncryptedRdpPasswordResponse,
GetImageResponse,
GetIpResponse,
GetPlacementGroupResponse,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -2267,6 +2251,7 @@ export const marshalSetServerRequest = (
request: SetServerRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId,
allowed_actions:
request.allowedActions !== undefined ? request.allowedActions : undefined,
arch: request.arch,
Expand Down Expand Up @@ -2467,6 +2452,7 @@ export const marshalUpdateServerRequest = (
request: UpdateServerRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId,
boot_type: request.bootType,
bootscript: request.bootscript,
commercial_type: request.commercialType,
Expand Down
47 changes: 20 additions & 27 deletions packages/clients/src/api/instance/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
7 changes: 7 additions & 0 deletions packages/clients/src/api/instance/v1/types.private.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down