cdf data purge command to delete data from Cognite Data Fusion (CDF). The command has subcommands for deleting different types of data, including data sets, spaces, and instances.
Prerequisites
Before purging data, ensure you have:- Installed and configured the Cognite Toolkit.
- Authenticated with CDF using appropriate credentials.
- Admin or delete permissions for the data you want to purge.
- Backed up any data you might need to restore later.
Purge data sets
To delete all data in a data set, use thedataset subcommand. You can also specify to include all configuration resources in the data set.
Purge spaces
To delete all data in a space, use thespace subcommand. This is typically used to delete a schema space (a space containing data models, views, and containers).
Do not use this command to delete large amounts of data unless you intend to delete everything in the space.
By default, this command will not delete nodes that are time series or files. This is to prevent accidentally losing datapoints
and file content. To delete these nodes as well, use the
--delete-datapoints and --delete-file-content flags.Purge instances
To delete instances, use theinstances subcommand.
This command is used to unlink nodes that are time series or files. This means that the nodes were created with the migration plugin and have linked classical time series and files to them. Unlinking allows you to reverse this operation, by first removing the link between the node and the time series/file, and then deleting the node. Thus, the classical time series/file will remain in CDF after the purge operation including the datapoints and file content. Note that this is only the case for nodes that were created with the migration plugin.
Delete by view
Delete all instances that have data in a view:Delete by instance space
Delete all instances in an instance space:Delete by CSV
Delete instances listed in a CSV file:space, externalId, and instanceType. For example:
to-delete.csv
space column specifies the space the instance belongs to, the externalId column specifies the instance’s
external ID, and the instanceType column specifies whether the instance is a node or an edge.