Reference For: developers

API: guest

Operations of the guest tag of the native REST API.

Guest operations through the guest agent (GuestOperationsManager)

POST /v1/vms/{id}/guest/credentials/acquire

POST /v1/vms/{id}/guest/credentials/acquire: SOAP AcquireCredentialsInGuest.

CLI
kyvernon vm guest acquire <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestAuthRequest

NameTypeRequiredDescription
interactiveSessionboolean or nullInteractive session flag (SOAP parity; ignored).
passwordstring or nullGuest password (accepted and discarded).
usernamestring or nullGuest account name (echoed; not verified).

Responses

StatusDescriptionSchema
200OKGuestAuthView
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/credentials/release

POST /v1/vms/{id}/guest/credentials/release: SOAP ReleaseCredentialsInGuest.

CLI
kyvernon vm guest release <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestAuthRequest

NameTypeRequiredDescription
interactiveSessionboolean or nullInteractive session flag (SOAP parity; ignored).
passwordstring or nullGuest password (accepted and discarded).
usernamestring or nullGuest account name (echoed; not verified).

Responses

StatusDescriptionSchema
204Released
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/credentials/validate

POST /v1/vms/{id}/guest/credentials/validate: SOAP ValidateCredentialsInGuest.

CLI
kyvernon vm guest validate <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestAuthRequest

NameTypeRequiredDescription
interactiveSessionboolean or nullInteractive session flag (SOAP parity; ignored).
passwordstring or nullGuest password (accepted and discarded).
usernamestring or nullGuest account name (echoed; not verified).

Responses

StatusDescriptionSchema
204Guest operations are available
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

GET /v1/vms/{id}/guest/environment

GET /v1/vms/{id}/guest/environment: SOAP ReadEnvironmentVariableInGuest.

CLI
kyvernon vm guest env <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)
namequeryarray of stringVariable names; empty means the whole environment.

Responses

StatusDescriptionSchema
200OKGuestEnvView
403Permission denied; args.privilege names the missing privilegeErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/files/attrs

POST /v1/vms/{id}/guest/files/attrs: SOAP ChangeFileAttributesInGuest (posix).

CLI
kyvernon vm guest change-attrs <id> --path <path>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestChangeAttributesRequest

NameTypeRequiredDescription
accessTimeUnixinteger (int64) or nullAccess time, Unix seconds; omit to leave unchanged.
groupIdinteger (int32) or nullGroup gid; omit to leave unchanged.
modificationTimeUnixinteger (int64) or nullModification time, Unix seconds; omit to leave unchanged.
ownerIdinteger (int32) or nullOwner uid; omit to leave unchanged.
pathstringyesPath in the guest.
permissionsinteger (int64) or nullMode bits as VMware permissions (e.g. 420 = 0644); omit to leave unchanged.

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/files/delete

POST /v1/vms/{id}/guest/files/delete: SOAP DeleteFileInGuest.

CLI
kyvernon vm guest delete-file <id> --path <path>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestDeleteFileRequest

NameTypeRequiredDescription
pathstringyesFile path in the guest (not a directory).

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/files/list

POST /v1/vms/{id}/guest/files/list: SOAP ListFilesInGuest.

CLI
kyvernon vm guest list-files <id> --path <path>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestFileListRequest

NameTypeRequiredDescription
indexinteger (int32) or nullZero-based start index (default 0).
matchPatternstring or nullBasename regex (grep -E); empty / .* matches all.
maxResultsinteger (int32) or nullCap on returned entries.
pathstringyesDirectory or file path in the guest.

Responses

StatusDescriptionSchema
200OKGuestFileListView
400Invalid argument; the error body names the fieldErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/files/mkdir

POST /v1/vms/{id}/guest/files/mkdir: SOAP MakeDirectoryInGuest.

CLI
kyvernon vm guest mkdir <id> --path <path>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestMkdirRequest

NameTypeRequiredDescription
createParentsboolean or nullCreate missing parents (default false).
pathstringyesDirectory path in the guest.

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
409Conflict: the object exists, or expectedVersion is staleErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/files/move

POST /v1/vms/{id}/guest/files/move: SOAP MoveFileInGuest.

CLI
kyvernon vm guest move-file <id> --src <path> --dst <path>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestMoveFileRequest

NameTypeRequiredDescription
dststringyesDestination path in the guest.
overwriteboolean or nullReplace an existing destination file (default false).
srcstringyesSource path in the guest.

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody
409Conflict: the object exists, or expectedVersion is staleErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/files/move-dir

