lib/keen/client/maintenance_methods.rb in keen-0.8.3 vs lib/keen/client/maintenance_methods.rb in keen-0.8.4
- old
+ new
@@ -25,11 +25,11 @@
response_body = response.body ? response.body.chomp : ''
process_response(response.code, response_body)
end
- # Runs an events query.
+ # Return list of collections for the configured project
# See detailed documentation here:
# https://keen.io/docs/api/reference/#event-resource
def event_collections
ensure_project_id!
ensure_master_key!
@@ -38,9 +38,28 @@
response = Keen::HTTP::Sync.new(self.api_url, self.proxy_url).get(
:path => "/#{api_version}/projects/#{project_id}/events",
:headers => api_headers(self.master_key, "sync"))
rescue Exception => http_error
raise HttpError.new("Couldn't perform events on Keen IO: #{http_error.message}", http_error)
+ end
+
+ response_body = response.body ? response.body.chomp : ''
+ process_response(response.code, response_body)
+ end
+
+ # Return details for the current project
+ # See detailed documentation here:
+ # https://keen.io/docs/api/reference/#project-resource
+ def project_info
+ ensure_project_id!
+ ensure_master_key!
+
+ begin
+ response = Keen::HTTP::Sync.new(self.api_url, self.proxy_url).get(
+ :path => "/#{api_version}/projects/#{project_id}",
+ :headers => api_headers(self.master_key, "sync"))
+ rescue Exception => http_error
+ raise HttpError.new("Couldn't perform project info on Keen IO: #{http_error.message}", http_error)
end
response_body = response.body ? response.body.chomp : ''
process_response(response.code, response_body)
end