Delete Entities by Entity Type
Learn how to delete all entities of a specified type from a tenant.
This Delete entities by entity type task deletes all entities of a specified type from a tenant. Before you run this task, run the Cassandra ES Consistency task to ensure that the Elasticsearch storage is in a consistent state with the main data storage. For more information, see topic Cassandra ES Consistency Task.
The Delete entities by entity type task performs a full scan of the primary data storage and does not validate consistency with Elasticsearch indexes. As a result, recently deleted entities may temporarily appear in search results. This task isn't intended to run in distributed mode. For large-scale deletions or distributed processing, consider using Bulk Delete Entities.
The Delete entities by entity type task doesn't wait for all events to be processed. Therefore, after this task is executed, it's possible that some of the entities are available when you search for it. You may need to wait before Elasticsearch becomes consistent with the primary data storage.
Request
DELETE {TenantURL}/entities
Parameter | Required | Details | |
---|---|---|---|
Headers | Authorization | Yes | The information about authentication access token in format "Bearer <accessToken>". For more information, see topic Authentication API. |
Query | entityType | Yes | The entity type name. All entities of the specified type are deleted. |
mode | No | An optional parameter indicating whether entities of the specified entity type are completely removed from the system or the entities are only flagged as deleted. Possible parameter values are:
|
Response
JSON Object representing information about launched manual task which will delete all entities of the specified type:
- numberOfProcessedObjects- number of deleted entities since the task started.
- objectsFailedToDeleteCount- number of objects that were not deleted.
- objectsFailedToDelete- entity IDs that were not deleted (only 100 entity IDs that were not deleted are displayed).
- name- name of the manual task in the following format: "<Hard/Soft> Delete Entities By Type: <entity type URI>".
- started- time when the task started.
- throughput- current speed of the task (number of entities deleted per second).
- tenant- name of the tenant.
- current- current system time.
To see the status of the task, use the following request:
GET /tasks
This request returns the information about the task in the same format. When the task is completed and all entities of the specified type are deleted, you will no longer see the task information in the response. To see the task information, use the following request:
GET /tasks/history
Request
DELETE {TenantURL}/entities?entityType=HCPHeaders: Authorization: Bearer
204938ca-2cf7-44b0-b11a-1b4c59984512
Response
{
"id": "f3d47316-c249-4e60-9a8a-8e97cc9ca0e3",
...
"parameters": {
"tenantId": "jondoe",
"entityType": "HCP",
"mode": "hard"
},
"currentState": {
"objectsFailedToDelete": [
"1AlLNjPS",
"8C06vMB"
],
"entityType": "configuration/entityTypes/HCP",
"lastExecutionEC2Instances": "i-0e9422455e94d46e1",
"objectsFailedToDeleteCount": 2,
"numberOfFailedToPublishEvents": 0,
"lastHourThroughput": 0.0,
"numberOfProcessedObjects": 126,
"status": "Completed"
},
"throughput": 9.692307,
"duration": "13s"
}