GET /v1/events
Fetch information about events the activity service tracks. Web session authentication is required.
Request format
When Forming RBAC API requests to this endpoint, the request is a basic call with authentication and one or more query parameters, such as:
auth_header="X-Authentication: $(puppet-access show)" uri="https://$(puppet config print server):4433/activity-api/v1/events?service_id=classifier" curl --header "$auth_header" "$uri"
The following parameters are supported. You must append the service_id
parameter. Other parameters are optional or conditionally
required.
Parameter | Value |
---|---|
service_id
|
Required. The ID of the service you want to query. |
subject_type
|
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
|
A comma-separated list of IDs associated with the defined
subject type. Optional, but, if supplied, then subject_type is required. |
object_type
|
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
|
A comma-separated list of IDs associated with the defined
object type. Optional, but, if supplied, then object_type is required. |
offset
|
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
|
Specify, as a string, 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
|
Specify a positive integer to limit the number of user
records returned. If omitted, the default is 1000 events. |
after_service_commit_time
|
Specify a timestamp in ISO-8601 format if you want to fetch results after a specific service commit time. Optional. |
Response format
The response contains a series of JSON objects representing event records. The response also
reports the total-rows
, which represents the total
number of records matching the supplied query.
For example, this response was based on a request that queried the classifier service
(service_id=classifier
), and events performed by
a specific user (subject_type=users&subject_id=kai
):
{ "commits": [ { "object": { "id": "415dfsvdf-dfgd45dfg-4dsfg54d", "name": "Default Node Group" }, "subject": { "id": "dfgdfc145-545dfg54f-fdg45s5s", "name": "Kai Evans" }, "timestamp": "2014-06-24T04:00:00Z", "events": [ { "message": "Create Node" }, { "message": "Create Node Class" } ] } ], "total-rows": 1 }
As another example, this response was based on a request that queried the classifier
service (service_id=classifier
), and events that
targeted a specific node group (object_type=node_groups&object_id=2
):
{ "commits": [ { "object": { "id": "415dfsvdf-dfgd45dfg-4dsfg54d", "name": "Default Node Group" }, "subject": { "id": "dfgdfc145-545dfg54f-fdg45s5s", "name": "Kai Evans" }, "timestamp": "2014-06-24T04:00:00Z", "events": [ { "message": "Create Node" }, { "message": "Create Node Class" } ] } ], "total-rows": 1 }