Class: NewStoreApi::AuditEventsController

Inherits:
BaseController show all
Defined in:
lib/new_store_api/controllers/audit_events_controller.rb

Overview

AuditEventsController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from NewStoreApi::BaseController

Instance Method Details

#list_audit_events(from: nil, to: nil, resource: nil, operation: nil, actor_id: nil, actor_name: nil, resource_id: nil, cursor: nil, page_size: 25) ⇒ AuditEventList

ℹ️ Rate Limit: This endpoint is rate limited to 1 requests per second.
List audit events for the tenant. this RFC 3339 timestamp (inclusive start of the time range). Required together with `to` for a fresh query; omit both when paginating with `cursor`, which resumes the original query and ignores them. this RFC 3339 timestamp (inclusive end of the time range). Required together with `from` for a fresh query; omit both when paginating with `cursor`, which resumes the original query and ignores them. type or identifier affected. the operation performed. NewStore user id (actor.user_id). case-insensitive substring of the actor's display name (actor.display_name). identifier of the specific resource affected. the `next_cursor` from a previous response to fetch the next page; omit it to fetch the first page. The other filter parameters must be unchanged across a paged sequence. return in this page. Defaults to 25; capped at 100. Pagination via `cursor` walks the full result set this many at a time.

Parameters:

  • from (DateTime) (defaults to: nil)

    Optional parameter: Only return events at or after

  • to (DateTime) (defaults to: nil)

    Optional parameter: Only return events at or before

  • resource (String) (defaults to: nil)

    Optional parameter: Filter events by the resource

  • operation (AuditOperationEnum) (defaults to: nil)

    Optional parameter: Filter events by

  • actor_id (String) (defaults to: nil)

    Optional parameter: Filter events by the actor's

  • actor_name (String) (defaults to: nil)

    Optional parameter: Filter events by a

  • resource_id (String) (defaults to: nil)

    Optional parameter: Filter events by the

  • cursor (String) (defaults to: nil)

    Optional parameter: Opaque pagination token. Pass

  • page_size (Integer) (defaults to: 25)

    Optional parameter: Maximum number of events to

Returns:



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/new_store_api/controllers/audit_events_controller.rb', line 43

def list_audit_events(from: nil,
                      to: nil,
                      resource: nil,
                      operation: nil,
                      actor_id: nil,
                      actor_name: nil,
                      resource_id: nil,
                      cursor: nil,
                      page_size: 25)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/system/audit-events',
                                 Server::API)
               .query_param(new_parameter(from, key: 'from'))
               .query_param(new_parameter(to, key: 'to'))
               .query_param(new_parameter(resource, key: 'resource'))
               .query_param(new_parameter(operation, key: 'operation'))
               .query_param(new_parameter(actor_id, key: 'actor_id'))
               .query_param(new_parameter(actor_name, key: 'actor_name'))
               .query_param(new_parameter(resource_id, key: 'resource_id'))
               .query_param(new_parameter(cursor, key: 'cursor'))
               .query_param(new_parameter(page_size, key: 'page_size'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(AuditEventList.method(:from_hash)))
    .execute
end