Skip to main content

Manage asset READMEs

READMEs can only be added to assets after an asset exists. (The asset itself must be created first.)

README content is written in HTML

The content of a README needs to be HTML. The HTML should be everything that would be inside the <body></body> tags, but not include the <body></body> tags themselves. (So it should also exclude the outer <html></html> tags.)

Add to existing asset

Each README can be assigned to only a single asset. To create a README and assign it to an asset:

Add or edit README on an existing asset
models:
- name: TOP_BEVERAGE_USERS # (1)
meta:
atlan:
readme: | # (2)
# Overview
This table was changed.
Add helpful context for **consumers** here in Markdown.
  1. Provide the name of the object.
  2. Put your README content (Markdown) under meta.atlan.readme. To edit, simply change the value.

Retrieve README from existing asset

To retrieve a README and its content for an existing asset:

Retrieve README's content from an existing asset
String termQn = "fb45981203221-atlan"; // (1)
var results = client.assets.select() // (2)
.where(Asset.QUALIFIED_NAME.eq(termQn))
.includeOnResults(Asset.README)
.includeOnRelations(Readme.DESCRIPTION)
.stream()
.toList();
System.out.println(results.get(0).getReadme().getDescription()); // (3)
  1. Store the qualified name of the asset (GlossaryTerm) connected to the README in the termQn variable.
  2. Configure the search to match the qualified name, include the README, and fetch its description.
  3. Extract and print the README's content.

Update README attached to existing asset

To update a README and its content for an existing asset:

Updating README's content
String termQn = "fb45981203221-atlan"; // (1)
List<Asset> assets = client.assets.select()
.where(Asset.QUALIFIED_NAME.eq(termQn))
.includeOnResults(Asset.README)
.includeOnRelations(Readme.DESCRIPTION)
.includeOnRelations(Readme.NAME)
.stream()
.toList();

Asset asset = assets.get(0);
String newDescription = "<p>This is the updated README description</p>";
Readme updatedReadme = Readme.updater(asset.getGuid(), asset.getName()) //(2)
.description(newDescription)
.build();

AssetMutationResponse response = updatedReadme.save(client); // (3)
  1. Store the qualified name of the asset (GlossaryTerm) connected to the README in the termQn variable.
  2. Use Readme.updater() to update the README's description.
  3. Save the updated README. Because this operation will persist the asset in Atlan, you must provide it an AtlanClient through which to connect to the tenant.

Remove README from Existing Asset

To remove a README from an existing asset, delete the README itself. (A README is treated as a separate asset with its own GUID.)

To hard-delete (purge) a README, provide the README's GUID:

Remove README via dbt
models:
- name: TOP_BEVERAGE_USERS # (1)
meta:
atlan:
# readme attribute removed to delete README (2)
  1. Provide the name of the object.
  2. To remove the README, delete the readme attribute from meta.atlan. No other changes are needed.
Was this page helpful?