Skip to main content

Manage Atlan tags

Similar to other objects you can create in the SDK, Atlan tags implement the builder pattern.

Atlan tags vs tags in general

Note that we intentionally use the phrase Atlan tag here to differentiate tags you can structurally maintain in Atlan vs other tags in general. For example, Snowflake tags aren't managed this way, since they're owned and managed in Snowflake.

Build minimal object needed

For example, to create an Atlan tag to identify personally-identifiable information:

Build Atlan tag object for creation
AtlanTagDef color = AtlanTagDef.creator( // (1)
"PII", // (2)
AtlanTagColor.RED) // (3)
.description("Personally-Identifiable Information") // (4)
.build(); // (5)
AtlanTagDef icon = AtlanTagDef.creator(
"PII",
AtlanIcon.PASSWORD, // (6)
AtlanTagColor.RED)
.build();
AtlanTagDef image = AtlanTagDef.creator(
"PII",
"http://some.example.com/image.png", // (7)
AtlanTagColor.RED)
.build();
  1. Use the creator() method to start building up the Atlan tag.
  2. You must provide a name for the Atlan tag (PII in this example).
  3. You must also specify the color you want to use for the Atlan tag.
  4. (Optional) You can also give the Atlan tag a description.
  5. As with all other builder patterns, you must build() the object you've defined.
  6. As an alternative, you can also specify a built-in icon to use for the tag.
  7. As an alternative, you can also specify your own image to use for the tag.

Create Atlan tag from object

Now that the object is built, it will have the required information for Atlan to create it:

Create the Atlan tag
AtlanTagDef response = atlanTagDef.create(client); // (1)
  1. The create() operation will actually create the Atlan tag within Atlan. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.

Update Atlan tags

To update Atlan tags:

Coming soon

Retrieve Atlan tags

To retrieve Atlan tag by its hashed-string name eg: S7qnUqZ5mBMBpzQ3Wzt6yD:

Retrieve existing tag structure
TypeDef atlanTag = client.typeDefs.get("S7qnUqZ5mBMBpzQ3Wzt6yD"); // (1)
  1. To retrieve the tag, you need to call the .typeDefs.get() method on a client, with the hashed-string name of the tag.

Retrieve all Atlan tags

To retrieve all Atlan tags:

Retrieve all tag structures
TypeDefResponse atlanTags = client.typeDefs.list(AtlanTypeCategory.CLASSIFICATION); // (1)
  1. To retrieve all tags, call the .typeDefs.list() method on a client, with the category AtlanTypeCategory.CLASSIFICATION.

Delete Atlan tags

Delete Atlan tags by its human-readable name:

Delete tag structure
AtlanTagDef.purge(client, "MyTagName"); // (1)
  1. You only need to call the AtlanTagDef.purge() method with the human-readable name of the tag, and it will be deleted. Because this operation will remove the structure from Atlan, you must provide it an AtlanClient through which to connect to the tenant.
Was this page helpful?