Restoring assets¶
Restoring an asset from an archived (soft-deleted) state back to active uses a similar pattern to the deletion operations.
By qualifiedName
¶
To restore an asset by its qualifiedName
:
Restore an asset by its qualifiedName | |
---|---|
1 2 |
|
- If an asset with the provided qualifiedName exists and is now active, the operation will return true. If no archived (soft-deleted) version of the asset could be found the operation will return false. Because this operation will restore the asset in Atlan, you must provide it an
AtlanClient
through which to connect to the tenant.
Restore an asset by its qualifiedName | |
---|---|
1 2 3 4 5 6 7 8 |
|
- If an asset with the provided qualified_name exists and is now active, the operation will return true. If no archived (soft-deleted) version of the asset could be found the operation will return false.
Restore an asset by its qualifiedName | |
---|---|
1 2 |
|
- If an asset with the provided qualifiedName exists and is now active, the operation will return true. If no archived (soft-deleted) version of the asset could be found the operation will return false. Because this operation will restore the asset in Atlan, you must provide it an
AtlanClient
through which to connect to the tenant.
POST /api/meta/entity/bulk?replaceClassifications=false&replaceBusinessAttributes=false&overwriteBusinessAttributes=false | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
- All assets must be wrapped in an
entities
array. - You must provide the exact type name for the asset (case-sensitive). For a glossary, this is
AtlasGlossary
. - You must provide the exact name of the existing asset (case-sensitive).
-
You must provide the exact
qualifiedName
of the existing asset (case-sensitive).Must exactly match the
qualifiedName
of an existing assetIf this does not exactly match the
qualifiedName
of an existing asset, the API call will instead create a new asset rather than restoring an existing one. -
For glossary-contained objects (terms and categories), you must also specify the glossary in which they are contained. You do this using the
anchor
attribute. - Nested within the
anchor
attribute you must give thetypeName
as exactlyAtlasGlossary
. - Nested within the
anchor
attribute you must also give the GUID of the glossary the archived object is contained within. - The piece that actually triggers the restore is to change the
status
of the asset. When soft-deleted (archived) the status will beDELETED
. Therefore, changing this toACTIVE
will restore the asset.
In bulk¶
To restore a number of assets at the same time, for example after retrieving them via a search:
Restore assets in bulk | |
---|---|
1 2 3 4 5 6 7 |
|
- You would want more to your search criteria than this, but the
true
sent to theselect(true)
will ensure archived (soft-deleted) assets are returned, while the.archived()
will ensure only archived assets are returned. - Run the search to retrieve such results, and page through them automatically.
- Limit the results to some maximum number, as you will need to limit how many you try to restore at the same time to avoid timeouts or other issues.
- You can collect up the assets to be restored into a list from the stream.
-
You can then simply pass the results of the search across to the restore operation to re-activate all of them en masse.
The restore will only be run on that limited set of results
In this example, the restore is only running on the first set of 50 results. To restore all assets that match the search criteria, don't forget to loop over this logic or create your own batching mechanism to process all pages!
-
You can retrieve the details of the specific assets that were restored from the bulk restore response.
Restoring assets in bulk is not currently available in the Python SDK, but will be coming soon.
Restore assets in bulk | |
---|---|
1 2 3 4 5 6 7 |
|
- You would want more to your search criteria than this, but the
true
sent to theselect(true)
will ensure archived (soft-deleted) assets are returned, while the.archived()
will ensure only archived assets are returned. - Run the search to retrieve such results, and page through them automatically.
- Limit the results to some maximum number, as you will need to limit how many you try to restore at the same time to avoid timeouts or other issues.
- You can collect up the assets to be restored into a list from the stream.
-
You can then simply pass the results of the search across to the restore operation to re-activate all of them en masse.
The restore will only be run on that limited set of results
In this example, the restore is only running on the first set of 50 results. To restore all assets that match the search criteria, don't forget to loop over this logic or create your own batching mechanism to process all pages!
-
You can retrieve the details of the specific assets that were restored from the bulk restore response.
Multiple API calls required
You will need to first run a search for all assets with a status of DELETED
. You can then bulk-restore them by placing all of the returned assets into a single API call.
POST /api/meta/entity/bulk?replaceClassifications=false&replaceBusinessAttributes=false&overwriteBusinessAttributes=false | |
---|---|
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 |
|
- All assets must be wrapped in an
entities
array. - You must provide the exact type name for each asset (case-sensitive).
- You must provide the exact name of each existing asset (case-sensitive).
-
You must provide the exact
qualifiedName
of each existing asset (case-sensitive).Must exactly match the
qualifiedName
of an existing assetIf this does not exactly match the
qualifiedName
of an existing asset, the API call will instead create a new asset rather than restoring an existing one. -
For glossary-contained objects (terms and categories), you must also specify the glossary in which they are contained. You do this using the
anchor
attribute. - Nested within the
anchor
attribute you must give thetypeName
as exactlyAtlasGlossary
. - Nested within the
anchor
attribute you must also give the GUID of the glossary the archived object is contained within. - The piece that actually triggers the restore is to change the
status
of each asset. When soft-deleted (archived) the status will beDELETED
. Therefore, changing this toACTIVE
will restore each asset.