summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/fake_agent.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/fake_agent.rb b/lib/fake_agent.rb
index f5ce3db..ecc9e47 100644
--- a/lib/fake_agent.rb
+++ b/lib/fake_agent.rb
@@ -10,8 +10,7 @@ class FakeAgent
end
def register
- url = "#{endpoint}/agents.json"
- response = Typhoeus.post(url, body: { agent: { hostname: Socket.gethostname } })
+ response = Typhoeus.post(registration_url, body: { agent: { hostname: Socket.gethostname } })
json = JSON.parse(response.body)
@id = json["id"]
end
@@ -113,10 +112,14 @@ class FakeAgent
end
def file_query_url(fingerprint)
- "#{endpoint}/agents/#{id}/files/#{fingerprint}"
+ "#{endpoint}/api/agents/#{id}/files/#{fingerprint}"
end
def event_url
- "#{endpoint}/agents/#{id}/events/"
+ "#{endpoint}/api/agents/#{id}/events/"
+ end
+
+ def registration_url
+ "#{endpoint}/api/agents"
end
end