ListAuditLogs
events.list(EventListParams**kwargs) -> SyncEntriesPage[EventListResponse]
POST/gitpod.v1.EventService/ListAuditLogs
Lists audit logs with filtering and pagination options.
Use this method to:
- View audit history
- Track user actions
- Monitor system changes
Examples
-
List all logs:
pagination: pageSize: 20 -
Filter by actor:
filter: actorIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] actorPrincipals: ["PRINCIPAL_USER"] pagination: pageSize: 20 -
Filter by time range:
filter: from: "2024-01-01T00:00:00Z" to: "2024-02-01T00:00:00Z" pagination: pageSize: 20
ListAuditLogs
import os
from gitpod import Gitpod
client = Gitpod(
bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted
)
page = client.events.list(
filter={
"actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"],
"actor_principals": ["PRINCIPAL_USER"],
},
pagination={
"page_size": 20
},
)
page = page.entries[0]
print(page.id){
"entries": [
{
"id": "id",
"action": "action",
"actorId": "actorId",
"actorPrincipal": "PRINCIPAL_UNSPECIFIED",
"createdAt": "2019-12-27T18:11:19.117Z",
"subjectId": "subjectId",
"subjectType": "RESOURCE_TYPE_UNSPECIFIED"
}
],
"pagination": {
"nextToken": "nextToken"
}
}Returns Examples
{
"entries": [
{
"id": "id",
"action": "action",
"actorId": "actorId",
"actorPrincipal": "PRINCIPAL_UNSPECIFIED",
"createdAt": "2019-12-27T18:11:19.117Z",
"subjectId": "subjectId",
"subjectType": "RESOURCE_TYPE_UNSPECIFIED"
}
],
"pagination": {
"nextToken": "nextToken"
}
}