Class: PEClient::Resource::ActivityV1

Inherits:
BaseWithPort show all
Defined in:
lib/pe_client/resources/activity.v1.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 v1 endpoints.

"/activity-api/v1"
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:, subject_type: nil, subject_id: nil, object_type: nil, object_id: nil, offset: nil, order: nil, limit: nil, after_service_commit_time: nil) ⇒ Hash

Fetch information about events the activity service tracks.

Parameters:

  • service_id (String)

    The ID of the service you want to query.

  • subject_type (String) (defaults to: nil)

    Limit the activity query to a specific subject type (which is the actor of the activity). Use subject_id to further limit the query to specific IDs within the specified type. For example, you can query all user activities or specific users’ activities.

  • subject_id (Array<String>) (defaults to: nil)

    List of IDs associated with the defined subject type. Optional, but, if supplied, then subject_type is required.

  • object_type (String) (defaults to: nil)

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

  • object_id (Array<String>) (defaults to: nil)

    List of IDs associated with the defined object type. Optional, but, if supplied, then object_type is required.

  • 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 limit the number of user records returned. If omitted, the default is 1000 events.

  • after_service_commit_time (String) (defaults to: nil)

    Specify a timestamp in ISO-8601 format if you want to fetch results after a specific service commit time.

Returns:

  • (Hash)


55
56
57
# File 'lib/pe_client/resources/activity.v1.rb', line 55

def events(service_id:, subject_type: nil, subject_id: nil, object_type: nil, object_id: nil, offset: nil, order: nil, limit: nil, after_service_commit_time: nil)
  @client.get "#{BASE_PATH}/events", params: {service_id:, subject_type:, subject_id:, object_type:, object_id:, offset:, order:, limit:, after_service_commit_time:}.compact
end