Skip to main content

Link domain and assets

Link your asset to a domain for easy discovery and governance.

Add asset to domain

You can add an asset to a domain or update an existing domain by updating the asset's domainGUIDs. In the example below, we're adding a Table (MARKETING_SALES) to the domain (Marketing).

Add an asset to a domain
models:
- name: MARKETING_SALES # (1)
meta:
atlan:
domainName: "Marketing" # (2)
  1. You must give the name of the object.
  2. You can specify the domain as a human-readable name. Each asset can be assigned to only one domain. You can also replace an existing domain assignment by updating the domainName to a different domain.

Retrieve Assets by Domain

You can retrieve all assets associated with a domain by filtering on the domainGUIDs. In the example below, we retrieve all assets linked to the (Marketing) domain.

Retrieve assets from a domain
String domainName = "Marketing";
DataDomain domain = DataDomain.findByName(client, domainName).get(0); // (1)
String domainGuid = domain.getGuid();
List<Asset> result = client.assets.select()
.where(Asset.DOMAIN_GUIDS.eq(domainGuid)) // (2)
.includeOnResults(Asset.NAME)
.includeOnResults(Asset.QUALIFIED_NAME) // (3)
.stream()
.toList();

result.forEach(asset -> { // (4)
System.out.println("Asset Name: " + asset.getName());
System.out.println("Qualified Name: " + asset.getQualifiedName());
});
  1. You can retrieve a data domain by its human-readable name using the findByName() method. Because this operation will look up the domain in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
  2. Query all assets linked to the domain using client.assets.select().where(Asset.DOMAIN_GUIDS.eq(domainGuid)).
  3. Include specific attributes (for example, Asset.NAME, Asset.QUALIFIED_NAME) in the results using .includeOnResults().
  4. Process the retrieved assets and print any specific attributes you need, such as name and qualifiedName in this example.

Remove asset from domain

You can remove an asset from a domain by updating the asset's domainGUIDs. In the example below, we're removing a table (MARKETING_SALES) asset from the existing linked domain.

Remove an asset from a domain
models:
- name: MARKETING_SALES # (1)
meta:
atlan:
domainName: "" # (2)
  1. You must give the name of the object.
  2. To remove the asset from the domain, set the domainName to an empty string.
Was this page helpful?