list_lineage_events_for_resource

LineageApi.list_lineage_events_for_resource(role_id, resource, id, limit=None, offset=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

List lineage events for a resource

Lists lineage event groups for a resource, sorted by EventTime descending (newest first). For a job, call with resource=jobs (path /jobs/{id}/lineageV2/events). Also supports datasets (/datasets/{id}/lineageV2/events) and datasources (/datasources/{id}/lineageV2/events). Caller must have access to the root resource (else AUTH-1011). Events with the same timestamp are merged; attach/detach targets appear under ResourcesAttached / ResourcesDetached. Pagination: offset is 1-based (handler converts to offset-1); when omitted, paging starts at index 0. limit defaults to 500 and max is 1000 (else IPV-1050). More pages exist when next_available is “yes”; last page when “no”. Safe to retry (read-only).

Parameters:
  • role_id (str) – Amorphic role ID. Must grant access to the root resource. Missing role_id returns AUTH-1001. (required)

  • resource (str) – Resource type segment. Use jobs for /jobs/{id}/lineageV2/events, datasets for /datasets/{id}/lineageV2/events, datasources for /datasources/{id}/lineageV2/events. Other values return GE-1106. (required)

  • id (str) – Resource UUID (JobId when resource=jobs, else DatasetId or DatasourceId). Rejected with IPV-1002 if the resource does not exist. (required)

  • limit (str) – Page size. Defaults to 500. Maximum 1000; values over max return IPV-1050.

  • offset (str) – 1-based page offset (converted to offset-1 when provided). When omitted, paging starts at index 0. Check next_available in the response: “yes” means pass a higher offset; “no” means last page.

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

LineageEventsResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: GET /{resource}/{id}/lineageV2/events

Parameter examples

Name

In

Example

resource

path

"jobs"

id

path

"e4f5a6b7-c8d9-0123-4567-89abcdef0123"

limit

query

500

offset

query

1

Success (HTTP 200)

Paginated Events. Each item has EventTime, Version (vN), Message, ResourcesAttached, and ResourcesDetached. Also returns next_available, count, and total_count.

Attach event for a job (/jobs/{id}/lineageV2/events)

{
  "Events": [
    {
      "EventTime": "2024-06-01 12:00:00",
      "Version": "v1",
      "Message": "Dataset attached to job.",
      "ResourcesAttached": [
        {
          "ResourceType": "datasets",
          "ResourceId": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f",
          "ResourceName": "monthly_orders"
        }
      ],
      "ResourcesDetached": []
    }
  ],
  "next_available": "no",
  "count": 1,
  "total_count": 1
}

Attach event for a dataset (/datasets/{id}/lineageV2/events)

{
  "Events": [
    {
      "EventTime": "2024-06-01 12:00:00",
      "Version": "v1",
      "Message": "Dataset attached to job.",
      "ResourcesAttached": [
        {
          "ResourceType": "jobs",
          "ResourceId": "e4f5a6b7-c8d9-0123-4567-89abcdef0123",
          "ResourceName": "orders_etl"
        }
      ],
      "ResourcesDetached": []
    }
  ],
  "next_available": "no",
  "count": 1,
  "total_count": 1
}

Errors

Documented error codes: AUTH-1001, AUTH-1011, IPV-1002, GE-1106, IPV-1050, GE-1008, EMF-1001.

HTTP 400

Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Common codes: AUTH-1001 (missing role_id), AUTH-1011 (no access to root resource), IPV-1002 (unknown id), GE-1106 (unsupported resource), IPV-1050 (limit > 1000). Note: this lambda maps most typed errors to HTTP 400.

Missing role_id header

{
  "Message": "AUTH-1001 - Missing role information in event header"
}

No access to root resource

{
  "Message": "AUTH-1011 - User user1 is not authorized to view resource details"
}

limit greater than 1000

{
  "Message": "IPV-1050 - Out of range for items per page, Limit is 1000"
}

Unknown job id

{
  "Message": "IPV-1002 - Invalid JobId - e4f5a6b7-c8d9-0123-4567-89abcdef0123, resource not found."
}

Unknown dataset id

{
  "Message": "IPV-1002 - Invalid DatasetId - b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f, resource not found."
}

HTTP 500

Unhandled backend failure. Body is {“Message”: “<CODE> - <text>”} (typically GE-1008 via EMF-1001).

Unexpected failure

{
  "Message": "GE-1008 - Something went wrong, please try after sometime"
}