prefect.server.models.logs
Functions for interacting with log ORM objects. Intended for internal use by the Prefect REST API.
create_logs(db, session, logs)
async
Creates new logs
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AsyncSession
|
a database session |
required |
logs
|
List[Log]
|
a list of log schemas |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/prefect/server/models/logs.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
read_logs(session, log_filter, offset=None, limit=None, sort=schemas.sorting.LogSort.TIMESTAMP_ASC)
async
Read logs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AsyncSession
|
a database session |
required |
db
|
the database interface |
required | |
log_filter
|
LogFilter
|
only select logs that match these filters |
required |
offset
|
Optional[int]
|
Query offset |
None
|
limit
|
Optional[int]
|
Query limit |
None
|
sort
|
LogSort
|
Query sort |
TIMESTAMP_ASC
|
Returns:
Type | Description |
---|---|
Sequence[Log]
|
List[orm_models.Log]: the matching logs |
Source code in src/prefect/server/models/logs.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|