-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsentry.py
39 lines (27 loc) · 1.14 KB
/
sentry.py
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
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field
from sentinel.models.channel import Channel
from sentinel.models.database import Database
class Sentry(BaseModel):
# Sentry Instance
instance: Optional[Any] = None
# Sentry ID
id: Optional[str] = None
# Sentry Type
type: str
# Sentry Name
name: Optional[str]
# Sentry Descriptions
description: Optional[str] = None
# Sentry Parameters
parameters: Optional[Dict] = Field(default_factory=dict)
inputs: Optional[List[str | Channel]] = Field(default_factory=list)
outputs: Optional[List[str | Channel]] = Field(default_factory=list)
databases: Optional[List[str | Database]] = Field(default_factory=list)
# labels allow to mark a senty for specific purposes.
# For example: label a senty for specific env only, prod or dev
label: Optional[Dict[str, str]] = Field(default_factory=dict)
# restart flag: true means that dispatcher should restart a sentry if it is finished
restart: bool = True
# schedule. Cron-style string to describe periodical sentry runs
schedule: Optional[str] = None