Class: OpsManager::InstallationRunner

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/ops_manager/installation_runner.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/ops_manager/installation_runner.rb', line 6

def id
  @id
end

Class Method Details

.trigger!(products = "all") ⇒ Object



14
15
16
# File 'lib/ops_manager/installation_runner.rb', line 14

def self.trigger!(products = "all")
  new.trigger!(products)
end

Instance Method Details

#trigger!(products = "all") ⇒ Object



8
9
10
11
12
# File 'lib/ops_manager/installation_runner.rb', line 8

def trigger!(products = "all")
  res = trigger_installation( :headers => {"Content-Type"=>"application/json"}, :body => body(products))
  @id = JSON.parse(res.body).fetch('install').fetch('id').to_i
  self
end

#wait_for_resultObject



18
19
20
21
22
23
24
# File 'lib/ops_manager/installation_runner.rb', line 18

def wait_for_result
  while JSON.parse(get_installation(id).body).fetch('status') == 'running'
    print ' .'.green
    sleep 10
  end
  puts ''
end