Reference For: developers

API: backup

Operations of the backup tag of the native REST API.

Consistent backup points, changed-block areas and NBD exports (HX-GT-02); restore-to-new-disk

GET /v1/backup/controller

The archives of the controller's own state (System.Read on the root folder): where they go, when they are taken, the last run and the archives kept. Status of the controller that answers.

CLI
kyvernon system controller-backups

Responses

StatusDescriptionSchema
200OKControllerBackupStatusView

PUT /v1/backup/controller

Changes the schedule, target folder and retention of the archives of the controller state (Global.Settings; audited). Kept in the replicated store over the [backup] keys controller_schedule, controller_target, controller_retention and applied by every controller; the folder must be absolute and creatable.

CLI
kyvernon system set-controller-backup --target <dir> --schedule 02:30

Request body

application/json: ControllerBackupRequest

NameTypeRequiredDescription
enabledbooleanyesTake archives on the schedule.
retentionintegeryesArchives kept (1 to 365).
schedulestringHH:MM UTC or an interval such as 6h; needed when enabled.
targetstringyesFolder on the controller the archives go to (absolute).

Responses

StatusDescriptionSchema
200OKControllerBackupStatusView
400Invalid argument; the error body names the fieldErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/backup/controller/run

Archives the controller's state now (Global.Settings; task ServiceInstance.backupControllerState, run by the leader for its own state): a consistent copy of the store and the metrics, the other files of the state directory and the configuration, read back and checked before it counts.

CLI
kyvernon system controller-backup

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
409Conflict: the object exists, or expectedVersion is staleErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/backup/disks/{diskId}/invalidate

POST /v1/backup/disks/{diskId}/invalidate

CLI
kyvernon backup invalidate <disk-id> --vm <uuid> --reason <reason>

Parameters

NameInTypeRequiredDescription
diskIdpathstring (uuid)yesStable disk id

Request body

application/json: InvalidateRequestView

NameTypeRequiredDescription
reasonInvalidationReasonViewyesWhy change tracking restarts for the disk.
vmIdstring (uuid)yesVM instance UUID.

Responses

StatusDescriptionSchema
204Tracking restarted

GET /v1/backup/info

GET /v1/backup/info

CLI
kyvernon backup info

Responses

StatusDescriptionSchema
200Backup service capabilitiesApiInfoView

GET /v1/backup/points

The backup points in the repository, newest first (System.Read on the virtual machine; without vmId, the points of every virtual machine the caller can see, and of deleted ones for callers who can read the root folder).

CLI
kyvernon backup points

Parameters

NameInTypeRequiredDescription
vmIdquerystring or nullOnly the backup points of this virtual machine: its instance uuid or its id (vm-N).

Responses

StatusDescriptionSchema
200OKarray of BackupPointView
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/backup/points

Backs a virtual machine up to the repository now (task VirtualMachine.backupToRepository; VirtualMachine.Provisioning.DiskRandomRead and VirtualMachine.State.CreateSnapshot on the VM). The controller takes the backup point, reads every disk over its export into the repository and writes the manifest when the session committed. Incremental when the newest point of the VM has change ids for its disks, unless full. Change tracking is turned on when it is off.

CLI
kyvernon vm backup <id>

Request body

application/json: StartBackupRequest

NameTypeRequiredDescription
fullboolean or nullTransfer every allocated area even when change tracking could give an incremental backup.
quiesceQuiesceModeView or null
vmIdstringyesVirtual machine: instance uuid or id (vm-N).

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

DELETE /v1/backup/points/{id}

Deletes a backup point from the repository: its manifest and disk images (Global.Settings on the root folder; logged).

CLI
kyvernon backup delete-point <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the backup point

Responses

StatusDescriptionSchema
204Done; no body
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/backup/points/{id}/restore

Restores a backup point. new: to a new virtual machine (VirtualMachine.Inventory.Create on the folder, VirtualMachine.Provisioning.DiskRandomAccess on the source; task VirtualMachine.restoreBackup). in-place: into the powered-off source, whose disks are replaced (VirtualMachine.Config.AddNewDisk and VirtualMachine.Config.RemoveDisk; task VirtualMachine.restoreBackupInPlace; the old disks come back when it fails). With verify, the point is then verified in quarantine.

CLI
kyvernon backup restore-point <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the backup point

Request body

application/json: RestorePointRequest

NameTypeRequiredDescription
datastoreIdstring or nullDatastore for the new disks (default: the verification pool, else the first usable).
folderIdstring or nullFolder of the new virtual machine (default: the folder of the source).
hostIdstring or nullHost of the new virtual machine (default: the host of the source).
modestring or nullnew (default; also new_vm): a new virtual machine with the backed-up disks and the configuration of the source. in-place (also in_place): the disks of the source, which must be powered off, are replaced by those of the point (task VirtualMachine.restoreBackupInPlace); name, folderId, datastoreId, hostId and powerOn do not apply.
namestring or nullName of the new virtual machine (default: <source> (restored)).
powerOnbooleanPower the virtual machine on when the restore is done (default false).
verifyVerifySpec or null

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

