Delete Jobs API to support bulk delete in Azure Digital Twins
Azure Digital Twins is a cloud-based platform that enables users to create and manage digital representations of physical environments, such as buildings, factories, or cities. Azure Digital Twins allows users to upload models, create twins, and establish relationships between them, forming a graph that reflects the real-world scenario. Azure Digital Twins also integrates with other Azure services, such as IoT Hub, Event Grid, and Time Series Insights, to enable data ingestion, processing, and analysis.
However, there may be situations where users need to delete all or some of the models, twins, and relationships in their Azure Digital Twins instance. For example, users may want to reset their instance to start from scratch, or to free up space and resources for new projects. Users may also want to delete their data for security or compliance reasons, such as when they no longer need or own the data, or when they need to comply with regulations that mandate data deletion.
To support these scenarios, Azure Digital Twins provides a Delete Jobs API, which is a feature that allows users to initiate a job that deletes all models, twins, and relationships on the instance. The Delete Jobs API does not delete any other types of entities, such as endpoints, routes, or jobs. The Delete Jobs API is part of the data plane APIs, which are the Azure Digital Twins APIs used to manage the elements within the instance.
The Delete Jobs API has the following characteristics:
- It requires an operation-id header, which is a unique identifier for the job’s status monitor. The operation-id can be generated by the user or by the service if the header is not passed by the user.
- It supports an optional timeoutInMinutes query parameter, which specifies the desired timeout for the delete job. Once the specified timeout is reached, the service will stop any delete operations triggered by the current delete job that are in progress and go to a failed state. This will leave the instance in an unknown state, as there is no rollback operation.
- It returns a 202 Accepted status code, along with an Operation-Location header, which contains the URL to monitor the status of the job. The response body also contains the job details, such as the id, createdDateTime, finishedDateTime, purgeDateTime, and status.
- It supports four possible statuses for the job: notstarted, running, succeeded, or failed.
- It supports only one bulk delete job at a time within an instance. If the user tries to initiate another delete job while one is already in progress, the service will return a 400 Bad Request status code, along with a JobLimitReached error code.
- The Delete Jobs API is a useful feature that enables users to delete all models, twins, and relationships on their Azure Digital Twins instance in a simple and convenient way. The Delete Jobs API offers several benefits, such as:
- Enhanced security and privacy: The Delete Jobs API allows users to remove their data from the instance when they no longer need or own it, or when they need to comply with regulations that mandate data deletion. The Delete Jobs API also encrypts the data in transit and at rest, and allows users to control access and permissions by using Azure Active Directory and Azure Role-Based Access Control.
- Improved performance and efficiency: The Delete Jobs API reduces the complexity and effort of deleting data manually or programmatically, as it allows users to delete all models, twins, and relationships with a single API call. The Delete Jobs API also improves the performance and efficiency of the instance, as it frees up space and resources for new data and operations.
- Simplified management and operation: The Delete Jobs API leverages the existing capabilities and integrations of Azure Digital Twins, which means that users do not need to deploy or maintain any additional hardware or software for their data deletion. The Delete Jobs API also enables users to monitor and manage their delete jobs from anywhere, by using Azure Portal, Azure CLI, or Azure PowerShell.
The Delete Jobs API is a promising feature that aims to make data deletion easier and better for users who use Azure Digital Twins. The Delete Jobs API offers several advantages, such as enhanced security and privacy, improved performance and efficiency, and simplified management and operation. The Delete Jobs API can help users to achieve their goals and requirements, while saving time, money, and effort. The Delete Jobs API is a feature that is worth trying out and exploring, especially for users who have large or complex data sets on their Azure Digital Twins instance. The Delete Jobs API is a feature that can potentially transform the way users use data deletion in Azure Digital Twins.