Deleting assets¶
Deleting an asset uses a similar pattern to the retrieval operations. For this you can use static methods provided by the Asset
class.
Avoid deleting connections
If you want to delete a connection and all of its assets, consider using the connection delete package instead. In particular, avoid deleting a connection directly (using the methods below) without first deleting the assets contained within it. Once you delete a connection, you will be unable to delete any assets that were within it.
Soft-delete an asset¶
Soft-deletes (also called an archive) are a reversible operation. The status of the asset is changed to DELETED
and it no longer appears in the UI, but the asset is still present in Atlan's back-end.
To soft-delete (archive) an asset, you only need to provide the GUID:
Soft-delete an asset | |
---|---|
1 2 3 4 5 6 7 |
|
- The
delete()
method returns the deleted form of the asset. Because this operation will archive the asset in Atlan, you must provide it anAtlanClient
through which to connect to the tenant. - You can distinguish what was deleted through the
getDeletedAssets()
method. This lists only the assets deleted by the operation. - The
Asset
class is a superclass of all assets. So you need to cast to more specific types (likeGlossary
) after verifying the object that was actually returned.
Soft-delete an asset | |
---|---|
1 2 3 4 5 6 7 |
|
- The
asset.delete_by_guid()
method returns the deleted form of the asset. - The
assets_deleted(asset_type=AtlasGlossary)
method returns a list of the assets of the given type that were deleted. - If an asset of the given type was deleted, then the deleted form of the asset is available.
Soft-delete an asset | |
---|---|
1 2 3 4 |
|
- The
delete()
method returns the deleted form of the asset. Because this operation will archive the asset in Atlan, you must provide it anAtlanClient
through which to connect to the tenant. - You can distinguish what was deleted through the
deletedAssets
method. This lists only the assets deleted by the operation. - The
Asset
class is a superclass of all assets. So you need to cast to more specific types (likeGlossary
) after verifying the object that was actually returned.
DELETE /api/meta/entity/bulk?guid=b4113341-251b-4adc-81fb-2420501c30e6&deleteType=SOFT | |
---|---|
1 |
|
- In the case of deleting an asset, all necessary information is included in the URL of the request. There is no payload for the body of the request. To archive an asset, use
deleteType
ofSOFT
.
Hard-delete an asset¶
Hard-deletes (also called a purge) are irreversible operations. The asset is removed from Atlan entirely, so no longer appears in the UI and also no longer exists in Atlan's back-end.
To hard-delete (purge) an asset, you only need to provide the GUID:
Hard-delete (purge) an asset | |
---|---|
1 2 3 4 5 6 7 |
|
- The
purge()
method returns the purged form of the asset. Because this operation will remove the asset from Atlan, you must provide it anAtlanClient
through which to connect to the tenant. - You can distinguish what was purged through the
getDeletedAssets()
method. This lists only the assets deleted by the operation. - The
Asset
class is a superclass of all assets. So you need to cast to more specific types (likeGlossary
) after verifying the object that was actually returned.
Hard-delete (purge) an asset | |
---|---|
1 2 3 4 5 6 7 |
|
- The
asset.purge_by_guid()
method returns the deleted form of the asset. - The
assets_deleted(asset_type=AtlasGlossary)
method returns a list of the assets of the given type that were deleted. - If an asset of the given type was deleted, then the deleted form of the asset is available.
Hard-delete (purge) an asset | |
---|---|
1 2 3 4 |
|
- The
purge()
method returns the purged form of the asset. Because this operation will remove the asset from Atlan, you must provide it anAtlanClient
through which to connect to the tenant. - You can distinguish what was purged through the
deletedAssets
method. This lists only the assets deleted by the operation. - The
Asset
class is a superclass of all assets. So you need to cast to more specific types (likeGlossary
) after verifying the object that was actually returned.
DELETE /api/meta/entity/bulk?guid=b4113341-251b-4adc-81fb-2420501c30e6&deleteType=PURGE | |
---|---|
1 |
|
- In the case of deleting an asset, all necessary information is included in the URL of the request. There is no payload for the body of the request. To permanently and irreversibly remove an asset, use
deleteType
ofPURGE
.
Bulk-delete assets¶
You can also delete a number of assets at the same time:
Up to a limit
You cannot send an unlimited number of assets to be deleted in a single request. As you can see from the Raw REST API tab, each GUID will be sent as a query parameter in the URI — so there is a maximum beyond which the URI is too long.
We generally recommend sending no more than 20-50 GUIDs at a time using this approach.
Hard-delete (purge) multiple assets | |
---|---|
1 2 3 4 5 6 7 |
|
- The
delete()
method on the endpoint itself can be used to either archive (soft-delete) or purge (hard-delete). - You can provide a list of any number of assets to delete (their GUIDs).
- You need to also specify whether you want to soft-delete (archive) using
AtlanDeleteType.SOFT
or hard-delete (purge) the assets usingAtlanDeleteType.PURGE
. - The response will contain details of all of the assets that were deleted.
Hard-delete (purge) multiple assets | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 |
|
- You can alternatively provide either the
asset.purge_by_guid()
orasset.delete_by_guid()
methods with a list of any number of assets to delete (their GUIDs). - The
assets_deleted(asset_type=AtlasGlossary)
method returns a list of the assets of the given type that were deleted. - If an asset of the given type was deleted, then the deleted form of the asset is available.
Hard-delete (purge) multiple assets | |
---|---|
1 2 3 4 5 6 7 8 9 10 |
|
- The
delete()
method on the endpoint itself can be used to either archive (soft-delete) or purge (hard-delete). - You can provide a list of any number of assets to delete (their GUIDs).
- You need to also specify whether you want to soft-delete (archive) using
AtlanDeleteType.SOFT
or hard-delete (purge) the assets usingAtlanDeleteType.PURGE
. - The response will contain details of all of the assets that were deleted.
DELETE /api/meta/entity/bulk?guid=b4113341-251b-4adc-81fb-2420501c30e6&guid=21e5be62-7a0b-4547-ab7a-6ddf273d0640&guid=a0fb35e5-690d-4a5b-8918-9ee267c8fa55&deleteType=SOFT | |
---|---|
1 |
|
- In the case of deleting multiple assets, all necessary information is included in the URL of the request. Each separate asset's GUID should be given after a
guid=
query parameter. There is no payload for the body of the request.
Bulk deletion occurs asynchronously
Be aware that bulk deleting assets occurs asynchronously. The response above will come back indicating the deleted assets; however, there can still be a delay before those assets are fully deleted in Atlan.