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 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.
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.
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.
Create the Atlan tag | |
---|---|
6 |
|
- The
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.
Update Atlan tags¶
To update Atlan tags:
Coming soon
Update existing tag structure | |
---|---|
1 2 3 4 5 6 7 8 9 10 |
|
- To ensure you have the complete structure, it is easiest to start by retrieving the existing Atlan tag structure by its hashed-string name.
-
In this example, we're updating the following properties of an Atlan tag:
- color of the tag.
- emoji of the tag.
- display name of the tag.
-
Now use
client.typedef.update()
with the updated tag definition.
Coming soon
PUT /api/meta/types/typedefs | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
- All Atlan tag definitions must be specified within the
classificationDefs
array. -
In this example, we're updating the following properties of an Atlan tag:
- display name of the tag.
- color of the tag.
- emoji of the tag.
Retrieve Atlan tags¶
To retrieve Atlan tag by its hashed-string name eg: S7qnUqZ5mBMBpzQ3Wzt6yD
:
Retrieve existing tag structure | |
---|---|
1 2 |
|
- To retrieve the tag, you need to call the
client.typeDefs.get()
method with its hashed-string name.
Retrieve existing tag structure | |
---|---|
1 2 3 4 |
|
- To retrieve the tag, you need to call the
client.typedef.get_by_name()
method with its hashed-string name.
Retrieve existing tag structure | |
---|---|
1 2 |
|
- To retrieve the tag, you need to call the
client.typeDefs.get()
method with its hashed-string name.
GET /api/meta/types/typedef/name/S7qnUqZ5mBMBpzQ3Wzt6yD | |
---|---|
1 |
|
Atlan tag have a hashed-string representation
Use their hashed-string name when retrieving its structure eg: S7qnUqZ5mBMBpzQ3Wzt6yD
.
Retrieve all Atlan tags¶
To retrieve all Atlan tags:
Retrieve all tag structures | |
---|---|
1 2 |
|
- To retrieve all tags, call the
client.typeDefs.list()
method with the definition categoryAtlanTypeCategory.CLASSIFICATION
.
Retrieve all tag structures | |
---|---|
1 2 3 4 5 |
|
- To retrieve all tags, call the
client.typedef.get()
method with the definition categoryAtlanTypeCategory.CLASSIFICATION
. - Specifically retrieve the list of tags from
TypeDefResponse
.
Retrieve all tag structures | |
---|---|
1 2 |
|
- To retrieve all tags, call the
client.typeDefs.list()
method with the definition categoryAtlanTypeCategory.CLASSIFICATION
.
GET /api/meta/types/typedefs/?type=CLASSIFICATION | |
---|---|
1 |
|
Delete Atlan tags¶
Delete Atlan tags by its human-readable name:
Delete tag structure | |
---|---|
1 |
|
- You only need to call the
AtlanTagDef.purge()
method with the human-readable name of the tag, and it will be deleted.
Delete tag structure | |
---|---|
1 2 3 4 5 |
|
- You only need to call the
clietn.typedef.purge()
method with the human-readable name of the tag, and it will be deleted.
Delete tag structure | |
---|---|
1 |
|
- You only need to call the
AtlanTagDef.purge()
method with the hashed-string name of the tag, and it will be deleted.
DELETE /api/meta/types/typedef/name/S7qnUqZ5mBMBpzQ3Wzt6yD | |
---|---|
1 |
|
Atlan tag have a hashed-string representation
Use their hashed-string name when deleting its structure eg: S7qnUqZ5mBMBpzQ3Wzt6yD
.