跳到主要内容

clearMigration

clearMigration()

POST /api/2.0/migration/clear

Clear migration

Discards a finished import and deletes the data uploaded for it, freeing the portal for the next one. Call it once GET api/2.0/migration/status reports isCompleted for a job whose parseResult.operation is migration; a DocSpace administrator is required. Only the queued job and the temporary upload folder go - the users, groups and files already imported stay in the portal - so the call destroys migration data alone, and it is idempotent: clearing twice, or with nothing to clear, still answers 200. Like the other write operations here it is only queued, and once it has run GET api/2.0/migration/status returns an empty result and GET api/2.0/migration/logs answers 404, so download the log before calling it. A parse that is still running is not affected - stop that with POST api/2.0/migration/cancel - and POST api/2.0/migration/finish performs the same clean-up itself, which makes this call unnecessary after it.

Parameters​

This endpoint does not need any parameter.

Responses​

Status codeDescriptionTypeResponse headers
200The clean-up has been queued; the finished import is dropped and the uploaded data deleted. The response carries no content-X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
403The caller is not a DocSpace administrator--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

null (empty response body)

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: Not defined
  • Accept: application/json