Class: Fog::Compute::LibvirtUtil::URI
- Inherits:
-
Object
- Object
- Fog::Compute::LibvirtUtil::URI
- Defined in:
- lib/fog/libvirt/models/compute/util/uri.rb
Instance Attribute Summary collapse
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #command ⇒ Object
- #driver ⇒ Object
- #host ⇒ Object
-
#initialize(uri) ⇒ URI
constructor
A new instance of URI.
- #keyfile ⇒ Object
- #name ⇒ Object
- #netcat ⇒ Object
- #no_tty? ⇒ Boolean
- #no_verify? ⇒ Boolean
- #password ⇒ Object
- #pkipath ⇒ Object
- #port ⇒ Object
- #remote? ⇒ Boolean
- #scheme ⇒ Object
- #socket ⇒ Object
- #ssh_enabled? ⇒ Boolean
-
#transport ⇒ Object
Transport will be part of the scheme The part after the plus sign f.i.
- #tty? ⇒ Boolean
- #user ⇒ Object
- #verify? ⇒ Boolean
Constructor Details
#initialize(uri) ⇒ URI
Returns a new instance of URI.
10 11 12 13 14 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 10 def initialize(uri) @parsed_uri=::URI.parse(uri) @uri=uri return self end |
Instance Attribute Details
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
8 9 10 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 8 def uri @uri end |
Instance Method Details
#command ⇒ Object
69 70 71 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 69 def command value("command") end |
#driver ⇒ Object
30 31 32 33 34 35 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 30 def driver scheme=@parsed_uri.scheme return nil if scheme.nil? return scheme.split(/\+/).first end |
#host ⇒ Object
53 54 55 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 53 def host @parsed_uri.host end |
#keyfile ⇒ Object
77 78 79 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 77 def keyfile value("keyfile") end |
#name ⇒ Object
65 66 67 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 65 def name value("name") end |
#netcat ⇒ Object
81 82 83 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 81 def netcat value("netcat") end |
#no_tty? ⇒ Boolean
100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 100 def no_tty? no_tty=value("no_tty") return false if no_tty.nil? if no_tty=="0" return false else return true end end |
#no_verify? ⇒ Boolean
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 85 def no_verify? no_verify=value("no_verify") return false if no_verify.nil? if no_verify.to_s=="0" return false else return true end end |
#password ⇒ Object
61 62 63 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 61 def password @parsed_uri.password end |
#pkipath ⇒ Object
116 117 118 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 116 def pkipath value("pkipath") end |
#port ⇒ Object
57 58 59 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 57 def port @parsed_uri.port end |
#remote? ⇒ Boolean
45 46 47 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 45 def remote? return !transport.nil? end |
#scheme ⇒ Object
26 27 28 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 26 def scheme return @parsed_uri.scheme end |
#socket ⇒ Object
73 74 75 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 73 def socket value("socket") end |
#ssh_enabled? ⇒ Boolean
37 38 39 40 41 42 43 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 37 def ssh_enabled? if remote? return transport.include?("ssh") else return false end end |
#transport ⇒ Object
Transport will be part of the scheme The part after the plus sign f.i. qemu+ssh
19 20 21 22 23 24 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 19 def transport scheme=@parsed_uri.scheme return nil if scheme.nil? return scheme.split(/\+/)[1] end |
#tty? ⇒ Boolean
112 113 114 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 112 def tty? return !no_tty? end |
#user ⇒ Object
49 50 51 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 49 def user @parsed_uri.user end |
#verify? ⇒ Boolean
96 97 98 |
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 96 def verify? return !no_verify? end |