1Sys::Virt::Network(3) User Contributed Perl DocumentationSys::Virt::Network(3)
2
3
4
6 Sys::Virt::Network - Represent & manage a libvirt virtual network
7
9 The "Sys::Virt::Network" module represents a virtual network managed by
10 the virtual machine monitor.
11
13 my $uuid = $net->get_uuid()
14 Returns a 16 byte long string containing the raw globally unique
15 identifier (UUID) for the network.
16
17 my $uuid = $net->get_uuid_string()
18 Returns a printable string representation of the raw UUID, in the
19 format 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'.
20
21 my $name = $net->get_name()
22 Returns a string with a locally unique name of the network
23
24 $net->is_active()
25 Returns a true value if the network is currently running
26
27 $net->is_persistent()
28 Returns a true value if the network has a persistent configuration
29 file defined
30
31 my $xml = $net->get_xml_description()
32 Returns an XML document containing a complete description of the
33 network's configuration
34
35 $net->create()
36 Start a network whose configuration was previously defined using
37 the "define_network" method in Sys::Virt.
38
39 $net->undefine()
40 Remove the configuration associated with a network previously
41 defined with the "define_network" method in Sys::Virt. If the
42 network is running, you probably want to use the "shutdown" or
43 "destroy" methods instead.
44
45 $net->destroy()
46 Immediately terminate the machine, and remove it from the virtual
47 machine monitor. The $net handle is invalid after this call
48 completes and should not be used again.
49
50 $net->update($command, $section, $parentIndex, $xml, $flags=0)
51 Update the network configuration with $xml. The $section parameter,
52 which must be one of the XML SECTION CONSTANTS listed later,
53 indicates what schema is used in $xml. The $command parameter
54 determines what action is taken. Finally, the $flags parameter can
55 be use to control which config is affected.
56
57 $net->get_bridge_name()
58 Return the name of the bridge device associated with the virtual
59 network
60
61 $flag = $net->get_autostart();
62 Return a true value if the virtual network is configured to
63 automatically start upon boot. Return false, otherwise
64
65 $net->set_autostart($flag)
66 Set the state of the autostart flag, which determines whether the
67 virtual network will automatically start upon boot of the host OS.
68
70 This section documents constants that are used with various APIs
71 described above
72
73 LIST FILTERING
74 The following constants are used to filter object lists
75
76 Sys::Virt::Network::LIST_ACTIVE
77 Include networks which are active
78
79 Sys::Virt::Network::LIST_INACTIVE
80 Include networks which are not active
81
82 Sys::Virt::Network::LIST_AUTOSTART
83 Include networks which are set to autostart
84
85 Sys::Virt::Network::LIST_NO_AUTOSTART
86 Include networks which are not set to autostart
87
88 Sys::Virt::Network::LIST_PERSISTENT
89 Include networks which are persistent
90
91 Sys::Virt::Network::LIST_TRANSIENT
92 Include networks which are transient
93
94 XML CONSTANTS
95 The following constants are used when querying XML
96
97 Sys::Virt::Network::XML_INACTIVE
98 Request the inactive XML, instead of the current possibly live
99 config.
100
102 The following constants are used to refer to sections of the XML
103 document
104
105 Sys::Virt::Network::SECTION_BRIDGE
106 The bridge device element
107
108 Sys::Virt::Network::SECTION_DNS_HOST
109 The DNS host record section
110
111 Sys::Virt::Network::SECTION_DNS_SRV
112 The DNS SRV record section
113
114 Sys::Virt::Network::SECTION_DNS_TXT
115 The DNS TXT record section
116
117 Sys::Virt::Network::SECTION_DOMAIN
118 The domain name section
119
120 Sys::Virt::Network::SECTION_FORWARD
121 The forward device section
122
123 Sys::Virt::Network::SECTION_FORWARD_INTERFACE
124 The forward interface section
125
126 Sys::Virt::Network::SECTION_FORWARD_PF
127 The forward physical function section
128
129 Sys::Virt::Network::SECTION_IP
130 The IP address section
131
132 Sys::Virt::Network::SECTION_IP_DHCP_HOST
133 The IP address DHCP host section
134
135 Sys::Virt::Network::SECTION_IP_DHCP_RANGE
136 The IP address DHCP range section
137
138 Sys::Virt::Network::SECTION_PORTGROUP
139 The port group section
140
141 Sys::Virt::Network::SECTION_NONE
142 The top level domain element
143
144 XML UPDATE FLAGS
145 Sys::Virt::Network::UPDATE_AFFECT_CURRENT
146 Affect whatever the current object state is
147
148 Sys::Virt::Network::UPDATE_AFFECT_CONFIG
149 Always update the config file
150
151 Sys::Virt::Network::UPDATE_AFFECT_LIVE
152 Always update the live config
153
154 XML UPDATE COMMANDS
155 Sys::Virt::Network::UPDATE_COMMAND_NONE
156 No update
157
158 Sys::Virt::Network::UPDATE_COMMAND_DELETE
159 Remove the matching entry
160
161 Sys::Virt::Network::UPDATE_COMMAND_MODIFY
162 Modify the matching entry
163
164 Sys::Virt::Network::UPDATE_COMMAND_ADD_FIRST
165 Insert the matching entry at the start
166
167 Sys::Virt::Network::UPDATE_COMMAND_ADD_LAST
168 Insert the matching entry at the end
169
171 Daniel P. Berrange <berrange@redhat.com>
172
174 Copyright (C) 2006 Red Hat Copyright (C) 2006-2007 Daniel P. Berrange
175
177 This program is free software; you can redistribute it and/or modify it
178 under the terms of either the GNU General Public License as published
179 by the Free Software Foundation (either version 2 of the License, or at
180 your option any later version), or, the Artistic License, as specified
181 in the Perl README file.
182
184 Sys::Virt, Sys::Virt::Error, "http://libvirt.org"
185
186
187
188perl v5.10.1 2012-09-26 Sys::Virt::Network(3)