Class: PEClient::Resource::ActivityV2

Inherits:
BaseWithPort show all
Defined in:
lib/pe_client/resources/activity.v2.rb

Overview

The activity service records changes to role-based access control (RBAC) entities, such as users, directory groups, and user roles. Use the activity service API to query event data.

Constant Summary collapse

BASE_PATH =

The base path for Activity API v2 endpoints.

"/activity-api/v2"
PORT =

Default Activity API Port

4433

Instance Method Summary collapse

Methods inherited from BaseWithPort

#initialize

Constructor Details

This class inherits a constructor from PEClient::Resource::BaseWithPort

Instance Method Details

#events(service_id: nil, offset: nil, order: nil, limit: nil, query: nil) ⇒ Hash

Fetches information about events the activity service tracks. Allows filtering through query parameters and supports multiple objects for filtering results.

Parameters:

  • service_id (String) (defaults to: nil)

    The ID of the service you want to query. If omitted, all services are queried.

  • offset (Integer) (defaults to: nil)

    Specify a zero-indexed integer to retrieve activity records starting from the offset point. If omitted, the default is 0. This parameter is useful for omitting initial, irrelevant results, such as test data.

  • order (String) (defaults to: nil)

    Specify, whether records are returned in ascending (“asc”) or descending (“desc”) order. If omitted, the default is “desc”. Sorting is based on the activity record’s submission time.

  • limit (Integer) (defaults to: nil)

    Specify a positive integer to limit the number of user records returned. If omitted, the default is 1000 events.

  • query (Array<Hash{Symbol, String => String}>) (defaults to: nil)

Options Hash (query:):

  • :subject_id (String)

    Limit the query to the subject (a user) with the specified ID. If :subject_type is omitted, the type is assumed to be users. Currently, users is the only available :subject_type.

  • :subject_type (String)

    Optional, but if included, you must also include :subject_id. Refer to :subject_id for more information.

  • :object_type (String)

    Limit the activity query to a specific object type (which is the target of activities). Use :object_id to further limit the query to a specific ID within the specified type.

  • :object_id (String)

    An ID associated with a defined object type. If supplied, then :object_type is required.

  • :ip_address (String)

    Specifies an IP address associated with activities. Supports partial string matching.

  • :start (String)

    Supply a timestamp in ISO-8601 format. Must be used with :end to fetch results within a specific service commit time range.

  • :end (String)

    Supply a timestamp in ISO-8601 format. Must be used with :start to fetch results within a specific service commit time range.

Returns:

  • (Hash)


62
63
64
# File 'lib/pe_client/resources/activity.v2.rb', line 62

def events(service_id: nil, offset: nil, order: nil, limit: nil, query: nil)
  @client.get "#{BASE_PATH}/events", params: {service_id:, offset:, order:, limit:, query: query&.to_json}.compact
end