-
Notifications
You must be signed in to change notification settings - Fork 0
Examples
adobkin edited this page Feb 1, 2013
·
1 revision
Examples of managing groups and stations via the perl-avdesk module for Perl
Task:
Create a root user group named My_group. Group UUID must be generated automatically.
Implementation:
use dwavd;
# Specifying parameters of the Dr.Web AV-Desk server
$server = DWAVDesk::Server->init("http://192.168.1.10", 9080, "admin", "root");
# Creating object of a group, setting a reference to it in the $group variable
$group = DWAVDesk::Group->new($server);
# Specifying the group name "My_group"
$group->set_name("My_group");
# Saving the group on the server.
$group->create();
# Printing out ID of the group generated by the server
print $group->id();
Task:
Create a tariff named New_Year. Tariff UUID must be generated automatically. Parent group: Tariffs (994992e8-be71-4d31-a1f5- 5b7786262611). Grace period: 10 days
Implementation:
use dwavd;
# Specifying parameters of the Dr.Web AV-Desk server
$server = DWAVDesk::Server->init("http://192.168.1.10", 9080, "admin", "root");
# Creating object of a tariff group, setting a reference to it in the $tariff variable
$tariff = DWAVDesk::Tariff->new($server);
# Specifying the name of a tariff group
# Parent group "Tariffs" is assigned to the new tariff group automatically
$tariff->set_name("New_Year");
# Setting the grace period of the tariff group
$tariff->set_grace_period(10);
# Saving the tariff group on the server
$tariff->create();
# Printing out ID of the tariff group generated by the server
print $tariff->id();
Task:
Create new station. UUID must be generated automatically. Parent group: My_group (c060a9c0-8f75-4a8c-b2da-044aa0eb98b7). Tariff AV (Dr.Web Classic).
Implementation:
use dwavd;
# Specifying parameters of the Dr.Web AV-Desk server
$server = DWAVDesk::Server->init("http://192.168.1.10", 9080, "admin", "root");
# Creating object of a station, setting a reference to it in the $station variable
$station = DWAVDesk::Station->new($server);
# Specifying the tariff group of a station.
$station->set_tariff_id('c060a9c0-8f75-4a8c-b2da- 044aa0eb98b7');
# Specifying the parent group of the station
$station->set_parent_id(DWAVDesk::TARIFF_ID_CLASSIC);
# Saving the station on the server.
$station->create();
# Printing out ID of the station generated by the server
print $station->id();