resolve_project_id_for_task#

MonitorApi.resolve_project_id_for_task(task_id, *, backlog=1, max_messages=5)#

Infer project ID for a task from task-log message tags.

Reads a small number of task-log messages and extracts project_id from either message["tags"]["project_id"] (preferred) or the top-level message["project_id"] field when present.

Return type:

str

Parameters:
task_idstr

Task identifier to inspect.

backlogint, optional

Number of historical log messages to request. The default is 1.

max_messagesint, optional

Maximum messages to inspect before failing. The default is 5.

Returns:
str

Project identifier associated with task_id.

Raises:
ClientError

If no inspected message provides a project ID.