Find classified assets

POST /api/meta/search/indexsearch#findClassifiedAssets

Search for assets that have at least one classification.

Body Required

Query to run the search.

  • Replace the value for __typeName.keyword with the name of the asset type
  • Replace the value for qualifiedName with the partial qualified name of the assets (you could also remove the qualifiedName condition entirely to look for all assets that have classifications)
  • The range condition ensures that only columns that have been changed (e.g. classified) after a certain date and time are returned. This could also be removed, but shows an example of how to retrieve a "delta" since some specific point in time.

This example specifically searches for:

  • all columns in any table under the ATLAN_SAMPLE_DATA.FOOD_BEVERAGE schema on Snowflake (the prefix condition acts as a "starts-with" comparison)
  • that have at least one classification (handled by checking for the existence of the __classificationNames property)
  • that have been modified on or after 7 March 2022 14:28:38.537 (handled by the range condition)
  • and sorts the results in a consistent (but undefined) order (for paging) (handled by the sort by _doc)

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

  • the names of propagated classifications for each column (if any)
  • 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, only columns in the ATLAN_SAMPLE_DATA.FOOD_BEVERAGE schema of Snowflake that have at least one classification and were modified on or after a particular date and time.

    • 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#findClassifiedAssets
curl \
 -X POST https://tenant.atlan.com/api/meta/search/indexsearch#findClassifiedAssets \
 -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":"Column"}},{"prefix":{"qualifiedName":"default/snowflake/1646904424/ATLAN_SAMPLE_DATA/FOOD_BEVERAGE"}},{"exists":{"field":"__classificationNames"}},{"range":{"__modificationTimestamp":{"gte":1646663318537}}}]}},"sort":[{"_doc":"asc"}]},"attributes":["__propagatedClassificationNames"]}'
