Accelerate the Value of Data

Bulk Delete Entities

This operation deletes selected profiles in bulk from a tenant.

The bulk delete entities API uses the DeleteEntitiesTask task to remove all entities in accordance with the specified filter or objects list. 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.
Note: Before you run the DeleteEntitiesTask task, ensure that the database is in a consistent state with the main data storage.

Request

POST {TenantURL}/entities/_delete
Table 1. Parameters
Parameter Required Details
Headers Authorization Yes The information about authentication access token in format "Bearer <accessToken>". For more information,see topic Authentication API.
Query mode No

This parameter specifies how entities are removed. Possible parameter values are:

  • soft - the entity is marked as deleted but all data remains in the data storage (you cannot see or restore the entity).
  • hard - entity data such as entity ID, version, and date fields are retained and all other data such as crosswalks and attributes are removed from the date storage.
Note: Entities that only have the soft parameter mode enabled are also removed.
sendMail No This parameter specifies if an email must be sent after the task is completed. If the parameter is not specified, an email is not sent.
BodyYes

The JSON object representing the delete entities request object. The object must have an objects property that represents the entities API request. For more information, see topic Bulk update of attributes.

If you specify the entity URIs, then only these entities are processed.

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.

Examples


      POST {TenantURL}/entities/_delete
Headers: Authorization: Bearer c3f28fdd-e082-4f90-8840-9896914eaf41
{
 "objects" : {
  "filter" : "startsWith(attributes.LastName, 'Ind')",
  "excludeList" : [ "entities/i2", "entities/i3" ]
 }
}
      

      {
    "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"
}