Method: Pho::CommandLine#restore

Defined in:
lib/pho/command_line.rb

#restoreObject



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/pho/command_line.rb', line 99

def restore()
  url = @opts["url"]     
  if url == nil
    puts "Restoring #{@store.storeuri} from latest snapshot"
    snapshot = Pho::Snapshot.read_from_store(@store)
    url = snapshot.url
  end
  puts "Restoring from #{url}"    
  resp = Pho::Jobs.submit_restore(@store, url, "Reset", Time.now)
  puts "Monitoring Restore Job: #{resp.header["Location"].first}"
  job = Pho::Jobs.(resp, @store) do |job, message, time|
    puts "#{time} #{message}"
  end 
  puts "Restore Completed"      
end