Module: Auth0::Api::V2::Logs
- Included in:
- Auth0::Api::V2
- Defined in:
- lib/auth0/api/v2/logs.rb
Overview
Methods to use the logs endpoints
Instance Attribute Summary collapse
-
#logs_path ⇒ Object
readonly
Logs API path.
Instance Method Summary collapse
-
#log(log_id) ⇒ json
(also: #get_logs_by_id)
Retrieves log entries that match the specified search criteria.
-
#logs(options = {}) ⇒ json
(also: #get_logs)
Retrieves log entries that match the specified search criteria.
Instance Attribute Details
#logs_path ⇒ Object (readonly)
Logs API path
59 60 61 |
# File 'lib/auth0/api/v2/logs.rb', line 59 def logs_path @logs_path end |
Instance Method Details
#log(log_id) ⇒ json Also known as: get_logs_by_id
Retrieves log entries that match the specified search criteria.
51 52 53 54 55 |
# File 'lib/auth0/api/v2/logs.rb', line 51 def log(log_id) raise Auth0::MissingParameter, 'Must supply a valid log_id' if log_id.to_s.empty? path = "#{logs_path}/#{log_id}" get(path) end |
#logs(options = {}) ⇒ json Also known as: get_logs
Retrieves log entries that match the specified search criteria. Default: 50. Max value: 100.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/auth0/api/v2/logs.rb', line 24 def logs( = {}) request_params = { q: .fetch(:q, nil), page: .fetch(:page, nil), per_page: .fetch(:per_page, nil), sort: .fetch(:sort, nil), fields: .fetch(:fields, nil), include_fields: .fetch(:include_fields, nil), include_totals: .fetch(:include_totals, nil), from: .fetch(:from, nil), take: .fetch(:take, nil) } if request_params[:take].to_i > 100 raise Auth0::InvalidParameter, 'The total amount of entries to retrieve should be less than 100' end if request_params[:per_page].to_i > 100 raise Auth0::InvalidParameter, 'The total amount of entries per page should be less than 100' end get(logs_path, request_params) end |