Navigation

Get One Legacy Backup Restore Job

Important With Circle IconCreated with Sketch.Important
Legacy Backup Deprecated

MongoDB deprecated the Legacy Backup feature. Clusters that use Legacy Backup can continue to use it. MongoDB recommends using Cloud Backups. Effective 23 March 2020, all new clusters can only use Cloud Backups.

Info With Circle IconCreated with Sketch.Note

Groups and projects are synonymous terms. Your {GROUP-ID} is the same as your project ID. For existing groups, your group/project ID remains the same. The resource and corresponding endpoints use the term groups.

The Atlas API authenticates using HTTP Digest Authentication. Provide a programmatic API public key and corresponding private key as the username and password when constructing the HTTP request.

To learn how to configure API access for an Atlas project, see Configure Atlas API Access.

https://cloud.mongodb.com/api/atlas/v1.0

GET /groups/{GROUP-ID}/clusters/{CLUSTER-NAME}/restoreJobs/{JOB-ID}
Path ElementNecessityDescription
GROUP-IDRequiredUnique identifier of the project that owns the snapshots.
CLUSTER-NAMERequiredName of the cluster that contains the snapshots that you want to retrieve.
JOB-IDRequiredUnique identifier for the restore job.
Query ParameterTypeDescriptionDefault
prettybooleanDisplays response in a prettyprint format.false
envelopebooleanSpecifies whether or not to wrap the response in an envelope.false

This endpoint does not use HTTP request body parameters.

The HTTP response returns a JSON document that includes the following elements:

NameTypeDescription
batchIdstring

Unique identifier of the batch to which this restore job belongs.

Only present for a restore of a sharded cluster.

clusterIdstring

Unique identifier of the cluster the restore job represents.

Only present for a restore of a cluster.

createdstringTimestamp in ISO 8601 date and time format in UTC when the restore job was requested.
deliveryobjectMethod and details of how the restored snapshot data shall be delivered.
delivery.expiresstring

Timestamp in ISO 8601 date and time format in UTC after which the URL is no longer available.

Only present if "delivery.methodName" : "HTTP".

delivery.expirationHoursnumber

Number of hours the download URL is valid once the restore job is complete.

Only present if "delivery.methodName" : "HTTP".

delivery.maxDownloadsnumber

Number of times the download URL can be used. This must be 1 or greater.

Only present if "delivery.methodName" : "HTTP".

delivery.methodNamestring

Means by which the data is delivered. Accepted values include:

  • HTTP
  • QUERY
delivery.statusNamestring

Current status of the downloadable file. Accepted values include:

  • NOT_STARTED
  • IN_PROGRESS
  • READY
  • FAILED
  • INTERRUPTED
  • EXPIRED
  • MAX_DOWNLOADS_EXCEEDED
delivery.urlstring

URL from which the restored snapshot data can be downloaded.

Only present if "delivery.methodName" : "HTTP".

encryptionEnabledbooleanIndicates whether the restored snapshot data is encrypted.
groupIdstringUnique identifier of the project that owns the restore job.
hashesobject array

If the corresponding delivery.url has been downloaded, each document in this array is a mapping of a restore file to a hashed checksum. This array is present only after the file is downloaded.

Info With Circle IconCreated with Sketch.Note

For an HTTP restore, this array only contains a single object that represents the hash of the .tar.gz file.

hashes.typeNamestringHashing algorithm used to compute the hash value. If present, this value is SHA1.
hashes.fileNamestringName of the file that has been hashed.
hashes.hashstringHash of the file.
idstringUnique identifier of the restore job.
linksdocument arrayOne or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification
masterKeyUUIDstring

KMIP master key ID used to encrypt the snapshot data.

Only if encryptionEnabled is true for the snapshot.

snapshotIdstringUnique identifier of the snapshot to restore.
statusNamestring

Current status of the job. Accepted values include:

  • FINISHED
  • IN_PROGRESS
  • BROKEN
  • KILLED
timestampobjectTimestamp of the Oplog entry when the snapshot was created.
timestamp.datestringTimestamp in ISO 8601 date and time format in UTC of the latest oplog entry in the restored snapshot.
timestamp.incrementstringOrder of all operations completed at the latest oplog entry in the restored snapshot.
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--include \
-X GET "https://cloud.mongodb.com/api/atlas/v1.0/groups/6b77777887d9d61443b41645/clusters/Cluster0/restoreJobs/6b77893b80eef5354c77ee15"
{
"batchId": "5a66783b80eef5354c77ee13",
"clusterId": "5a66689487d9d61443b46149",
"clusterName": "Cluster0",
"created": "2018-01-22T23:48:11Z",
"delivery": {
"expirationHours": 48,
"expires": "2018-01-22T23:49:38Z",
"maxDownloads": 2147483647,
"methodName": "HTTP",
"statusName": "EXPIRED",
"url": "https://api-backup.mongodb.com/backup/restore/v2/pull/6b77893b80eef5354c77ee15/N2Y1NDhkMjg0Mzk4NGU1Mzk3NTkwMjA0M2ZhODVkNDk=/Cluster0-shard-1-1516661094-6b77893b80eef5354c77ee15.tar.gz"
},
"encryptionEnabled": false,
"groupId": "5a66666887d9d61443b41645",
"hashes": [
{
"fileName": "Cluster0-shard-1-1516661094-6b77893b80eef5354c77ee15.tar.gz",
"hash": "86bc2f505c0874cdc0eaaa82ead2ef48aaf56d67",
"typeName": "SHA1"
}
],
"id": "6b77893b80eef5354c77ee15",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5a66666887d9d61443b41645/clusters/Cluster0/restoreJobs/6b77893b80eef5354c77ee15",
"rel": "self"
},
{
"href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5a66666887d9d61443b41645/clusters/Cluster0",
"rel": "http://mms.mongodb.com/cluster"
},
{
"href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5a66666887d9d61443b41645/clusters/Cluster0/snapshots/5a6669d9fcc178211a0d86b9",
"rel": "http://mms.mongodb.com/snapshot"
},
{
"href": "https://cloud.mongodb.com/api/public/v1.0/groups/5a66666887d9d61443b41645",
"rel": "http://mms.mongodb.com/group"
}
],
"pointInTime": false,
"snapshotId": "5a6669d9fcc178211a0d86b9",
"statusName": "FINISHED",
"timestamp": {
"date": "2018-01-22T22:44:54Z",
"increment": 1
}
}
Give Feedback