Collapse All
Parallels C API Reference Guide
PrlSrv_GetBackupTree Function
PrlApi.h PHT_SERVER

Get backups tree from backup server.

Syntax
PRL_HANDLE PrlSrv_GetBackupTree(
    PRL_HANDLE hSourceServer, 
    PRL_CONST_STR sVmUuid, 
    PRL_CONST_STR sTargetHost, 
    PRL_UINT32 nTargetPort, 
    PRL_CONST_STR sTargetSessionId, 
    PRL_UINT32 backup_flags, 
    PRL_UINT32 reserved_flags, 
    PRL_BOOL force_operation
);
File
Parameters

hSourceServer
A handle of type PHT_SERVER identifying the source Parallels Service.
sVmUuid
A virtual machine uuid. If it is empty, the tree will build for all virtual machines.
sTargetHost
The name of the target host machine.
nTargetPort
The port number on the target host.
sTargetSessionId
The target Parallels Service session ID.
backup_flags
Flags that specify backup type and etc. Acceptable flags:
reserved_flags
Reserved flags.
force_operation
Specifies to process VM backup action without asking any additional questions from the Parallels Service side (non-interactive clients should use this option).
PBT_FULL
full backup
PBT_INCREMENTAL
incremental backup
PBT_DIFFERENTAL
differental backup PVMSL_LOW_SECURITY, PVMSL_NORMAL_SECURITY, PVMSL_HIGH_SECURITY
Returns

A handle of type PHT_JOB containing the results of this asynchronous operation or PRL_INVALID_HANDLE if there's not enough memory to instantiate the job object.

Remarks

Some of the important XML elements are:

<SavedStateItem> - root element of a branch containing information about an individual backup. The element has an attribute "guid" containing the backup ID. The ID is required when performing other operations on a backup.

<Name> - contains a backup name.

<DateTime> - the backup creation date and time.

<Type> - backup type {full, incremental, differential}

<VmUuid> VM uuid identificator

<Size> Backup size in kbytes

To get the return code from the PHT_JOB object, use the PrlJob_GetRetCode function. Possible values are:

PRL_ERR_INVALID_ARG - invalid handle was passed.

PRL_ERR_SUCCESS - function completed successfully.

To get a backup tree from the PHT_JOB object:

  1. Use the PrlJob_GetResult function to obtain a handle to the PHT_RESULT object.
  2. Use the PrlResult_GetParamAsString function to obtain a string value containing the backup tree XML data.

Please note that no parser is provided to traverse the returned XML. To use this functionality, you will have to parse the returned XML yourself.

Links
Copyright © 1999-2011 Parallels Holdings, Ltd. and its affiliates. All rights reserved.
What do you think about this topic? Send feedback!