Delete duplicate assets using the API

Delete duplicate assets using the API

Duplicate asset (hostname) on Uptycs platform could be a result of particular asset being in rotation or being used a a loaner laptop in which case, uuid of the asset remains the same and the asset is recorded under different hostnames.


Following procedure outlines the process to identify and delete duplicate records (same hostname, different uuids).


Prerequisite tools


iusql

urestapi


Procedure


Download api key from Uptycs UI


Identify and verify duplicate assets


It is always safe to identify duplicate assets and verify assetIds that are being deleted.

Attached script, duplicate_asset_details.sh can be used to list all duplicate assets.

    Usage : ./duplicate_asset_details.sh <api_key_file>

    e.g. ./duplicate_asset_details.sh my_api_key_file.json


Delete duplicate assets


Attached script, delete_duplicate_assets.sh can be used to confirm uids of assets (in conjunction with above list) and delete duplicate assets. delete_duplicate_assets.sh deletes assets with duplicate host_names and last_activity_at lower than the highest record.

    Usage : delete_duplicate_assets.sh <api_key_file>

    e.g. : ./delete_duplicate_assets.sh my_api_key_file.json

 

Related Articles


iusql

    • Related Articles

    • Delete assets offline since a particular date using the API

      This script / procedure outlines the process to delete assets which have been offline before a particular date. Prerequisite tools iusql urestapi Procedure Download api key from Uptycs UI Download attached script, delete_offline_assets_since.sh     ...
    • Provisioning roles using API

      Overview Starting with Uptycs portal release 46025, Uptycs provides entity level granular user permissions through roles. This document outlines the process to create roles using API - with examples. Procedure -- Create a new role $ urestapi -k ...
    • Create Custom Event Exclusion Profile via API

      It may be a lengthy process to create an event exclusion profile with many entries using the GUI. This article shows how to create two custom event exclusion profiles via the API. The urestapi tool is used (https://pypi.org/project/urestapi/).  ...
    • Create Custom Threat Source using API

      The article includes the API query to create and update the threat source. To create Threat source: curl --location --request POST 'https://app.uptycs.io/public/api/customers/11111111-1111-1111-1111-111111111111/threatSources' \ --header ...
    • Creating and testing multiple similar alerts using API

      This article shows how to create or update multiple Alert Rules using SQL script with up to 4 parameters. Save SQL script in a separate file.  The script can have up to 4 variables Edit the config file and update all variables as needed. The script ...