-
-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathoperations.py
More file actions
67 lines (45 loc) · 1.31 KB
/
operations.py
File metadata and controls
67 lines (45 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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
64
65
66
67
"""Types for operations."""
import sys
if sys.version_info >= (3, 11):
import typing
else:
import typing_extensions as typing
class SnapshotParameters(typing.TypedDict):
"""
Parameters for creating a snapshot.
Attributes:
snapshot_path (str): The path where the snapshot is stored.
"""
snapshot_path: str
class LogSlowRequestsTimeParams(typing.TypedDict):
"""
Parameters for logging slow requests.
Attributes:
log_slow_requests_time_ms (int): The time in milliseconds to log slow requests.
"""
log_slow_requests_time_ms: int
class HealthCheckResponse(typing.TypedDict):
"""
Response schema for the health check.
Attributes:
ok (bool): The status of the health check.
"""
ok: bool
class SchemaChangesResponse(typing.TypedDict):
"""
Response schema for schema changes.
Attributes:
collection (str): The name of the collection.
validated_docs (int): The number of validated documents.
altered_docs (int): The number of altered documents
"""
collection: str
validated_docs: int
altered_docs: int
class OperationResponse(typing.TypedDict):
"""
Response schema for operations.
Attributes:
success (bool): The status of the operation.
"""
success: bool