Concepts¶
Projects and datasets share a similar life cycle. Once created, both can be moved into so-called recycle bin - the data is removed using a soft-delete approach. Affected records will not be retrieved using regular API calls, but they can be accessed with dedicated endpoints and even restored to regular (active) state. The data can also be completely removed from the recycle bin with no possibility to restore the data. When this happens, events are raised so that other applications in the platform can react to accordingly.
There is also a hard delete mechanism which completely removes datasets and projects that have been in the recycle bin for more than 180 days.
Endpoints¶
Data deletion¶
Project and dataset controllers have an endpoint that allows to delete the given record (move it to recycle bin).
DELETE/api/project/{projectId}
- deletes a project
DELETE/api/project/{projectId}/dataset/{id}
- deletes a dataset within a project
Example request:
curl -X DELETE "https://api.mike-cloud-test.com/api/project/BD10E94B-43B8-4AA3-9C46-197094F94C34" -H "accept: text/plain" -H "api-version: 1.0"
Example response:
Code 204 access-control-allow-credentials: true access-control-allow-origin: * api-supported-versions: 1.0 date: Thu, 17 Jan 2019 11:47:30 GMT server: Kestrel vary: Origin `
- The required privilege is
DeleteProject
for deleting a project, andDeleteContent
for deleting datasets.
Browsing recycle bin¶
While soft-deleted objects are not visible on the regular project/dataset endpoints, there are specific endpoints for retrieving this data.
GET/api/recycle-bin/dataset/list
- retrieves list of deleted datasets across all projects
GET/api/recycle-bin/project/{projectId}/dataset/{id}
- retrieves the detail of a dataset within a project
GET/api/recycle-bin/project/{projectId}/dataset/list
- retrieves list of deleted datasets within a project
GET/api/recycle-bin/project/list
- retrieves all deleted projects
GET/api/recycle-bin/project/{id}
- retrieves the detail of a deleted project
- The user will see those datasets and projects where he/she has
DeleteX
privilege. In other words the user will be able to see data that he/she deleted, as well as data that he/she could have deleted. - If a project is deleted, its (active) datasets will not show when calling
/api/recycle-bin/dataset/list
- this is by design. These datasets can not be individually restored, they must be restored by restoring the parent project.
GET/api/recycle-bin/my-deleted-items
- retrieves paged and sorted list of items that were deleted directly by the calling user. This includes projects, subprojects and datasets all in one list.
Restoring data¶
Projects and datasets can be restored using dedicated endpoints.
PUT/api/recycle-bin/project/{projectId}/dataset/{id}/restore
- restores deleted dataset within a project
PUT/api/recycle-bin/project/{id}/restore
- restores deleted project
- As before the
DeleteProject
orDeleteContent
privilege is required to perform these operations. When restoring a subproject, eitherDeleteProject
on the given subproject, orDeleteContent
on the parent project is required. - The restore operation will also restore the full "path" to the item being restored, i.e. root project and subprojects that are deleted. This operation also checks permissions for each (sub)project to be restored.
- If the user does not have permissions to restore the item in its original location, POST
/api/recycle-bin/project/{id}/restore
or POST/api/recycle-bin/project/{id}/dataset/{id}/restore
can be used to restore the item to a different location (e.g. a project that the user owns). - In order to determine whether the item can be restored, the
path
endpoint should be used: GET/api/project/{projectId}/path
. This endpoint will return all projects from the root to the given project, including user's capabilities and indication whether the project has been deleted or not.
Complete data removal¶
Projects and datasets can be completely removed from the platform using dedicated endpoints. When these are called, there is no possibility of data restoration.
DELETE/api/recycle-bin/project/{projectId}/dataset/{id}
- completely removes deleted dataset from the platform with no possibility to restore the data
DELETE/api/recycle-bin/project/{projectId}
- completely removes deleted project from the platform with no possibility to restore the data
- As before the
DeleteProject
orDeleteContent
privilege is required to perform these operations.
Limitations¶
- When the recycle bin contains many items, it can take a long time to get a list of them.