Previous Topic

Next Topic

Locate topic in Contents

Example of XML File for Traffic Classes Import

Parallels Business Automation - Standard allows accounting traffic by different IP ranges called traffic classes.

A traffic class is a set of IP ranges for which traffic must be accounted and billed in accordance with prices and restrictions set for each particular IP range.

To be imported in Parallels Business Automation - Standard, traffic classes must be presented in the form of XML file. Below we describe all tags used for traffic classes description.

Tag

Description

<data>

The tag that always must open and close any XML file for data import in Parallels Business Automation - Standard.

<traffclass>

The tag that opens and closes a particular traffic class description. There can be several <traffclass> blocks inside the <data> tag.

<id>

A traffic class number. Please, do not mix with numerical ID assigned automatically to all objects in Parallels Business Automation - Standard (a traffic class gets only number). There can be up to 15 traffic classes in Parallels Business Automation - Standard. Thus, a traffic class number can vary from 1 to 15.
Please note that class 1 and class 2 have special meanings and cannot be edited or removed from Parallels Business Automation - Standard.
Class 1 defines the IP address range for which no accounting is done. Usually, it corresponds to the Virtuozzo Hardware Node subnet (the Node itself and its VEs).
Class 2 is defined to match any IP address. It must be always present in the network classes definition file. Other classes should be defined after Class 2. They represent exceptions from the "matching-everything" rule of Class 2.

<mode>

A traffic class importing mode. This tag can contain one of the two values:

  • update - in this mode, the IP ranges specified for a traffic class in XML file will be added to the existing ones, in case you are importing additional ranges for a traffic class already existing in Parallels Business Automation - Standard.

Warning: The update mode means that ip-ranges from this file will be added further to the existing. No any range existing and overlapping checkup will be performed.

  • replace - in this mode the IP ranges specified for a traffic class in XML file will replace the existing IP ranges. Existing IP ranges will be deleted and new IP ranges will be created.

<name>

This tag carries a short friendly name of a traffic class. This name just helps to recognize a class.

<description>

The tag that contains a detailed description (plain text) of a traffic class.

<range>

The tag that contains description of one IP range in a traffic class. There can be several ranges in a traffic class and thus, several <range> blocks can be inside the <traffclass> tag. The <range> tag contains: <ip>, <prefix>, <description>

<ip>

The starting IP address of an IP range.

<prefix>

The netmask in the bit form. For example 24 corresponds to the 255.255.255.0 netmask.

<description>

IP range description (plain text). Description can be empty.

Example of the XML file for traffic classes:

<?xml version="1.0" encoding="UTF-8"?>

<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="import_class_info.xsd">

<traffclass>

<id>4</id>

<mode>update</mode>

<name>Name of traffic class #4</name>

<description> Description of the traffic class.</description>

<range>

<ip>66.6.6.0</ip>

<prefix>24</prefix>

<description>Desc. Can be empty</description>

</range>

<range>

<ip>75.0.0.0</ip>

<prefix>8</prefix>

<description>Desc. Can be empty</description>

</range>

<range>

<ip>120.12.0.0</ip>

<prefix>16</prefix>

</range>

</traffclass>

<traffclass>

<id>6</id>

<mode>replace</mode>

<name>Name of traffic class #6</name>

<description> Description of the traffic class.</description>

<range>

<ip>66.6.6.0</ip>

<prefix>24</prefix>

<description>Description can be empty.</description>

</range>

<range>

<ip>75.0.0.0</ip>

<prefix>8</prefix>

<description>Description can be empty.</description>

</range>

<range>

<ip>120.12.0.0</ip>

<prefix>16</prefix>

</range>

</traffclass>

</data>

Please send us your feedback on this help page