Create Atlan tags¶
Like other objects in the SDK that you can create, 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 are not managed this way, since they are 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 | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
- Use the
creator()
method to start building up the Atlan tag. - You must provide a name for the Atlan tag (
PII
in this example). - You must also specify the color you want to use for the Atlan tag.
- (Optional) You can also give the Atlan tag a description.
- As with all other builder patterns, you must
build()
the object you've defined. - As an alternative, you can also specify a built-in icon to use for the tag.
- As an alternative, you can also specify your own image to use for the tag.
Build Atlan tag object for creation | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
- Use the
create()
method to set up the Atlan tag with its minimal necessary inputs. - You must provide a name for the Atlan tag (
PII
in this example). - You must also specify the color you want to use for the Atlan tag.
- (Optional) You can also give the Atlan tag a description.
- As an alternative, you can also specify a built-in icon to use for the tag.
- As an alternative, you can download or use your own image file for the tag.
- Before you can use the image, you must upload it to Atlan.
- You can then specify the uploaded image to use for the tag.
Image option not shown
The option to use your own image is significantly more complicated, as it involves constructing a multipart form-encoded upload of the binary image data first, and then using the resulting uploaded object's details to use the image within the tag.
POST /api/meta/types/typedefs | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
- All Atlan tag definitions must be specified within the
classificationDefs
array. - Each definition must be defined with a category set to
CLASSIFICATION
. - Whatever name you provide for the definition will be replaced by a hashed-string generated name by the back-end.
- Specify the name of the Atlan tag, as it should appear in the UI, to the
displayName
. - Set the color to use for the Atlan tag within the
options
object. - (Optional) Set a built-in icon to use within the
options
object. When defining an icon, you must also setoptions.iconType
to"icon"
.
Where can I see each icon?
We use Phosphor for the icons. They have a beautiful icon browser on their site to search and preview the icons.
Create the Atlan tag from the object¶
Now that the object is built, it will have the required information for Atlan to create it:
Create the Atlan tag | |
---|---|
6 |
|
- The
create()
operation will actually create the Atlan tag within Atlan.
Create the Atlan tag | |
---|---|
8 |
|
- The
typedef.create()
operation will actually create the Atlan tag within Atlan.
Creation implicit in step above
The actual creation of the Atlan tag is implicit in the example above.
Now that the Atlan tag has been created, you can use it to tag assets.