Skip to main content
Skip table of contents

Using Metadata Interface

Guide objective

This guide explains how to use the Metadata Interface.

Edition: SaaS Enterprise

The Metadata Interface is used to query metadata of your Agile Data Engine tenant. It contains metadata about packages, entities, loads, schedules, workflows etc. Use External API to connect the Metadata Interface. For test and development purposes, you can use the Swagger UI or a GraphQL client such as GraphQL Playground or Postman.

Metadata Interface Data Model

An “indicative“ ER model of the Metadata Interface can be found below. Remember to check the model in the Metadata Interface itself, because the model may vary slightly between different versions.

Metadata in Design & Runtime environments

Note that the available metadata depends on environment:

  • Design environment (DESIGN)

    • Entity & package metadata as seen in the Designer

    • Deployment management metadata (commits, promotions, deployments…)

  • Runtime environments (e.g. DEV, TEST, PROD)

    • Entity & package metadata as deployed to the Runtime

    • Workflow metadata

Make sure to connect to the correct environment when making Metadata Interface queries.

Connect to Metadata Interface using Swagger UI

Go to Metadata related API in Swagger UI.

Enter the tenant, installation, environment, and then press Authorize.

Enter the API keys and press Authorize after the id and the secret.

Connect to Metadata Interface using GraphQL Playground

To connect the Metadata Interface using GraphQL Playground, you need to first install the tool and then connect to Metadata Interface:

CODE
# Endpoint URL
https://external.services.saas.agiledataengine.com/external-api/api/<tenant>/<installation>/<environment>/metadata/v1/graphql

# HTTP HEADERS
{
  "X-API-KEY-ID": "<X-API-KEY-ID>" , 
  "X-API-KEY-SECRET": "<X-API-KEY-SECRET>"
}

Connecting to Metadata Interface

Schema and Docs Tabs

GraphQL Playground has schema and docs tabs. The schema tab has a list of types and their fields and the docs tab has a list of queries and types related to the selected query.

Docs view with entity_list query selected

Connect to Metadata Interface using Postman

To connect the Metadata Interface using Postman:

  1. Install the tool and sign in.

  2. Click New and GraphQL.

  3. Enter the URL, replace <tenant>, <installation> and <environment> with your values (see External API):

    CODE
    https://external.services.saas.agiledataengine.com/external-api/api/<tenant>/<installation>/<environment>/metadata/v1/graphql
  4. In Headers, enter the API key & API key secret:

Key

Value

X-API-KEY-ID

abd123…

X-API-KEY-SECRET

def456…

  1. In Query wait for the GraphQL introspection to load. Then you can use the schema browser to generate queries and run them against the API, for example:

image-20241210-114203.png

Example Queries

Query schema

Use the following query to get the available types and their fields.

CODE
{__schema {types
 {name
  kind
  fields {name
  description}
  }}}

Schema content query and result in GraphQL Playground

Schema content query in Swagger UI

Query Entities

Query without variables

Use the following query to list 100 entities with selected fields.

CODE
# query
query{entity_list(size: 100, page: 0) 
  { page
    hasNextPage
    pageSize
    content {
      ... on ENTITY {
        id
        package_id
        schema
        name
        type
        physical_type
        source_id
      }
    }
  } 
}

Entity list query and result in GraphQL Playground

Query with variables

Use the following query to list entities with selected fields using variables.

CODE
# query
query($size: Int! $page: Int!){entity_list(size: $size, page: $page) 
  { page
    hasNextPage
    pageSize
    content {
      ... on ENTITY {
        id
        package_id
        schema
        name
        type
        physical_type
        source_id
      }
    }
  } 
}


# query variables
{
 "size": 100, 
 "page": 0
 }

Entity list query with variables and result in GraphQL Playground

Query Packages

Use the following query to list 100 packages with selected fields.

CODE
# query
query($size: Int! $page: Int!){package_list(size: $size, page: $page) 
  { page
    hasNextPage
    pageSize
    content {
      ... on PACKAGE {
        id
        type
        is_deleted
        version
        name
        status
      }
    }
  } 
}

# query variables
{
 "size": 100, 
 "page": 0
}

Package list query and result in GraphQL Playground

Query Fields of Specific Entity

Query the fields of the specific entity using entity id.

CODE
# query
query($entity_id: String!){entity(id: $entity_id)
  { id
    package_id
    schema
    name
    type
    physical_type
  }
}

# query variables
{"entity_id": "986ff984-1354-4e9d-889c-34ccc1a170e9"}

Entity specific query and result in GraphQL Playground

Query Workflow Statuses

Use the following query to list the workflow statuses.

CODE
# query
query ($startTimeFrom: IsoDateTimeAtUtcScalar!, 
  $startTimeTo: IsoDateTimeAtUtcScalar!, $size: Int! $page: Int!) {
  workflow_stats_list(startTimeFrom: $startTimeFrom, startTimeTo: $startTimeTo, 
    size: $size, page: $page) {
    page
    pageSize
    hasNextPage
    content {
      ... on WORKFLOW_STATS {
        id
        workflow_execution_id
        name
        start_time
        end_time
        exec_time_ms
        is_successful
      }
    }
  }
}

# query variables
{
  "startTimeFrom": "2023-09-13T00:00:00.000000",
  "startTimeTo": "2023-09-13T23:59:59.999999",
  "size": 20, 
  "page": 0
}

Workflow stats list query and result in GraphQL Playground

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.