Skip to content
atlassian-dc-mcp
Esc
↑↓navigate↵open⌘Jpreview

Create space restore job for upload backup file

This resource expects a multipart post. The media-type multipart/form-data is defined in RFC 1867.

Most client libraries have classes that make dealing with multipart posts simple.

For instance, in Java the Apache HTTP Components library provides a MultiPartEntity that makes it simple to submit a multipart POST.

In order to protect against XSRF attacks, because this method accepts multipart/form-data, it has XSRF protection on it. This means you must submit a header of X-Atlassian-Token: nocheck with the request, otherwise it will be blocked.

The name of the multipart/form-data parameter that contains attachments must be “file”.

An example to attach the file:

curl -D- -u admin:admin -X POST -H “X-Atlassian-Token: nocheck” -F file=@myfile.zip http://myhost/rest/api/backup-restore/restore/space/upload

.

POST/rest/api/backup-restore/restore/space/upload
Request body
multipart/form-data

backup file uploaded. Has to be a zip file.

filestring

backup file uploaded. Has to be a zip file.

Responses
200

Returns a JSON representation of the space restore job details.

idinteger<int64>
jobOperationstring
Allowed:BACKUPRESTORE
jobScopestring
Allowed:SPACESITE
jobStatestring
Allowed:QUEUEDPROCESSINGCOMPLETINGFINISHEDCANCELLINGCANCELLEDFAILED
createTimestring<date-time>
startProcessingTimestring<date-time>
finishProcessingTimestring<date-time>
cancelTimestring<date-time>
errorMessagestring
ownerstring
cancelledBystring
fileNamestring
spaceKeysstring
fileDeleteTimestring<date-time>
fileExistsboolean
jobSettingsSpaceRestoreSettings
Show properties
skipReindexboolean
fileNamestring
statisticsJobStatistics
Show properties
totalObjectsCountinteger<int64>
processedObjectsCountinteger<int64>
persistedObjectsCountinteger<int64>
skippedObjectsCountinteger<int64>
reusedObjectsCountinteger<int64>
jobStatisticsJobStatistics
Show properties
totalObjectsCountinteger<int64>
processedObjectsCountinteger<int64>
persistedObjectsCountinteger<int64>
skippedObjectsCountinteger<int64>
reusedObjectsCountinteger<int64>
400

Returned if the uploaded file is not a zip file

statusCodeinteger<int32>
dataValidationResult
Show properties
authorizedboolean
validboolean
errorsobject
successfulboolean
allowedInReadOnlyModeboolean
messagestring
reasonstring
403

Returned if user doesn't have permission to restore space

statusCodeinteger<int32>
dataValidationResult
Show properties
authorizedboolean
validboolean
errorsobject
successfulboolean
allowedInReadOnlyModeboolean
messagestring
reasonstring
Try it
Server
Bodymultipart/form-data
Request
curl -X POST 'http://example.com:7990/confluence/rest/api/backup-restore/restore/space/upload' \
  -H 'Accept: application/json' \
  --form-string 'file=string'
Response
{
  "id": 1,
  "jobOperation": "BACKUP",
  "jobScope": "SITE",
  "jobState": "IN_PROGRESS",
  "createTime": "2020-01-01T01:01:01Z",
  "startProcessingTime": "2020-01-01T01:01:01Z",
  "finishProcessingTime": "2020-01-01T01:01:01Z",
  "cancelTime": "2020-01-01T01:01:01Z",
  "errorMessage": "Error message",
  "owner": "admin",
  "cancelledBy": "admin",
  "fileName": "backup-2020-01-01.zip",
  "spaceKeys": "spaceKey1,spaceKey2",
  "fileDeleteTime": "2020-01-01T01:01:01Z",
  "fileExists": true,
  "jobSettings": {
    "skipReindex": true,
    "fileName": "space123.zip"
  },
  "statistics": {
    "totalObjectsCount": 100,
    "processedObjectsCount": 50,
    "persistedObjectsCount": 50,
    "skippedObjectsCount": 0,
    "reusedObjectsCount": 10
  },
  "jobStatistics": {
    "totalObjectsCount": 100,
    "processedObjectsCount": 50,
    "persistedObjectsCount": 50,
    "skippedObjectsCount": 0,
    "reusedObjectsCount": 10
  }
}

Was this page helpful?