Class: MiqContainerGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/MiqContainerGroup/MiqContainerGroup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, http_options, headers, guest_os) ⇒ MiqContainerGroup

http_options are in Net::HTTP format.



7
8
9
10
11
12
13
14
15
16
# File 'lib/MiqContainerGroup/MiqContainerGroup.rb', line 7

def initialize(uri, http_options, headers, guest_os)
  @uri = uri
  unless http_options.kind_of?(Hash)
    # backward compatibility, 2nd param used to be verify_mode
    http_options = {:verify_mode => http_options}
  end
  @http_options = {:use_ssl => URI(uri).scheme == 'https'}.merge(http_options)
  @headers      = headers
  @guest_os     = guest_os
end

Instance Attribute Details

#guest_osObject (readonly)

Returns the value of attribute guest_os.



4
5
6
# File 'lib/MiqContainerGroup/MiqContainerGroup.rb', line 4

def guest_os
  @guest_os
end

#headersObject (readonly)

Returns the value of attribute headers.



4
5
6
# File 'lib/MiqContainerGroup/MiqContainerGroup.rb', line 4

def headers
  @headers
end

#http_optionsObject (readonly)

Returns the value of attribute http_options.



4
5
6
# File 'lib/MiqContainerGroup/MiqContainerGroup.rb', line 4

def http_options
  @http_options
end

#uriObject (readonly)

Returns the value of attribute uri.



4
5
6
# File 'lib/MiqContainerGroup/MiqContainerGroup.rb', line 4

def uri
  @uri
end

Instance Method Details

#rootTreesObject



22
23
24
25
26
27
28
29
30
# File 'lib/MiqContainerGroup/MiqContainerGroup.rb', line 22

def rootTrees
  web_dav_ost = OpenStruct.new(
    :uri          => @uri,
    :http_options => @http_options,
    :headers      => @headers,
    :guest_os     => @guest_os
  )
  [MiqFS.new(WebDAV, web_dav_ost)]
end

#verify_modeObject



18
19
20
# File 'lib/MiqContainerGroup/MiqContainerGroup.rb', line 18

def verify_mode
  http_options[:verify_mode]
end