Class: Morpheus::SnapshotsInterface

Inherits:
APIClient
  • Object
show all
Defined in:
lib/morpheus/api/snapshots_interface.rb

Overview

Snapshots API interface.

Instance Method Summary collapse

Instance Method Details

#get(snapshot_id) ⇒ Object



6
7
8
9
10
11
# File 'lib/morpheus/api/snapshots_interface.rb', line 6

def get(snapshot_id)
  url = "#{@base_url}/api/snapshots/#{snapshot_id}"
  headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  opts = {method: :get, url: url, headers: headers}
  execute(opts)
end

#remove(snapshot_id, payload = {}) ⇒ Object



13
14
15
16
17
18
# File 'lib/morpheus/api/snapshots_interface.rb', line 13

def remove(snapshot_id, payload={})
  url = "#{@base_url}/api/snapshots/#{snapshot_id}"
  headers = {:authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  opts = {method: :delete, url: url, headers: headers, payload: payload.to_json}
  execute(opts)
end