Class: Morpheus::LicenseInterface

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

Instance Method Summary collapse

Instance Method Details

#getObject



5
6
7
8
9
# File 'lib/morpheus/api/license_interface.rb', line 5

def get()
  url = "#{@base_url}/api/license"
  headers = { params: {}, authorization: "Bearer #{@access_token}" }
  execute(method: :get, url: url, headers: headers)
end

#install(payload) ⇒ Object



11
12
13
14
15
# File 'lib/morpheus/api/license_interface.rb', line 11

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

#test(payload) ⇒ Object



17
18
19
20
21
22
# File 'lib/morpheus/api/license_interface.rb', line 17

def test(payload)
  # use /test instead, since 4.1.1
  url = "#{@base_url}/api/license/decode"
  headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  execute(method: :post, url: url, headers: headers, payload: payload.to_json)
end

#uninstall(params = {}) ⇒ Object



24
25
26
27
28
# File 'lib/morpheus/api/license_interface.rb', line 24

def uninstall(params={})
  url = "#{@base_url}/api/license"
  headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  execute(method: :delete, url: url, headers: headers)
end