Request example
{
  "dsl": {
    "from": 0,
    "size": 100,
    "query": {
      "bool": {
        "must": [
          {
            "match": {
              "__state": "ACTIVE"
            }
          },
          {
            "match": {
              "__typeName.keyword": "Column"
            }
          },
          {
            "prefix": {
              "qualifiedName": "default/snowflake/1646904424/ATLAN_SAMPLE_DATA/FOOD_BEVERAGE"
            }
          },
          {
            "exists": {
              "field": "__classificationNames"
            }
          },
          {
            "range": {
              "__modificationTimestamp": {
                "gte": 1646663318537
              }
            }
          }
        ]
      }
    },
    "sort": [
      {
        "_doc": "asc"
      }
    ]
  },
  "attributes": [
    "__propagatedClassificationNames"
  ]
}
Response example (200)
{
  "searchParameters": {
    "attributes": [
      "__propagatedClassificationNames"
    ],
    "query": "{\"from\":0,\"size\":100,\"query\":{\"bool\":{\"must\":[{\"match\": {\"__state\":\"ACTIVE\"}},{\"match\":{\"__typeName.keyword\": \"Column\"}},{\"prefix\":{\"qualifiedName\": \"default/snowflake/1646904424/ATLAN_SAMPLE_DATA/FOOD_BEVERAGE\" }},{\"exists\":{\"field\":\"__classificationNames\"}},{\"range\": {\"__modificationTimestamp\":{\"gte\":1646663318537}}}]}}, \"sort\":[{\"_doc\":\"asc\"}]}"
  },
  "entities": [
    {
      "typeName": "Column",
      "attributes": {
        "qualifiedName": "default/snowflake/1646904424/ATLAN_SAMPLE_DATA/FOOD_BEVERAGE/INSTACART_BEVERAGES_ORDER_CUSTOMER/aisle_id",
        "__propagatedClassificationNames": "||J5q2QzErHG4unHTA0C5GE0|EO7Gp8Y6xeI1JHctrlpQhB|",
        "name": "aisle_id",
        "description": "Unique ID of the sub-category"
      },
      "guid": "4663f2d6-8b12-4f65-b94c-7407af10034d",
      "status": "ACTIVE",
      "displayText": "aisle_id",
      "classificationNames": [
        "J5q2QzErHG4unHTA0C5GE0",
        "EO7Gp8Y6xeI1JHctrlpQhB"
      ],
      "classifications": [
        {
          "typeName": "J5q2QzErHG4unHTA0C5GE0",
          "entityGuid": "af6a32d4-936b-4a59-9917-7082c56ba443",
          "entityStatus": "ACTIVE",
          "propagate": true,
          "removePropagationsOnEntityDelete": true
        },
        {
          "typeName": "EO7Gp8Y6xeI1JHctrlpQhB",
          "entityGuid": "85d141c2-d383-4b4f-93a5-c3eed20988b9",
          "entityStatus": "ACTIVE",
          "propagate": true,
          "removePropagationsOnEntityDelete": true
        }
      ],
      "meaningNames": [],
      "meanings": [],
      "isIncomplete": false,
      "labels": [],
      "createdBy": "jsmith",
      "updatedBy": "jdoe",
      "createTime": 1646904643794,
      "updateTime": 1650525230506
    },
    {
      "typeName": "Column",
      "attributes": {
        "qualifiedName": "default/snowflake/1646904424/ATLAN_SAMPLE_DATA/FOOD_BEVERAGE/INSTACART_SNACKS_ORDER_CUSTOMER/CUSTOMER_NAME",
        "__propagatedClassificationNames": "|hzX4hL2bKPtRXWYCODzESy|VwN5VzRHlHVIWB4cbaxM5R |JfGBE5IoFmlJJ1r8xWkol4|EO7Gp8Y6xeI1JHctrlpQhB |J5q2QzErHG4unHTA0C5GE0|EO7Gp8Y6xeI1JHctrlpQhB|",
        "name": "CUSTOMER_NAME",
        "description": "Full name of the user"
      },
      "guid": "4ee204fc-ed37-4f32-9dd6-e393a81f2b01",
      "status": "ACTIVE",
      "displayText": "CUSTOMER_NAME",
      "classificationNames": [
        "hzX4hL2bKPtRXWYCODzESy",
        "EO7Gp8Y6xeI1JHctrlpQhB",
        "VwN5VzRHlHVIWB4cbaxM5R",
        "JfGBE5IoFmlJJ1r8xWkol4",
        "EO7Gp8Y6xeI1JHctrlpQhB",
        "J5q2QzErHG4unHTA0C5GE0",
        "EO7Gp8Y6xeI1JHctrlpQhB"
      ],
      "classifications": [
        {
          "typeName": "hzX4hL2bKPtRXWYCODzESy",
          "entityGuid": "a72189a2-f833-4ef3-bc8d-7d2c7d761c4f",
          "entityStatus": "ACTIVE",
          "propagate": true,
          "removePropagationsOnEntityDelete": true
        },
        {
          "typeName": "EO7Gp8Y6xeI1JHctrlpQhB",
          "entityGuid": "4ee204fc-ed37-4f32-9dd6-e393a81f2b01",
          "entityStatus": "ACTIVE",
          "propagate": true,
          "removePropagationsOnEntityDelete": false
        },
        {
          "typeName": "VwN5VzRHlHVIWB4cbaxM5R",
          "entityGuid": "a72189a2-f833-4ef3-bc8d-7d2c7d761c4f",
          "entityStatus": "ACTIVE",
          "propagate": true,
          "removePropagationsOnEntityDelete": true
        },
        {
          "typeName": "JfGBE5IoFmlJJ1r8xWkol4",
          "entityGuid": "a72189a2-f833-4ef3-bc8d-7d2c7d761c4f",
          "entityStatus": "ACTIVE",
          "propagate": true,
          "removePropagationsOnEntityDelete": true
        },
        {
          "typeName": "EO7Gp8Y6xeI1JHctrlpQhB",
          "entityGuid": "aea9c165-859d-44b9-991f-b8624f60f57a",
          "entityStatus": "ACTIVE",
          "propagate": true,
          "removePropagationsOnEntityDelete": true
        },
        {
          "typeName": "J5q2QzErHG4unHTA0C5GE0",
          "entityGuid": "a72189a2-f833-4ef3-bc8d-7d2c7d761c4f",
          "entityStatus": "ACTIVE",
          "propagate": true,
          "removePropagationsOnEntityDelete": true
        },
        {
          "typeName": "EO7Gp8Y6xeI1JHctrlpQhB",
          "entityGuid\"": "d1181026-9050-4748-ae0a-236e511df26f",
          "entityStatus": "ACTIVE",
          "propagate": true,
          "removePropagationsOnEntityDelete": true
        }
      ],
      "meaningNames": [
        "Name of Person"
      ],
      "meanings": [
        {
          "termGuid": "aea9c165-859d-44b9-991f-b8624f60f57a",
          "relationGuid": "84eaf158-8bdf-4a3d-b096-1a9d43df8f38",
          "displayText": "Name of Person",
          "confidence": 0
        }
      ],
      "isIncomplete": false,
      "labels": [],
      "createdBy": "jsmith",
      "updatedBy": "jdoe",
      "createTime": 1646904620363,
      "updateTime": 1650524555809
    }
  ],
  "approximateCount": 2
}