For users with appropriate permissions, deleting an asset in Data360 Govern is as simple as clicking the “delete” icon from the list view and confirming the action, but what if many assets need to be removed? Alternative to deleting assets one at a time, there are three main methods to remove a large number of assets depending on the situation.
Bulk Delete Asset Types
If all assets of a certain type require removal due to the asset type no longer being relevant, bulk deletion of the assets is simple. In Data360 Govern, removing an Asset Type automatically removes all assets of that type.
- First determine if the type of asset to be removed is a Business Asset or Technical Asset. Unless moved to their own navigation menu, the type will either be found under “Business Assets” or “Technical Assets”. Typically, Technical Assets are created by a Connector.
- Navigate to Configuration > Business Assets or Configuration > Technical Assets.
- Find the name of the desired Asset Type
- Click the delete icon by the name
Data360 Govern, identifying the assets will be removed by deleting the Asset type, requires the user to acknowledge that assets will be removed. The message is similar to, “The selected Asset Type contains n Assets that will also be deleted. These actions cannot be undone. Please check this box if you would like to continue.” Upon checking the box and clicking, “Delete”, the process of removing the Asset Type and its assets is initiated.
Bulk Delete Child Assets
When asset types are structured in a hierarchy, users can bulk delete child assets by removing the parent, which will cause a cascading removal of all of its child assets. This may be desirable when:
- A parent asset no longer exists in the organization, making its child asset(s) irrelevant
- Technical assets were copied from a different environment, or somehow erroneously exist in the current environment, and are not applicable to the current environment
To remove the parent asset and its child assets, find the parent asset in the list view and click the delete icon.
Note: In scenarios where a very large number of child assets are to be removed, users may experience a time-out error when deleting the parent asset. The delete operation is still processing in the background and may take several minutes.
Bulk Delete Assets via the API
Data360 Govern offers a number of API endpoints for manipulating assets, including removing them. Using the API to remove assets allows for fine-tuned control over which assets will be removed, compared to the other approaches which remove all assets of a certain type or under a given parent asset.
Data360 Govern APIs can be used by many applications. This document provides instructions for executing the API via two applications:
Application | Use |
Swagger |
Data360 Govern provides API documentation in the form of a “Swagger” interface. This interface also allows executing the API from the web browser. This approach is useful for one-time bulk deletions where the user is comfortable modifying JSON strings by hand. Information Needed:
|
Data360 Govern |
Data360 Analyze, Infogix’s self-service data preparation tool with advanced analytics, makes interacting with Data360 Govern’s API relatively simple. This approach is useful for creating a reusable means to delete assets. After an initial investment in configuring the Data Flow, assets can be removed by simply updating a spreadsheet and executing the Data Flow. Information Needed:
|
Obtaining Asset Type UIDs
As an administrator, Asset Type UIDs can be easily obtained from the user interface:
- First determine if the type of asset to be removed is a Business Asset or Technical Asset. Unless moved to their own navigation menu, the type will either be found under “Business Assets” or “Technical Assets”. Typically, Technical Assets are created by a Connector.
- Navigate to Configuration > Business Assets or Configuration > Technical Assets.
- Find the name of the desired Asset Type
- Hover the cursor over the “ i " icon, which displays the Asset Type UID in a popup. This can be selected and copied for later use
If technically savvy, the API endpoint GET /api/v2/assets/types can also be used to find Asset Type UIDs.
Obtaining Asset UIDs
The UID of every Business and Technical Asset in the system is displayed at the bottom of each asset’s page. To obtain multiple Asset UID’s at once, there is a feature in Data360 Govern which allows a bulk download of assets of a given type.
- Navigate to the listing of assets
- Optionally add filters to display only the assets desired for deletion
- Click the “Export to Excel” icon
Within the Excel file are columns identifying the assets, include a column named, “Asset UID”.
If technically savvy, the API endpoint GET /api/v2/assets/{assetTypeUid}, used with appropriate parameters to filter and find the assets desired, can also be used to find Asset UIDs.
Bulk Delete Assets via Swagger
Swagger is a tool which documents Data360 Govern API endpoints and allows their execution from the internet browser. The endpoint DELETE /api/v2/assets/batch/{assetTypeUid} allows deleting a large number of assets at once. To use this API, as an administrator:
- Navigate to Administration > API
- Expand the “Assets” heading
- Expand the “DELETE /api/v2/assets/batch/{assetTypeUid}” heading
- In the “Parameters” section, paste the Asset Type UID into the “assetTypeUid” field.
Before moving to the next step, a specially crafted JSON string must be created. The format of this JSON string is:
[
{
"Uid": "your-asset-uid-1",
"Cascade": true
},
{
"Uid": "your-asset-uid-2",
"Cascade": true
},
{
"Uid": "your-asset-uid-n",
"Cascade": true
}
]
In this example, replace “your-asset-uid-…” with the Asset UID’s identified for removal. For the tech savvy, this JSON string represents an array of objects, where each object contains the keys “Uid” (a single Asset UID) and “Cascade” (always set to true to indicate you understand that child assets of the deleted asset will also be deleted).
Note that the square braces only occur at the beginning and end of the string, and each asset to remove is enclosed in curly braces, separated by a comma.
- When the JSON message is ready, paste it into the “assets” parameter field.
- (Optionally), if there are workflows that would normally trigger as a result of removing these assets, the workflow trigger can be disabled by setting the parameter, “triggersWorkflow” to “false”.
- Click the “Try it out!” button to execute the action.
Note: There is no “undo” option. Verify the UIDs being used before executing the API.
If there are no issues with syntax and the Asset Type UID is found, a message similar to the following should be returned in the “Response Body” section:
{
"ExecutionID": "b0acc4ce-3edb-4178-96fb-d7df01856bff",
"Message": "Now processing request. Please check back with this ExecutionID for status.",
"Uri": "https://your-env.data3sixty.com/api/v2/assets/executions/b0acc4ce-3edb-4178-96fb-d7df01856bff/status"
}
Because of the bulk/batch nature of this API endpoint, processing is performed asynchronously and you must check a secondary URL to determine the status of the operation. Navigating to the “Uri” address in an internet browser (while already logged into Data360 Govern) will query the status of the operation. The response will look similar to:
{"Total":1000,"Processed":1000,"Error":0,"Fields":...}
The important numbers to look for are at the beginning of the response: “Total”, “Processed”, and “Error”. When the number “Processed” equals the “Total”, processing is complete. If there are errors, check for accompanying error messages further in the response.
Bulk Delete Assets via Data360 Analyze
Using a Data360 Analyze Data Flow to remove Govern assets provides benefits over using the Swagger interface, primarily:
- The Data Flow can be saved and re-used to remove different assets with minimal setup
- Simple Python code generates the API payload, removing the need to create it by hand
Before beginning, follow the steps in the prior sections, “Obtaining Asset Type UIDs” and “Obtaining Asset UIDs” and create an Excel spreadsheet (or compatible xlsx file) with two columns: AssetTypeUid and AssetUid, populated with the assets meant for deletion. Save this file to a location accessible to Data360 Analyze.
Additionally, “API Key” and “API Secret” values are needed to authenticate with Data360 Govern from outside of the tool. There are two approaches to obtaining this information:
- As an administrator in Data360 Govern, mouse-over the profile icon in the upper-right corner of the interface and click “API Key”. This will display the user’s unique (and secret) API Key and API Secret for use in the steps below. Normally this key and secret are only available to administrators, but an administrator can chose to allow all users to find their API Key and API Secret via Administration > Settings > Display API Key
- Alternatively, when a Govern environment is created, Infogix creates service accounts intended for Data360 Analyze and Data360 DQ+ to authenticate without being tied to a specific person. Contact Infogix to obtain the service account API Key and API Secret.
Within Data360 Analyze, create a data flow with the following sequence of nodes. This instructions assume beginner-level proficiency in Data360 Analyze. Unless specified, leave all settings to their default value:
Seq | Node Type | Configuration |
1 | Excel file | File: (location of the populated xlsx file with AssetTypeUid and AssetUid columns) |
2 | Sort | SortBy Fields: AssetTypeUid, AssetUid |
3 | Transform |
ConfigureFields import json ProcessRecords if node.firstInGroup: GroupBy fields.AssetTypeUid ImpliciteWriteMode: Never |
4 | HTTP |
URL (from Field): ‘URL’ Method: POST Body (from Field): ‘Payload’ DataOutputMode: Field DataOutputField: Response StatusCodeOutputField: StatusCode ContentType: application/json Header: Authorization: {api key};{api secret} (note: do not include the braces when entering the API Key and API Secret, and ensure they’re separated by a semicolon) |
5 | JSON Data | JsonData (from Data Field): ‘Response’ |
When configured correctly, executing this Data Flow will result in an API call made to Govern to batch delete assets based on the contents of the .xlsx file. The Data Flow should look something like this:
Because of the bulk/batch nature of this API endpoint, processing is performed asynchronously and you must check a secondary URL to determine the status of the operation. Navigating to the “Uri” address in an internet browser (while already logged into Data360 Govern) will query the status of the operation. The response will look similar to:
{"Total":1000,"Processed":1000,"Error":0,"Fields":...}
The important numbers to look for are at the beginning of the response: “Total”, “Processed”, and “Error”. When the number “Processed” equals the “Total”, processing is complete. If there are errors, check for accompanying error messages further in the response.
Note: There is no “undo” option. Verify the UIDs being used before executing the data flow.
Comments
0 comments
Please sign in to leave a comment.