Find assets by type
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.
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"]}'
{
"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"
]
}
{
"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
}