GET /v1/backup/repository

The backup repository: configured or not, number of points (System.Read on the root folder).

CLI
kyvernon backup repository

Responses

StatusDescriptionSchema
200OKBackupRepositoryView

POST /v1/backup/restores

POST /v1/backup/restores

CLI
kyvernon backup restores begin --body <json>

Request body

application/json: BeginRestoreRequest

NameTypeRequiredDescription
capacityinteger (int64)yesCapacity in bytes.
deviceKeyinteger (int32)yesDevice key the restored disk will use.
poolstringyesTarget pool / datastore name (recorded; simulate attaches using an existing datastore).
thinbooleanThin provisioning.
verifyVerifySpec or null
vmIdstring (uuid)yesTarget VM instance UUID (new or powered-off).

Responses

StatusDescriptionSchema
201Writable NBD export for the restore targetNbdExportView

GET /v1/backup/restores/{vmId}

GET /v1/backup/restores/{vmId}: the verification state of a restored VM.

CLI
kyvernon backup restores get <vm>

Parameters

NameInTypeRequiredDescription
vmIdpathstring (uuid)yesRestored VM instance UUID

Responses

StatusDescriptionSchema
200OKRestoreSession

POST /v1/backup/restores/{vmId}/disks/{deviceKey}/finish

POST /v1/backup/restores/{vmId}/disks/{deviceKey}/finish

CLI
kyvernon backup restores finish <vm> <device-key>

Parameters

NameInTypeRequiredDescription
vmIdpathstring (uuid)yesVM instance UUID
deviceKeypathinteger (int32)yesDevice key

Request body

application/json: FinishRestoreRequest

NameTypeRequiredDescription
commitbooleanyesCommit the written image and attach it; false discards.

Responses

StatusDescriptionSchema
204Restore finished

POST /v1/backup/restores/{vmId}/verify

POST /v1/backup/restores/{vmId}/verify: verifies a restored VM now.

CLI
kyvernon backup restores verify <vm> --network <network>

Parameters

NameInTypeRequiredDescription
vmIdpathstring (uuid)yesRestored VM instance UUID

Request body

application/json: VerifySpec

NameTypeRequiredDescription
destroybooleanDestroy the restored VM after the verdict (default: keep it powered off).
networkstringyesThe quarantine network: id or name.
serialMarkersarray of stringSerial markers that count as an operating system (default: [OS_MARKERS]).
tcpPortsarray of integer (int32)TCP ports to check from the host probe after boot and lease (empty: no TCP check).
timeoutSecondsinteger (int64) or nullGive up after this many seconds (default 300, at most 3600).

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)RestoreSession

GET /v1/backup/schedules

The backup schedules (System.Read on the root folder).

CLI
kyvernon backup schedules list

Responses

StatusDescriptionSchema
200OKarray of BackupScheduleView

POST /v1/backup/schedules

Creates a backup schedule (Global.Settings; audited). It backs up every virtual machine of its scope at the time, UTC, keeping retention points per VM.

CLI
kyvernon backup schedules create <name> --scope <id> --hour 2

Request body

application/json: BackupScheduleRequest

NameTypeRequiredDescription
enabledbooleanRuns when true.
frequencystringyesdaily or weekly.
fullEveryinteger (int32)A full transfer every n points (default 7).
hourinteger (int32)yesHour, UTC.
minuteinteger (int32)Minute.
namestringyesName.
quiesceQuiesceModeViewQuiescing.
retentioninteger (int32)Points kept per virtual machine (default 14; 0: all).
scopestringyesInventory id of the folder, datacenter, cluster, resource pool, host or virtual machine.
weekdaysarray of integer (int32)Weekdays, 0 is Sunday (weekly only).

Responses

StatusDescriptionSchema
201CreatedBackupScheduleView
400Invalid argument; the error body names the fieldErrorBody
409Conflict: the object exists, or expectedVersion is staleErrorBody

GET /v1/backup/schedules/{id}

One backup schedule.

CLI
kyvernon backup schedules get <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesSchedule id (bkschedule-N).

Responses

StatusDescriptionSchema
200OKBackupScheduleView
404Not found (or not visible to the caller)ErrorBody

PUT /v1/backup/schedules/{id}

Changes a backup schedule (Global.Settings; audited). Its next run counts from now.

CLI
kyvernon backup schedules update <id> --name <name> --scope <id> --hour 2

Parameters

NameInTypeRequiredDescription
idpathstringyesSchedule id (bkschedule-N).

Request body

application/json: BackupScheduleRequest

NameTypeRequiredDescription
enabledbooleanRuns when true.
frequencystringyesdaily or weekly.
fullEveryinteger (int32)A full transfer every n points (default 7).
hourinteger (int32)yesHour, UTC.
minuteinteger (int32)Minute.
namestringyesName.
quiesceQuiesceModeViewQuiescing.
retentioninteger (int32)Points kept per virtual machine (default 14; 0: all).
scopestringyesInventory id of the folder, datacenter, cluster, resource pool, host or virtual machine.
weekdaysarray of integer (int32)Weekdays, 0 is Sunday (weekly only).

