NAME
Protocol::Sys::Virt::URI - Helper routines for parsing LibVirt URIs
VERSION
v10.10.13
SYNOPSIS
use Protocol::Sys::Virt::URI;
my %components = parse_url( 'qemu+ssh://user@password:host/system?param=value' );
DESCRIPTION
Helper functions operating on LibVirt hypervisor URLs.
FUNCTIONS
parse_url
my %components = parse_url( 'qemu+ssh://user@hostname:port/system?param=value&mode=legacy&socket=/path/socket' );
# { base => 'qemu+ssh://user@password:host/system',
# proxy => 'qemu:///system?mode=legacy&socket=/path/socket',
# name => 'qemu:///system',
# type => 'system',
# query => { param => 'value', mode => 'legacy', socket => '/path/socket' },
# transport => 'ssh',
# hypervisor => 'qemu',
# username => 'user,
# host => 'hostname',
# port => 'port',
# }
Splits the URL into the components necessary for use with the LibVirt API.
- base
-
This is the URL without the query string and fragment.
- proxy
-
This is the URL to be passed through to a proxy: it strips all but the parameters applicable to the end point (currently the
socket
andmode
parameters are passed through). - name
-
This is the URL as it should be passed to the
name
parameter in the protocol'sREMOTE_PROC_CONNECT_OPEN
message. - type
-
This is the type of session. The value can either be
system
orsession
. - query
-
Contains a hashref with the (URI-decoded) name/value pairs from the query string.
- transport
-
The fraction of the protocol following the
+
; eg.,ssh
inqemu+ssh
. - hypervisor
-
The fraction of the protocol before the
+
, or lacking a plus-sign, the protocol; eg.,qemu
inqemu+ssh
. - username
-
The user name embedded in the URL, preceeding the host name, if any.
- host
-
The name (or IP address) of the host with the hypervisor.
- port
-
The port on the host with the hypervisor to connect to.
SEE ALSO
LICENSE AND COPYRIGHT
See the LICENSE file in this distribution.