Collapse All
Virtuozzo Virtualization SDK C API Reference
ContentsIndex
PreviousUpNext
PrlSrv_GetBackupTree Function
PHT_SERVER

Get backups tree from backup server.

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

PrlApiVm.h

Parameters

hSourceServer
A handle of type PHT_SERVER identifying the source Virtuozzo Service.
sUuid
A virtual machine or a backup ID. If it is empty, the tree will be built for backups of all virtual machines. When PBT_BACKUP_ID or PBT_CHAIN flag is specified in the backup_flags argument, then the value of this argument is treated as a backup ID, otherwise - as a virtual machine UUID.
sTargetHost
The name of the target host machine.
nTargetPort
The port number on the target host.
sTargetSessionId
The target Virtuozzo 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 Virtuozzo Service side (non-interactive clients should use this option).
PBT_VM
include only virtual machine backups (used by default if PBT_VM and PBT_CT flags are not specified)
PBT_CT
include only container backups
PBT_BACKUP_ID
get information about the backup, which identifier is specified in sUuid parameter. Note that if an identifier of an incremental backup is passed in the sUuid parameter, then the output tree would also contain the corresponding full backup element.
PBT_CHAIN
get information about the whole backup chain, which is dependent on the backup identifier, specified in sUuid parameter. Note that if an identifier of an incremental backup is passed in the sUuid parameter, then the output tree would also contain the corresponding full backup element. 

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: 

<VmItem> - root element of a branch containing information about a virtual machine. This element, in turn, may contain a set of elements describing full backups of this virtual machine. 

<BackupItem> - root element of a branch containing information about a full backup. This element, in turn, may contain a set of elements describing incremental backups of this full backup. 

<PartialBackupItem> - root element of a branch containing information about an incremental backup. 

<Id> - the backup ID. The ID is required when performing other operations on a backup. 

<DateTime> - the backup creation date and time. 

<Type> - backup type {'f' - full, 'i' - incremental} 

<Size> Backup size in bytes 

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_INVALID_PARAM - invalid combination of backup_flags 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 ©2016-2017 Parallels International GmbH. All rights reserved.