Responses

StatusDescriptionSchema
200OKBackupScheduleView
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody

DELETE /v1/backup/schedules/{id}

Deletes a backup schedule (Global.Settings; audited). Its backup points stay.

CLI
kyvernon backup schedules delete <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesSchedule id (bkschedule-N).

Responses

StatusDescriptionSchema
204Done; no body
404Not found (or not visible to the caller)ErrorBody

POST /v1/backup/schedules/{id}/run

Runs a backup schedule now (Global.Settings): one backup task per virtual machine of its scope, as at its time. Answers the schedule with lastRunAt set.

CLI
kyvernon backup schedules run <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesSchedule id (bkschedule-N).

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)BackupScheduleView
404Not found (or not visible to the caller)ErrorBody
409Conflict: the object exists, or expectedVersion is staleErrorBody

GET /v1/backup/sessions

GET /v1/backup/sessions

CLI
kyvernon backup sessions list

Parameters

NameInTypeRequiredDescription
vmIdquerystring (uuid) or nullFilter to one VM instance UUID.

Responses

StatusDescriptionSchema
200Sessions, newest firstarray of BackupSessionView

POST /v1/backup/sessions

POST /v1/backup/sessions

CLI
kyvernon backup sessions begin --body <json>

Request body

application/json: BeginBackupRequestView

NameTypeRequiredDescription
disksarray of DiskSelectionViewDisk selections; empty means every CBT-enabled disk with *.
fallbackToFullbooleanFall back to a full backup when a change id is stale.
fleecingbooleanFleecing requested.
quiesceQuiesceModeViewQuiesce mode (NONE / PREFERRED / REQUIRED).
ttlSecondsinteger (int64) or nullSession TTL in seconds.
vmIdstring (uuid)yesVM instance UUID.

Responses

StatusDescriptionSchema
201Session in EXPORTINGBackupSessionView

GET /v1/backup/sessions/{id}

GET /v1/backup/sessions/{id}

CLI
kyvernon backup sessions get <id>

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yesSession id

Responses

StatusDescriptionSchema
200Backup sessionBackupSessionView

GET /v1/backup/sessions/{id}/disks/{deviceKey}/changed-areas

GET /v1/backup/sessions/{id}/disks/{deviceKey}/changed-areas

CLI
kyvernon backup sessions changed-areas <id> <device-key>

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yesSession id
deviceKeypathinteger (int32)yesDisk device key
startOffsetqueryinteger (int64) or nullByte offset (granularity-aligned).
maxAreasqueryinteger or nullPage size.

Responses

StatusDescriptionSchema
200Changed areas pageDiskChangeInfoView

POST /v1/backup/sessions/{id}/end

POST /v1/backup/sessions/{id}/end

CLI
kyvernon backup sessions end <id>

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yesSession id

Request body

application/json: EndBackupRequestView

NameTypeRequiredDescription
outcomeEndOutcomeViewyesSUCCESS or FAILURE.

Responses

StatusDescriptionSchema
200Terminal sessionBackupSessionView

POST /v1/backup/sessions/{id}/keepalive

POST /v1/backup/sessions/{id}/keepalive

CLI
kyvernon backup sessions keepalive <id>

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yesSession id

Responses

StatusDescriptionSchema
200Session with extended deadlineBackupSessionView

GET /v1/backup/settings

The backup settings (System.Read on the root folder).

CLI
kyvernon backup settings get

Responses

StatusDescriptionSchema
200OKBackupSettingsView

PUT /v1/backup/settings

Changes the backup settings (Global.Settings; audited). The repository must be an absolute directory this controller can create, the network a quarantine network and the pool a datastore. remoteExports is set in the configuration and ignored here.

CLI
kyvernon backup settings set --repository <dir>

Request body

application/json: BackupSettingsRequest

NameTypeRequiredDescription
defaultQuiesceQuiesceModeViewyesQuiescing of backups that do not say.
remoteExportsboolean or nullIgnored (configuration only).
repositorystringyesRepository directory, absolute; empty: none.
verifyDestroybooleanyesDestroy verification VMs after the verdict.
verifyNetworkstringQuarantine network (id or name); empty: none.
verifyPoolstringDatastore restored disks go to; empty: the first usable one.
verifySchedulestringNightly verification schedule; empty: off.
verifyTimeoutSecondsinteger (int64)yesTimeout of one verification, 30 to 3600 seconds.

Responses

StatusDescriptionSchema
200OKBackupSettingsView
400Invalid argument; the error body names the fieldErrorBody
412Failed precondition; the error body says whichErrorBody

GET /v1/backup/verification

GET /v1/backup/verification: last verification run per VM.

CLI
kyvernon backup verification report

Responses

StatusDescriptionSchema
200OKVerificationReport

POST /v1/backup/verification/run

POST /v1/backup/verification/run: runs the nightly job now, in the background.

CLI
kyvernon backup verification run

Responses

StatusDescriptionSchema
202Started; poll GET /v1/backup/verification

Version 0.1.