list_datasource_entities

DatasourcesApi.list_datasource_entities(datasource_id, role_id, projection_expression=None, action=None, offset=None, limit=None, sortorder=None, sortby=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

List datasource entities

Lists entities for a datasource. The caller (identified by role_id) must have at least read/view permission (else AUTH-1012). Supports JDBC Bulkload (DMS instances), JDBC Advanced Load (Kafka clusters), and Streams (data transformation functions). Other types return GE-1007. Streams action=get_presigned_url returns an upload URL and EntityId instead of a list.

Parameters:
  • datasource_id (str) – UUID of the datasource. Rejected with IPV-1045 if missing. (required)

  • role_id (str) – Amorphic role ID. Must grant at least read/view access on the datasource. (required)

  • projection_expression (str) – Comma-separated top-level entity keys to return. When omitted, full entity objects are returned. Not used with Streams action=get_presigned_url.

  • action (str) – Streams only. get_presigned_url returns Message, PresignedUrl, and EntityId for uploading a transformation ZIP before create. Ignored for JDBC.

  • offset (str) – 1-based page offset for list results (converted to offset-1 internally). Default start is 0 when omitted. Not used with Streams action=get_presigned_url.

  • limit (str) – Page size. Default 100, max 1000. Over max: IPV-1050 (JDBC) or GE-1028 (Streams). Not used with Streams action=get_presigned_url.

  • sortorder (str) – Sort direction for list results. Default desc. Not used with Streams action=get_presigned_url.

  • sortby (str) – Sort field. Default LastModifiedTime. Not used with Streams action=get_presigned_url.

  • _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:

DatasourceEntityList

Returns:

Returns the result object.

Request and Response Examples

HTTP: GET /datasources/{datasource_id}/entities

Success (HTTP 200)

List: datasourceEntities, next_available (yes|no), count, total_count. Last page when next_available is no. Streams get_presigned_url: Message, PresignedUrl, EntityId instead.

Paginated entity list

{
  "datasourceEntities": [
    {
      "EntityId": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f",
      "EntityName": "shared-dms-1",
      "EntityType": "instances",
      "EntityStatus": "available",
      "EntityConfig": {
        "SharedInstance": "yes",
        "InstanceClass": "dms.t3.medium",
        "AllocatedStorage": 50
      }
    }
  ],
  "next_available": "no",
  "count": 1,
  "total_count": 1
}

Streams action=get_presigned_url

{
  "Message": "Successfully generated presigned url",
  "PresignedUrl": "https://amorphic-misc.s3.amazonaws.com/streams/data-transformations/...?X-Amz-Algorithm=...",
  "EntityId": "c3d8e4f2-9a6b-5c7d-0e1f-3a4b5c6d7e8f"
}

Errors

Documented error codes: AUTH-1012, IPV-1045, GE-1007, IPV-1050, GE-1028, GE-1020.

HTTP 400

Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Common codes: AUTH-1012 (no view access), IPV-1045 (missing datasource), GE-1007 (unsupported datasource type), IPV-1050 / GE-1028 (limit > 1000).

Caller lacks view access

{
  "Message": "AUTH-1012 - User: user1 requires at least read-only access on the resource to perform this action."
}

Unsupported datasource type

{
  "Message": "GE-1007 - Invalid resource path"
}

JDBC list limit over 1000

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

HTTP 500

Backend failure. Body is {“Message”: “<CODE> - <text>”}. Example: GE-1020 when JDBC Bulkload fails to persist entity status.

Failed to update entity metadata

{
  "Message": "GE-1020 - Unable to update Entities table, please retry or contact administrator"
}