Class: UsageClient
- Inherits:
-
BaseClient
- Object
- BaseClient
- UsageClient
- Defined in:
- lib/dal/usage_client.rb
Constant Summary collapse
- USAGE_URL =
'/api/v1/usage/_search-by-devices'
Class Method Summary collapse
Class Method Details
.get_usage(devices, start_day, end_day, unit = 'day') ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/dal/usage_client.rb', line 4 def self.get_usage(devices, start_day, end_day, unit = 'day') url = USAGE_URL post_body = { "aaa-device-ids": devices, "start": start_day.iso8601(3), "end": end_day.iso8601(3), "unit": unit }.to_json res_hash = api_request 'POST', url, {}, post_body res_hash.present? ? res_hash[:data] : nil end |