Purpose:
This is a special packet that is used to report progress information during long operations.
Output specification:
Name |
Min/Max |
Type |
Description |
|
|
Progress data. |
Description:
Only certain types of operations are able to produce progress information. The examples of such operations include creating a Virtuozzo Container, backing up a Container, and others. By default, the progress information is not sent to the client by Agent. In order to receive the information, you must include the progress="on"
and the id
attributes in the packet
element of the message header. Optionally, you can also include the log="on"
attribute, which will initiate logging of the progress data in the history database.
Example:
The following example shows how to start a Virtuozzo Container backup operation and turn the progress reporting on.
Input
<packet progress="on" log="on" id="2" version="4.0.0">
<target>backupm</target>
<data>
<backupm>
<backup_env>
<env_list>
<eid>57c2cd6c-c02b-4645-bdb5-e883ea005896</eid>
</env_list>
</backup_env>
</backupm>
</data>
</packet>
Progress packet:
The following is an example of one of the progress packets received by the client program in response to the request listed above.
<ns1:packet xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="7c45db0eb2t72aer488" time="2007-02-19T15:01:32+0000" type="1" priority="4000" version="4.0.0">
<ns1:origin>backupm</ns1:origin>
<ns1:target>vzclient3</ns1:target>
<ns1:dst>
<director>gend</director>
</ns1:dst>
<ns1:data>
<ns1:progress>
<ns1:op>backupm.backup_env</ns1:op>
<ns1:message>
<ns1:message>Operation %op_name% is %status%</ns1:message>
<ns1:name></ns1:name>
<ns1:translate/>
<ns1:parameter>
<ns1:message>YmFja3VwX2Vudg==</ns1:message>
<ns1:name>op_name</ns1:name>
</ns1:parameter>
<ns1:parameter>
<ns1:message>c3RhcnRlZA==</ns1:message>
<ns1:name>status</ns1:name>
<ns1:translate/>
</ns1:parameter>
</ns1:message>
<ns1:status>1</ns1:status>
</ns1:progress>
</ns1:data>
<ns1:target>log_subscription</ns1:target>
<ns1:src>
<ns1:director>gend</ns1:director>
</ns1:src>
</ns1:packet>
The packet above needs to be decoded. See infoType
for the information on how it is done. Once you parse the packed, resolve all the parameters and their values, and decode the base64-encoded values, the actual message will look like this:
Operation backup_env is started.
Here's a different example of a progress reporting packet. In this case, the packet does not contain any text message but provides the operation status and the progress percentage.
<ns1:packet xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="7c45db0eb2t72aer488" time="2007-02-19T15:03:25+0000" type="1" priority="4000" version="4.0.0">
<ns1:origin>backupm</ns1:origin>
<ns1:target>vzclient3</ns1:target>
<ns1:dst>
<director>gend</director>
</ns1:dst>
<ns1:data>
<ns1:progress>
<ns1:percent>20</ns1:percent>
<ns1:status>2</ns1:status>
</ns1:progress>
</ns1:data>
<ns1:target>log_subscription</ns1:target>
<ns1:src>
<ns1:director>gend</ns1:director>
</ns1:src>
</ns1:packet>