audit_logs
Creates, updates, deletes, gets or lists an audit_logs resource.
Overview​
| Name | audit_logs |
| Type | Resource |
| Id | railway.workspaces.audit_logs |
Fields​
The following fields are returned by SELECT queries:
- get
- list
One AuditLog row.
| Name | Datatype | Description |
|---|---|---|
id | string | |
environment_id | string | |
project_id | string | |
workspace_id | string | |
context | object | |
created_at | string (date-time) | |
environment | object | Environment object |
event_type | string | |
payload | object | |
project | object | Project object |
One row per AuditLog.
| Name | Datatype | Description |
|---|---|---|
id | string | |
environment_id | string | |
project_id | string | |
workspace_id | string | |
context | object | |
created_at | string (date-time) | |
environment | object | Environment object |
event_type | string | |
payload | object | |
project | object | Project object |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, workspace_id | Get an audit log by ID. Backed by the Railway GraphQL query auditLog. | |
list | select | workspace_id | end_date, environment_id, event_types, project_id, start_date, sort | Gets audit logs for a workspace. Backed by the Railway GraphQL query auditLogs. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the audit log entry. |
workspace_id | string | |
end_date | string (date-time) | Filter events created on or before this date. |
environment_id | string | Filter events for a single environment. |
event_types | string | List of event types to filter by. GraphQL list literal, for example ["a", "b"]. |
project_id | string | Filter events for a single project. |
sort | string | |
start_date | string (date-time) | Filter events created on or after this date. |
SELECT examples​
- get
- list
Get an audit log by ID. Backed by the Railway GraphQL query auditLog.
SELECT
id,
environment_id,
project_id,
workspace_id,
context,
created_at,
environment,
event_type,
payload,
project
FROM railway.workspaces.audit_logs
WHERE id = '{{ id }}' -- required
AND workspace_id = '{{ workspace_id }}' -- required
;
Gets audit logs for a workspace. Backed by the Railway GraphQL query auditLogs.
SELECT
id,
environment_id,
project_id,
workspace_id,
context,
created_at,
environment,
event_type,
payload,
project
FROM railway.workspaces.audit_logs
WHERE workspace_id = '{{ workspace_id }}' -- required
AND end_date = '{{ end_date }}'
AND environment_id = '{{ environment_id }}'
AND event_types = '{{ event_types }}'
AND project_id = '{{ project_id }}'
AND start_date = '{{ start_date }}'
AND sort = '{{ sort }}'
;