Compartilhar via


Cleanup Records API

Important

Some or all of this functionality is available as part of a preview release. The content and the functionality are subject to change.

With the cleanup API, users with Manufacturing Admin role can delete records from Manufacturing data solutions. Based on the parameters provided you provide, the API removes records from Azure Data Explorer and Azure Redis Cache.
For Redis, only the keys are removed when all data for an entity is removed from ADX.

With the Cleanup Records API, the cleanup jobs are triggered in the background which can be tracked with the corresponding job status API.

The request and response is given in the Open API specification.

Cleanup API

You can use Cleanup API to delete records from Manufacturing data solutions resources provided you have the Manufacturing Admin role.

The Method used for this API is DELETE.

The URL used is https://{serviceUrl}/mds/service/cleanup/{Entity name}?api-version=2024-09-30-preview&startDate={Start of time range}&endDate={End of time range}

Request headers

Name Required Description
Authorization True The bearer token used to authenticate the request
User-Agent True Short string to identify the client. Refer to user-agent for details

Request parameters

Name Required Type Description
api-version True string The API version to use (2024-09-30-preview)
entityName False string The entity name
startDate False string Start time range in ISO 8601 Format(yyyy-MM-ddTHH:mm:ssZ)
endDate False string End time range in ISO 8601 Format(yyyy-MM-ddTHH:mm:ssZ)

Response codes

Code Name Description
202 Accepted Cleanup accepted request
400 Bad request In case of Validation error(entity name or time range is invalid)
401 Unauthorized Unable to authenticate the request
403 Forbidden Insufficient role access: (for example, you don't have the right role or you aren't added to the registration)
500 Server Error In case of any service specific errors

Response header

Name Value Description
operation-location Job status url with job ID Job status url containing the job ID which can be used to check the status of the background cleanup job

Note

The Cleanup API takes the following three parameters in the query : path, startDate, and endDate. These three parameters are optional. If only parameter provided is the entityName, and the startDate and endDate parameters are not given, then all records for an entity are removed. Similarly, if entityName is empty and a time range is provided then the API will delete records for all entities based on the provided time range. For Redis cleanup, you are assuming that the data schema and relation schema remains the same if any data is ingested after cleanup.

Get Cleanup Job Status API

You can use the Cleanup Job Status API to track the job status of the delete operation triggered provided you have the Manufacturing Admin role.

The Method used for this API is GET.

The URL used is https://{serviceUrl}/mds/service/cleanup/status/{jobId}?api-version=2024-09-30-preview

Request headers

Name Required Description
Authorization True The bearer token used to authenticate the request
User-Agent True Short string to identify the client. See user-agent for details

Request parameters

Name Required Type Description
api-version True string The API version to use (2024-09-30-preview)
jobId True string The job ID of the Delete cleanup API request extracted from operation-location header key

Response codes

Code Name Description
200 OK Successful request
401 Unauthorized Unable to authenticate the request
403 Forbidden Insufficient role access: (for example, you don't have the right role or you aren't added to the registration)
404 Not Found Path not found
500 Server Error In case of any service specific errors

Sample response

{
  "cleanupADXPropertyEventsAndRedisJobStatus": "Completed",
  "cleanupADXTwinEventsJobStatus": "Completed",
  "cleanupADXRelationsJobStatus": "Completed",
  "cleanupADXVectorsJobStatus": "Completed",
  "cleanupADXReferenceDataJobStatus": "Completed"
}