Class: Morpheus::DashboardInterface

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

Instance Method Summary collapse

Constructor Details

#initialize(access_token, refresh_token, expires_at = nil, base_url = nil) ⇒ DashboardInterface



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

def initialize(access_token, refresh_token,expires_at = nil, base_url=nil) 
  @access_token = access_token
  @refresh_token = refresh_token
  @base_url = base_url
  @expires_at = expires_at
end

Instance Method Details

#dashboard(options = {}) ⇒ Object



15
16
17
18
19
20
# File 'lib/morpheus/api/dashboard_interface.rb', line 15

def dashboard(options={})
  url = "#{@base_url}/api/dashboard"
  headers = { params: {}, authorization: "Bearer #{@access_token}" }
  headers[:params].merge!(options)
  execute(method: :get, url: url, headers: headers)
end

#get(options = {}) ⇒ Object



11
12
13
# File 'lib/morpheus/api/dashboard_interface.rb', line 11

def get(options={})
  dashboard(options)
end

#recent_activity(account_id = nil, options = {}) ⇒ Object



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

def recent_activity(=nil, options={})
  url = "#{@base_url}/api/dashboard/recentActivity"
  headers = { params: {}, authorization: "Bearer #{@access_token}" }
  headers[:params].merge!(options)
  headers[:params]['accountId'] =  if 
  execute(method: :get, url: url, headers: headers)
end