Class: Flydata::Api::Agent

Inherits:
Base
  • Object
show all
Defined in:
lib/flydata/api/agent.rb

Instance Method Summary collapse

Methods inherited from Base

#create, #list

Constructor Details

#initialize(api_client) ⇒ Agent

Returns a new instance of Agent.


6
7
8
9
10
# File 'lib/flydata/api/agent.rb', line 6

def initialize(api_client)
  @model_name = 'agent'
  @url_path = "/#{@model_name}"
  super
end

Instance Method Details

#actions(last_id) ⇒ Object


12
13
14
# File 'lib/flydata/api/agent.rb', line 12

def actions(last_id)
  @client.get("#{@url_path}/actions?last_id=#{last_id}")
end

#send_logs(action_id, logs) ⇒ Object


16
17
18
# File 'lib/flydata/api/agent.rb', line 16

def send_logs(action_id, logs)
  @client.post("#{@url_path}/logs", nil, {action_id: action_id, logs: logs})
end