POST /v1/vms/{id}/guest/files/move-dir: SOAP MoveDirectoryInGuest.

CLI
kyvernon vm guest move-dir <id> --src <path> --dst <path>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestMoveDirectoryRequest

NameTypeRequiredDescription
dststringyesDestination directory path in the guest.
srcstringyesSource directory path in the guest.

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody
409Conflict: the object exists, or expectedVersion is staleErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/files/read

POST /v1/vms/{id}/guest/files/read: SOAP InitiateFileTransferFromGuest (inline bytes).

CLI
kyvernon vm guest read-file <id> --path <path>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestFileReadRequest

NameTypeRequiredDescription
pathstringyesAbsolute path in the guest.

Responses

StatusDescriptionSchema
200OKGuestFileReadView
400Invalid argument; the error body names the fieldErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/files/rmdir

POST /v1/vms/{id}/guest/files/rmdir: SOAP DeleteDirectoryInGuest.

CLI
kyvernon vm guest rmdir <id> --path <path>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestRmdirRequest

NameTypeRequiredDescription
pathstringyesDirectory path in the guest.
recursiveboolean or nullRemove contents too (default false).

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/files/temp-dir

POST /v1/vms/{id}/guest/files/temp-dir: SOAP CreateTemporaryDirectoryInGuest.

CLI
kyvernon vm guest temp-dir <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestCreateTemporaryRequest

NameTypeRequiredDescription
directoryPathstring or nullParent directory; omit for guest /tmp.
prefixstringName prefix (no path separators); may be empty.
suffixstringName suffix (no path separators); may be empty.

Responses

StatusDescriptionSchema
200OKGuestCreateTemporaryView
400Invalid argument; the error body names the fieldErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/files/temp-file

POST /v1/vms/{id}/guest/files/temp-file: SOAP CreateTemporaryFileInGuest.

CLI
kyvernon vm guest temp-file <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestCreateTemporaryRequest

NameTypeRequiredDescription
directoryPathstring or nullParent directory; omit for guest /tmp.
prefixstringName prefix (no path separators); may be empty.
suffixstringName suffix (no path separators); may be empty.

Responses

StatusDescriptionSchema
200OKGuestCreateTemporaryView
400Invalid argument; the error body names the fieldErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/files/write

POST /v1/vms/{id}/guest/files/write: SOAP InitiateFileTransferToGuest (inline bytes).

CLI
kyvernon vm guest write-file <id> --path <path> --from <file>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestFileWriteRequest

NameTypeRequiredDescription
dataBase64stringyesFile content, standard Base64.
overwriteboolean or nullReplace an existing file (default true).
pathstringyesAbsolute path in the guest.

Responses

StatusDescriptionSchema
200OKGuestFileWriteView
400Invalid argument; the error body names the fieldErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
409Conflict: the object exists, or expectedVersion is staleErrorBody
412Failed precondition; the error body says whichErrorBody

GET /v1/vms/{id}/guest/processes

GET /v1/vms/{id}/guest/processes: SOAP ListProcessesInGuest.

CLI
kyvernon vm guest list <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)
pidqueryarray of integer (int64)Process ids to include (repeat or comma-separated); empty means all remembered.

Responses

StatusDescriptionSchema
200OKGuestProcessListView
403Permission denied; args.privilege names the missing privilegeErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/vms/{id}/guest/processes

POST /v1/vms/{id}/guest/processes: SOAP StartProgramInGuest.

CLI
kyvernon vm guest start <id> --program <path>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: GuestStartProgramRequest

NameTypeRequiredDescription
argumentsstring or nullArguments as one string (SOAP GuestProgramSpec.arguments).
authGuestAuthRequestAuthentication (accepted, not checked).
envVariablesarray of string or nullEnvironment variables (NAME=value).
programPathstringyesAbsolute path of the program in the guest.
workingDirectorystring or nullWorking directory.

Responses

StatusDescriptionSchema
201CreatedGuestStartProgramView
400Invalid argument; the error body names the fieldErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
412Failed precondition; the error body says whichErrorBody

DELETE /v1/vms/{id}/guest/processes/{pid}

DELETE /v1/vms/{id}/guest/processes/{pid}: SOAP TerminateProcessInGuest.

CLI
kyvernon vm guest terminate <id> <pid>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)
pidpathinteger (int64)yesProcess id in the guest

Responses

StatusDescriptionSchema
204Terminated
403Permission denied; args.privilege names the missing privilegeErrorBody
412Failed precondition; the error body says whichErrorBody

Version 0.1.