Find assets by type

POST /api/meta/search/indexsearch#findTablesInSchema

Search for all assets with a given type.

Body Required

Query to run the search.

  • Replace the __typeName.keyword with the name of the asset type
  • Provide additional criteria to narrow your results (in this example, the qualifiedName prefix)

This example specifically searches for all tables within the ATLAN_SAMPLE_DATA.FOOD_BEVERAGE schema. Note that you should specify additional limiting criteria: in general you want a search to return less than 10,000 results or the overall result set may be truncated.

In addition to the default set of properties returned in a search, this request will also retrieve:

  • the table's columns
  • the table's certificate status

For the related object (the table's columns) it will also retrieve the columns':

  • name
  • data type
  • dsl object Required

    Search query for Atlan. This uses the Elastic Query DSL, which will not be fully described here due to its complexity.

  • attributes array[string] | null

    List of attribute names to include on each result. These attributes should exist on the assets being searched.

  • relationAttributes array[string] | null

    List of attribute names to include on each relationship included in the results. These attributes should exist on at least one of the relationships that could be returned on one of the assets in the results.

Responses

  • 200 object

    Assets that exactly match the specified parameters. In the case of this example, all tables in the ATLAN_SAMPLE_DATA.FOOD_BEVERAGE schema and all of their columns (including name and data type of each column).

    • Type of query.

      Value is INDEX.

    • Details of the query that was run. These can be used to re-run precisely the same query for paging.

      • attributes array[string]

        List of attribute names requested to be included on each result.

      • relationAttributes array[string]

        List of attribute names requested to be included on each relationship included in the results.

      • Default value is false.

      • Default value is false.

      • Default value is false.

      • query string

        Full DSL query that was received to produce these results, but encoded as a string rather than a JSON object.

    • entities array[object]

      Details of a single result from a search.

      • typeName string

        Name of the type definition that defines this instance.

      • attributes object | null

        Attributes that can exist across all assets in Atlan.

        • Unique name for this asset. This is typically a concatenation of the asset's name onto its parent's qualifiedName.

        • name string

          Human-readable name of the asset.

      • classifications array[object] | null

        Instance of a classification in Atlan, with its detailed information.

        • typeName string

          Name of the classification. Note that this is the static-hashed unique name of the classification, not the human-readable displayName.

        • Unique identifier of the entity to which this classification is attached.

        • propagate boolean | null

          Whether to propagate this classification to other entities related to the entity to which the classification is attached.

        • Whether to remove this classification from other entities to which it has been propagated when the classification is removed from this entity.

        • entityStatus string | null

          Status of the entity to which this classification is attached.

          Values are ACTIVE or DELETED.

      • displayText string | null

        Human-readable name of the entity.

      • guid string

        Unique identifier of the entity instance.

      • isIncomplete boolean | null

        Default value is false.

      • createdBy string | null

        Username of the user who created the object.

      • updatedBy string | null

        Username of the user who last updated the object.

      • createTime integer | null

        Time (epoch) at which this object was created, in milliseconds.

      • updateTime integer | null

        Time (epoch) at which this object was last updated, in milliseconds.

      • version integer | null

        Version of this object.

      • classificationNames array[string] | null

        List of classifications for this entity. Note that these are the internal hashed names used in Atlan, not the displayText of the classification.

      • labels array[string] | null

        Internal use only.

      • status string

        Status of the entity, either ACTIVE or DELETED.

        Values are ACTIVE or DELETED.

      • meaningNames array[string] Deprecated

        Unused.

      • meanings array[object] Deprecated

        Unused.

    • Approximate count of the total number of results.

POST /api/meta/search/indexsearch#findTablesInSchema
curl \
 -X POST https://tenant.atlan.com/api/meta/search/indexsearch#findTablesInSchema \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"dsl":{"from":0,"size":100,"query":{"bool":{"must":[{"match":{"__state":"ACTIVE"}},{"match":{"__typeName.keyword":"Table"}},{"prefix":{"qualifiedName":"default/snowflake/1646904424/ATLAN_SAMPLE_DATA/FOOD_BEVERAGE"}}]}},"sort":[{"_doc":"asc"}]},"attributes":["certificateStatus","columns"],"relationAttributes":["name","dataType"]}'
Request example
{
  "dsl": {
    "from": 0,
    "size": 100,
    "query": {
      "bool": {
        "must": [
          {
            "match": {
              "__state": "ACTIVE"
            }
          },
          {
            "match": {
              "__typeName.keyword": "Table"
            }
          },
          {
            "prefix": {
              "qualifiedName": "default/snowflake/1646904424/ATLAN_SAMPLE_DATA/FOOD_BEVERAGE"
            }
          }
        ]
      }
    },
    "sort": [
      {
        "_doc": "asc"
      }
    ]
  },
  "attributes": [
    "certificateStatus",
    "columns"
  ],
  "relationAttributes": [
    "name",
    "dataType"
  ]
}
Response example (200)
{
  "searchParameters": {
    "attributes": [
      "certificateStatus",
      "columns"
    ],
    "relationAttributes": [
      "name",
      "dataType"
    ],
    "query": "{\"from\":0,\"size\":100,\"query\":{\"bool\":{\"must\":[{\"match\": {\"__state\":\"ACTIVE\"}},{\"match\":{\"__typeName.keyword\": \"Table\"}},{\"prefix\":{\"qualifiedName\": \"default/snowflake/1646904424/ ATLAN_SAMPLE_DATA/FOOD_BEVERAGE\" }}]}},\"sort\":[{\"_doc\":\"asc\"}]}"
  },
  "entities": [
    {
      "typeName": "Table",
      "attributes": {
        "certificateStatus": "VERIFIED",
        "qualifiedName": "default/snowflake/1646904424/ATLAN_SAMPLE_DATA/ FOOD_BEVERAGE/SALES_MKT_EXPENSES",
        "columns": [
          {
            "guid": "6fd50ecc-2101-434f-891e-1cebeda516c9",
            "typeName": "Column",
            "attributes": {
              "dataType": "VARCHAR",
              "name": "MKT_CATEGORY"
            },
            "uniqueAttributes": {
              "qualifiedName": "default/snowflake/1646904424/ATLAN_SAMPLE_DATA/ FOOD_BEVERAGE/SALES_MKT_EXPENSES/MKT_CATEGORY"
            }
          },
          {
            "guid": "c9f68471-4bac-4ade-a795-ce8a7df3ead9",
            "typeName": "Column",
            "attributes": {
              "dataType": "VARCHAR",
              "name": "MKT_MEDIUM_NAME"
            },
            "uniqueAttributes": {
              "qualifiedName": "default/snowflake/1646904424/ATLAN_SAMPLE_DATA/ FOOD_BEVERAGE/SALES_MKT_EXPENSES/MKT_MEDIUM_NAME"
            }
          },
          {
            "guid": "d4d61d80-7550-4fa5-9da6-7d89b167175a",
            "typeName": "Column",
            "attributes": {
              "dataType": "NUMBER",
              "name": "MKT_SPEND"
            },
            "uniqueAttributes": {
              "qualifiedName": "default/snowflake/1646904424/ATLAN_SAMPLE_DATA/ FOOD_BEVERAGE/SALES_MKT_EXPENSES/MKT_SPEND"
            }
          },
          {
            "guid": "256bea3e-b214-4e02-ae99-f9bb9a8b7d5c",
            "typeName": "Column",
            "attributes": {
              "dataType": "NUMBER",
              "name": "MKT_MEDIUM_ID"
            },
            "uniqueAttributes": {
              "qualifiedName": "default/snowflake/1646904424/ATLAN_SAMPLE_DATA/ FOOD_BEVERAGE/SALES_MKT_EXPENSES/MKT_MEDIUM_ID"
            }
          }
        ],
        "name": "SALES_MKT_EXPENSES",
        "description": "All the expenses for the sales and marketing team"
      },
      "guid": "035c6998-ab30-4b7c-861b-fe6c36550a41",
      "status": "ACTIVE",
      "displayText": "SALES_MKT_EXPENSES",
      "classificationNames": [],
      "classifications": [],
      "meaningNames": [],
      "meanings": [],
      "isIncomplete": false,
      "labels": [],
      "createdBy": "jsmith",
      "updatedBy": "jdoe",
      "createTime": 1646904590693,
      "updateTime": 1646912069460
    }
  ],
  "approximateCount": 1
}