Class: Fog::Compute::LibvirtUtil::URI
- Inherits:
-
Object
- Object
- Fog::Compute::LibvirtUtil::URI
- Defined in:
- lib/fog/libvirt/models/compute/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.
13 14 15 16 17 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 13 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.
11 12 13 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 11 def uri @uri end |
Instance Method Details
#command ⇒ Object
72 73 74 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 72 def command value("command") end |
#driver ⇒ Object
33 34 35 36 37 38 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 33 def driver scheme=@parsed_uri.scheme return nil if scheme.nil? return scheme.split(/\+/).first end |
#host ⇒ Object
56 57 58 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 56 def host @parsed_uri.host end |
#keyfile ⇒ Object
80 81 82 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 80 def keyfile value("command") end |
#name ⇒ Object
68 69 70 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 68 def name value("name") end |
#netcat ⇒ Object
84 85 86 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 84 def netcat value("netcat") end |
#no_tty? ⇒ Boolean
103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 103 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
88 89 90 91 92 93 94 95 96 97 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 88 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
64 65 66 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 64 def password @parsed_uri.password end |
#pkipath ⇒ Object
120 121 122 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 120 def pkipath value("pkipath") end |
#port ⇒ Object
60 61 62 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 60 def port @parsed_uri.port end |
#remote? ⇒ Boolean
48 49 50 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 48 def remote? return !transport.nil? end |
#scheme ⇒ Object
29 30 31 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 29 def scheme return @parsed_uri.scheme end |
#socket ⇒ Object
76 77 78 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 76 def socket value("socket") end |
#ssh_enabled? ⇒ Boolean
40 41 42 43 44 45 46 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 40 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
22 23 24 25 26 27 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 22 def transport scheme=@parsed_uri.scheme return nil if scheme.nil? return scheme.split(/\+/)[1] end |
#tty? ⇒ Boolean
116 117 118 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 116 def tty? return !no_tty? end |
#user ⇒ Object
52 53 54 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 52 def user @parsed_uri.user end |
#verify? ⇒ Boolean
99 100 101 |
# File 'lib/fog/libvirt/models/compute/uri.rb', line 99 def verify? return !no_verify? end |