Class: Bosh::Director::Api::ResurrectorManager

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/api/resurrector_manager.rb

Instance Method Summary collapse

Instance Method Details

#set_pause_for_all(desired_state) ⇒ Object



17
18
19
# File 'lib/bosh/director/api/resurrector_manager.rb', line 17

def set_pause_for_all(desired_state)
  Models::Instance.dataset.update(resurrection_paused: desired_state)
end

#set_pause_for_instance(deployment, job_name, index_or_id, desired_state) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/bosh/director/api/resurrector_manager.rb', line 4

def set_pause_for_instance(deployment, job_name, index_or_id, desired_state)

  # This is for backwards compatibility and can be removed when we move to referencing job by instance id only.
  if index_or_id.to_s =~ /^\d+$/
    instance = InstanceLookup.new.by_attributes(deployment, job_name, index_or_id)
  else
    instance = InstanceLookup.new.by_uuid(deployment, job_name, index_or_id)
  end

  instance.resurrection_paused = desired_state
  instance.save
end