DomoAlert
DomoAlert ¶
DomoAlert
dataclass
¶
DomoAlert(
auth: DomoAuth,
id: str,
raw: dict,
name: str | None = None,
owner_id: str | None = None,
enabled: bool | None = None,
)
Bases: DomoEntity
Represents a Domo Alert.
create
async
classmethod
¶
create(
auth: DomoAuth,
alert_type: str,
name: str,
owner_id: int,
resource_id: str,
data_source_id: str,
*,
resource_type: str = "CARD",
resource_name: str = "",
operation: str = "GREATER_THAN",
value: str = "",
body: dict[str, Any] | None = None,
return_raw: bool = False,
context: RouteContext | None = None,
**context_kwargs: Any
) -> DomoAlert | ResponseGetData
Create a new alert and return the hydrated :class:DomoAlert.
Builds the alert payload with alert_builder.build_alert_payload (or
accepts a pre-built body for advanced alert types) and calls the
create_alert route.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
DomoAuth instance. |
required |
alert_type
|
str
|
Friendly alert-type name (e.g. |
required |
name
|
str
|
Alert name. |
required |
owner_id
|
int
|
Domo user id of the alert owner. |
required |
resource_id
|
str
|
Card or dataset id the alert monitors. |
required |
data_source_id
|
str
|
Underlying dataset id (for filter groups). |
required |
resource_type
|
str
|
|
'CARD'
|
resource_name
|
str
|
Display name of the monitored resource. |
''
|
operation
|
str
|
Comparison operator (e.g. |
'GREATER_THAN'
|
value
|
str
|
Threshold value as a string. |
''
|
body
|
dict[str, Any] | None
|
Escape hatch — a pre-built alert payload (from
|
None
|
return_raw
|
bool
|
Return the raw create response instead of a DomoAlert. |
False
|
context
|
RouteContext | None
|
Optional RouteContext. |
None
|
Source code in src/crew_dcs/classes/DomoAlert.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
delete
async
¶
delete(
*,
context: RouteContext | None = None,
**context_kwargs: Any
) -> ResponseGetData
Delete this alert.
Source code in src/crew_dcs/classes/DomoAlert.py
164 165 166 167 168 169 170 171 172 173 | |
from_dict
classmethod
¶
Converts an alerts API response into a DomoAlert instance.
Source code in src/crew_dcs/classes/DomoAlert.py
37 38 39 40 41 42 43 44 45 46 47 | |
get_by_id
async
classmethod
¶
get_by_id(
auth: DomoAuth,
alert_id: int | str,
debug_api: bool = False,
session: AsyncClient | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs: Any
) -> DomoAlert | ResponseGetData
Retrieve a single alert by ID.
Source code in src/crew_dcs/classes/DomoAlert.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
get_entity_by_id
async
classmethod
¶
Internal wrapper used by base refresh() method.
Source code in src/crew_dcs/classes/DomoAlert.py
80 81 82 83 84 85 86 87 88 | |
update_owner
async
¶
update_owner(
to_user_id: int | str,
*,
context: RouteContext | None = None,
**context_kwargs: Any
) -> DomoAlert
Change the owner of this alert. Updates self.owner_id in place.
Source code in src/crew_dcs/classes/DomoAlert.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
DomoAlerts
dataclass
¶
DomoAlerts(auth: DomoAuth)
Bases: DomoManager
Manager for DomoAlert collections.
get
async
¶
get(
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs: Any
) -> list[DomoAlert] | ResponseGetData
List all alerts visible to the authenticated user.
Source code in src/crew_dcs/classes/DomoAlert.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
transfer_to_user
async
¶
transfer_to_user(
from_user_id: int | str,
to_user_id: int | str,
*,
context: RouteContext | None = None,
**context_kwargs: Any
) -> list[ResponseGetData]
Transfer all alerts owned by from_user_id to to_user_id.
Source code in src/crew_dcs/classes/DomoAlert.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | |