Class: Fog::Compute::LibvirtUtil::URI

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/libvirt/models/compute/util/uri.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (URI) initialize(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

- (Object) uri (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

- (Object) command



69
70
71
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 69

def command
  value("command")
end

- (Object) driver



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

- (Object) host



53
54
55
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 53

def host
  @parsed_uri.host
end

- (Object) keyfile



77
78
79
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 77

def keyfile
  value("keyfile")
end

- (Object) name



65
66
67
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 65

def name
  value("name")
end

- (Object) netcat



81
82
83
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 81

def netcat
  value("netcat")
end

- (Boolean) no_tty?



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

- (Boolean) no_verify?



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

- (Object) password



61
62
63
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 61

def password
  @parsed_uri.password
end

- (Object) pkipath



116
117
118
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 116

def pkipath
  value("pkipath")
end

- (Object) port



57
58
59
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 57

def port
  @parsed_uri.port
end

- (Boolean) remote?



45
46
47
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 45

def remote?
  return !transport.nil?
end

- (Object) scheme



26
27
28
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 26

def scheme
  return @parsed_uri.scheme
end

- (Object) socket



73
74
75
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 73

def socket
  value("socket")
end

- (Boolean) ssh_enabled?



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

- (Object) transport

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

- (Boolean) tty?



112
113
114
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 112

def tty?
  return !no_tty?
end

- (Object) user



49
50
51
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 49

def user
  @parsed_uri.user
end

- (Boolean) verify?



96
97
98
# File 'lib/fog/libvirt/models/compute/util/uri.rb', line 96

def verify?
  return !no_verify?
end