Manager
psengine.playbook_alerts.playbook_alert_mgr.PlaybookAlertMgr
¶
Manages requests for Recorded Future playbook alerts.
PARAMETER | DESCRIPTION |
---|---|
rf_token
|
Recorded Future API token.
TYPE:
|
Source code in psengine/playbook_alerts/playbook_alert_mgr.py
fetch
¶
fetch(
alert_id: str,
category: Optional[PACategory] = None,
panels: Optional[list[str]] = None,
fetch_images: Optional[bool] = True,
) -> PLAYBOOK_ALERT_TYPE
Fetch an individual Playbook Alert.
PARAMETER | DESCRIPTION |
---|---|
alert_id
|
Alert ID to fetch.
TYPE:
|
category
|
Category to fetch. If not given,
TYPE:
|
panels
|
Panels to fetch. The
TYPE:
|
fetch_images
|
Fetch images for Domain Abuse & Geopol alerts.
TYPE:
|
Endpoints
playbook-alert/{category}
playbook-alert/common/{alert_id}
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any parameter is of incorrect type. |
PlaybookAlertFetchError
|
If an API-related error occurs. |
RETURNS | DESCRIPTION |
---|---|
PLAYBOOK_ALERT_TYPE
|
One of the Playbook Alert ADTs returned from the API. |
Source code in psengine/playbook_alerts/playbook_alert_mgr.py
fetch_bulk
¶
fetch_bulk(
alerts: Optional[list[tuple[str, PACategory]]] = None,
panels: Optional[list[str]] = None,
fetch_images: Optional[bool] = False,
alerts_per_page: Optional[int] = Field(
ge=1, le=10000, default=ALERTS_PER_PAGE
),
max_results: Optional[int] = DEFAULT_LIMIT,
order_by: Optional[str] = None,
direction: Optional[str] = None,
entity: Union[str, list, None] = None,
statuses: Union[str, list, None] = None,
priority: Union[str, list, None] = None,
category: Union[
PACategory, list[PACategory], None
] = None,
assignee: Union[str, list, None] = None,
created_from: Optional[str] = None,
created_until: Optional[str] = None,
updated_from: Optional[str] = None,
updated_until: Optional[str] = None,
) -> list[PLAYBOOK_ALERT_TYPE]
Fetch multiple playbook alerts in bulk, by query filters or specified alert tuples.
PARAMETER | DESCRIPTION |
---|---|
alerts
|
List of (alert_id, category) tuples to fetch. Overrides search parameters.
TYPE:
|
panels
|
Panels to fetch for each alert. The
TYPE:
|
fetch_images
|
Whether to fetch images for supported alert types.
TYPE:
|
alerts_per_page
|
Number of alerts per page (pagination).
TYPE:
|
max_results
|
Maximum number of alerts to fetch.
TYPE:
|
order_by
|
Field to order alerts by, e.g.
TYPE:
|
direction
|
Sort direction:
TYPE:
|
entity
|
Entity or list of entities to filter alerts by.
TYPE:
|
statuses
|
Status or list of statuses to filter alerts by, e.g.
TYPE:
|
priority
|
Priority or list of priorities, e.g.
TYPE:
|
category
|
Category or list of categories to filter alerts by.
TYPE:
|
assignee
|
Assignee or list of uhashes to filter by.
TYPE:
|
created_from
|
Start of created date range (ISO or relative, e.g.
TYPE:
|
created_until
|
End of created date range (ISO or relative).
TYPE:
|
updated_from
|
Start of updated date range (ISO or relative).
TYPE:
|
updated_until
|
End of updated date range (ISO or relative).
TYPE:
|
Endpoints
playbook-alert/search
playbook-alert/{category}/{alert_id}
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any parameter is of incorrect type. |
PlaybookAlertFetchError
|
If a connection or API error occurs. |
RETURNS | DESCRIPTION |
---|---|
list[PLAYBOOK_ALERT_TYPE]
|
List of playbook alert ADTs matching the query or provided IDs. |
Source code in psengine/playbook_alerts/playbook_alert_mgr.py
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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
|
fetch_images
¶
fetch_images(playbook_alert: PBA_WITH_IMAGES_TYPE) -> None
Retrieve images associated with a playbook alert, if available.
PARAMETER | DESCRIPTION |
---|---|
playbook_alert
|
A playbook alert ADT instance that supports image retrieval.
TYPE:
|
Endpoints
playbook-alert/domain_abuse/{alert_id}/image/{image_id}
playbook-alert/geopolitics_facility/image/{image_id}
Example
Search and retrieve images for alerts:
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If the parameter is of incorrect type. |
PlaybookAlertRetrieveImageError
|
If an API error occurs during image retrieval. |
RETURNS | DESCRIPTION |
---|---|
None
|
This method modifies the input alert in-place by populating its |
Source code in psengine/playbook_alerts/playbook_alert_mgr.py
fetch_one_image
¶
fetch_one_image(
alert_id: Optional[str] = None,
image_id: Optional[str] = None,
alert_category: PBA_WITH_IMAGES_VALIDATOR = 'domain_abuse',
) -> bytes
Retrieve an image from a playbook alert that includes visual content.
PARAMETER | DESCRIPTION |
---|---|
alert_id
|
Alert ID corresponding to the image ID.
TYPE:
|
image_id
|
ID of the image to retrieve.
TYPE:
|
alert_category
|
Category of the alert (e.g., 'domain_abuse', 'geopolitics_facility').
TYPE:
|
Endpoints
playbook-alert/domain_abuse/{alert_id}/image/{image_id}
playbook-alert/geopolitics_facility/image/{image_id}
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any parameter is of incorrect type. |
PlaybookAlertRetrieveImageError
|
If the image fetch request fails. |
RETURNS | DESCRIPTION |
---|---|
bytes
|
Raw image content in bytes. |
Source code in psengine/playbook_alerts/playbook_alert_mgr.py
search
¶
search(
alerts_per_page: Optional[int] = Field(
ge=1, le=10000, default=ALERTS_PER_PAGE
),
max_results: Optional[int] = DEFAULT_LIMIT,
order_by: Optional[str] = None,
direction: Optional[str] = None,
entity: Union[str, list, None] = None,
statuses: Union[str, list, None] = None,
priority: Union[str, list, None] = None,
category: Union[
PACategory, list[PACategory], None
] = None,
assignee: Union[str, list, None] = None,
created_from: Optional[str] = None,
created_until: Optional[str] = None,
updated_from: Optional[str] = None,
updated_until: Optional[str] = None,
) -> SearchResponse
Search for playbook alerts using filters.
PARAMETER | DESCRIPTION |
---|---|
alerts_per_page
|
Number of alerts per page.
TYPE:
|
max_results
|
Maximum total number of alerts to fetch.
TYPE:
|
order_by
|
Field to order alerts by, e.g.
TYPE:
|
direction
|
Sort direction, either
TYPE:
|
entity
|
Entity or list of entities to filter alerts by.
TYPE:
|
statuses
|
Status or list of statuses to filter alerts by.
TYPE:
|
priority
|
Priority or list of priorities to filter alerts by.
TYPE:
|
category
|
Category or list of categories to filter alerts by.
TYPE:
|
assignee
|
Assignee or list of assignees (uhashes) to filter alerts by.
TYPE:
|
created_from
|
Start of created date range (ISO or relative, e.g.
TYPE:
|
created_until
|
End of created date range (ISO or relative).
TYPE:
|
updated_from
|
Start of updated date range (ISO or relative).
TYPE:
|
updated_until
|
End of updated date range (ISO or relative).
TYPE:
|
Endpoint
playbook-alert/search
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any parameter is of incorrect type. |
PlaybookAlertSearchError
|
If a connection or API error occurs. |
RETURNS | DESCRIPTION |
---|---|
SearchResponse
|
Search results matching the alert query. |
Source code in psengine/playbook_alerts/playbook_alert_mgr.py
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
|
update
¶
update(
alert: Union[PLAYBOOK_ALERT_TYPE, str],
priority: Optional[str] = None,
status: Optional[str] = None,
assignee: Optional[str] = None,
log_entry: Optional[str] = None,
reopen_strategy: Optional[str] = None,
) -> Response
Update a playbook alert.
PARAMETER | DESCRIPTION |
---|---|
alert
|
Playbook alert ADT or alert ID to update.
TYPE:
|
priority
|
Updated alert priority (e.g. 'High', 'Low').
TYPE:
|
status
|
Updated alert status (e.g. 'New', 'InProgress').
TYPE:
|
assignee
|
Assignee uhash for the alert.
TYPE:
|
log_entry
|
Text for the alert log entry.
TYPE:
|
reopen_strategy
|
Strategy for reopening closed alerts.
TYPE:
|
Endpoint
playbook-alert/common/{playbook_alert_id}
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any parameter is of incorrect type. |
ValueError
|
If no update parameters are provided. |
PlaybookAlertUpdateError
|
If the update request fails. |
RETURNS | DESCRIPTION |
---|---|
Response
|
API response object for the update operation. |