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 thequalifiedName
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 (theprefix
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.
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
}