from meitner import Meitner, models
from meitner.utils import parse_datetime
import os
with Meitner(
security=models.Security(
client_credentials=os.getenv("MEITNER_CLIENT_CREDENTIALS", ""),
client_secret=os.getenv("MEITNER_CLIENT_SECRET", ""),
),
) as m_client:
res = m_client.audit_events.search(filter_={
"equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
"resource_id": "123e4567-e89b-12d3-a456-426614174000",
},
"not_equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
"resource_id": "123e4567-e89b-12d3-a456-426614174000",
},
"greater_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"smaller_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"greater_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"smaller_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"resource_id": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"not_contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"resource_id": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
},
"not_null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
},
"or_condition": True,
}, limit=1, offset=0)
while res is not None:
# Handle items
res = res.next(){
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "987fcdeb-51a2-43d1-b567-123456789abc",
"updatedAt": "2024-01-15T14:45:00Z",
"updatedBy": "987fcdeb-51a2-43d1-b567-123456789abc"
},
"timestamp": "2024-08-01T00:00:00Z",
"resource": "Student",
"resourceID": "123e4567-e89b-12d3-a456-426614174000",
"type": "Delete"
}
],
"pagination": {
"offset": 0,
"limit": 1,
"total": 100
}
}Search for AuditEvents with filtering capabilities.
from meitner import Meitner, models
from meitner.utils import parse_datetime
import os
with Meitner(
security=models.Security(
client_credentials=os.getenv("MEITNER_CLIENT_CREDENTIALS", ""),
client_secret=os.getenv("MEITNER_CLIENT_SECRET", ""),
),
) as m_client:
res = m_client.audit_events.search(filter_={
"equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
"resource_id": "123e4567-e89b-12d3-a456-426614174000",
},
"not_equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
"resource_id": "123e4567-e89b-12d3-a456-426614174000",
},
"greater_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"smaller_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"greater_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"smaller_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"resource_id": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"not_contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"resource_id": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
},
"not_null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
},
"or_condition": True,
}, limit=1, offset=0)
while res is not None:
# Handle items
res = res.next(){
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "987fcdeb-51a2-43d1-b567-123456789abc",
"updatedAt": "2024-01-15T14:45:00Z",
"updatedBy": "987fcdeb-51a2-43d1-b567-123456789abc"
},
"timestamp": "2024-08-01T00:00:00Z",
"resource": "Student",
"resourceID": "123e4567-e89b-12d3-a456-426614174000",
"type": "Delete"
}
],
"pagination": {
"offset": 0,
"limit": 1,
"total": 100
}
}The maximum number of AuditEvents to return (default: 50) when searching AuditEvents
The number of AuditEvents to skip before starting to return results (default: 0) when searching AuditEvents
Request body
Filter criteria to search for specific records
Show child attributes
OrCondition decides if this filter is within an OR-condition or AND-condition
Equality filters for AuditEvent
Show child attributes
Unique identifier for the AuditEvent
Metadata information for the AuditEvent
Show child attributes
Timestamp when the resource was created
User who created the resource
Timestamp when the resource was last updated
User who last updated the resource
{
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
}The timestamp of the event
The type of resource the event occured for
Group, Guardian, Employee, EmployeePlacement, Student, StudentPlacement The ID of the resource the event belongs to
The type of the audit event
Delete {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"timestamp": "2024-01-15T10:30:00Z",
"resourceID": "123e4567-e89b-12d3-a456-426614174000"
}Inequality filters for AuditEvent
Show child attributes
Unique identifier for the AuditEvent
Metadata information for the AuditEvent
Show child attributes
Timestamp when the resource was created
User who created the resource
Timestamp when the resource was last updated
User who last updated the resource
{
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
}The timestamp of the event
The type of resource the event occured for
Group, Guardian, Employee, EmployeePlacement, Student, StudentPlacement The ID of the resource the event belongs to
The type of the audit event
Delete {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"timestamp": "2024-01-15T10:30:00Z",
"resourceID": "123e4567-e89b-12d3-a456-426614174000"
}Greater than filters for AuditEvent
Show child attributes
Metadata information for the AuditEvent
{
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}The timestamp of the event
{
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
}Smaller than filters for AuditEvent
Show child attributes
Metadata information for the AuditEvent
{
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}The timestamp of the event
{
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
}Greater than or equal filters for AuditEvent
Show child attributes
Metadata information for the AuditEvent
{
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}The timestamp of the event
{
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
}Smaller than or equal filters for AuditEvent
Show child attributes
Metadata information for the AuditEvent
{
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}The timestamp of the event
{
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
}Contains filters for AuditEvent
Show child attributes
Unique identifier for the AuditEvent
Metadata information for the AuditEvent
{
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
}The type of resource the event occured for
The resource that was affected by the audit event
Group, Guardian, Employee, EmployeePlacement, Student, StudentPlacement The ID of the resource the event belongs to
The type of the audit event
The type of the audit event
Delete {
"id": ["123e4567-e89b-12d3-a456-426614174000"],
"meta": {
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
},
"resourceID": ["123e4567-e89b-12d3-a456-426614174000"]
}Not contains filters for AuditEvent
Show child attributes
Unique identifier for the AuditEvent
Metadata information for the AuditEvent
{
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
}The type of resource the event occured for
The resource that was affected by the audit event
Group, Guardian, Employee, EmployeePlacement, Student, StudentPlacement The ID of the resource the event belongs to
The type of the audit event
The type of the audit event
Delete {
"id": ["123e4567-e89b-12d3-a456-426614174000"],
"meta": {
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
},
"resourceID": ["123e4567-e89b-12d3-a456-426614174000"]
}Null filters for AuditEvent
Show child attributes
Metadata information for the AuditEvent
{
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}{
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}
}Not null filters for AuditEvent
Show child attributes
Metadata information for the AuditEvent
{
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}{
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}
}NestedFilters of the AuditEvent, useful for more complex filters
{
"equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"timestamp": "2024-01-15T10:30:00Z",
"resourceID": "123e4567-e89b-12d3-a456-426614174000"
},
"notEquals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"timestamp": "2024-01-15T10:30:00Z",
"resourceID": "123e4567-e89b-12d3-a456-426614174000"
},
"greaterThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"smallerThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"greaterOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"smallerOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"contains": {
"id": ["123e4567-e89b-12d3-a456-426614174000"],
"meta": {
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
},
"resourceID": ["123e4567-e89b-12d3-a456-426614174000"]
},
"notContains": {
"id": ["123e4567-e89b-12d3-a456-426614174000"],
"meta": {
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
},
"resourceID": ["123e4567-e89b-12d3-a456-426614174000"]
},
"null": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}
},
"notNull": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}
},
"orCondition": true
}Response for AuditEvent Search operation - returns filtered AuditEvent results
Array of AuditEvent objects
Show child attributes
Unique identifier for the AuditEvent
The timestamp of the event
The type of resource the event occured for
Group, Guardian, Employee, EmployeePlacement, Student, StudentPlacement "Student"
The ID of the resource the event belongs to
The type of the audit event
Delete "Delete"
Metadata information for the AuditEvent
Show child attributes
Timestamp when the resource was created
User who created the resource
Timestamp when the resource was last updated
User who last updated the resource
{
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "987fcdeb-51a2-43d1-b567-123456789abc",
"updatedAt": "2024-01-15T14:45:00Z",
"updatedBy": "987fcdeb-51a2-43d1-b567-123456789abc"
}Pagination information
{ "offset": 0, "limit": 1, "total": 100 }