Navigation

Create a Restore Job from an M2/M5 Cluster

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.

Important With Circle IconCreated with Sketch.Important

Restoring a snapshot to a cluster removes all existing data on the target cluster prior to the restore.

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.

All requests to this endpoint must originate from an IP address in the organization's API access list.

Bulb IconTip
See Also:

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

POST /groups/{GROUP-ID}/clusters/{CLUSTER-NAME}/backup/tenant/restore
Path ElementDescription
GROUP-IDThe unique identifier of the project for the Atlas cluster whose snapshot you want to restore.
CLUSTER-NAMEThe name of the Atlas cluster whose snapshot you want to restore.

The following query parameters are optional:

Query ParameterTypeDescriptionDefault
prettybooleanDisplays response in a prettyprint format.false
envelopebooleanSpecifies whether or not to wrap the response in an envelope.false

All listed fields are required.

NameTypeDescription
snapshotIdobjectIdUnique identifier of the snapshot to restore.
targetDeploymentItemNamestringName of the cluster on the target Atlas project to which the restore job restores the snapshot. You can restore the snapshot to a cluster tier M2 or greater.
targetProjectIdobjectIdUnique identifier of the target Atlas project to which the restore job restores the snapshot.
NameTypeDescription
clusterNamestringName of the Atlas cluster.
deliveryTypestring

Type of restore job to create. Possible values are:

ValueDescription
RESTOREAtlas automatically restores the snapshot with snapshotId to the Atlas cluster with name targetDeploymentItemName in the Atlas project with targetProjectId.
DOWNLOADAtlas provides a URL to download a .tar.gz of the snapshot with snapshotId. The contents of the archive contain the data files for your Atlas cluster. To learn more about manually restoring the downloaded data files, see Procedure.
expirationDatedateTimestamp in ISO 8601 date and time format in UTC point in time when the restore job expires.
idobjectIdUnique identifier of the restore job.
projectIdobjectIdUnique identifier of the Atlas project from which the restore job originated.
restoreScheduledDatedateTimestamp in ISO 8601 date and time format in UTC point in time when the snapshot restore is scheduled to take place.
snapshotFinishedDatedateTimestamp in ISO 8601 date and time format in UTC point in time when the snapshot was taken.
snapshotIdstringUnique identifier of the source snapshot ID of the restore job.
snapshotUrlstringURL for the compressed snapshot files for manual download. Only visible if deliveryType is DOWNLOAD.
statusstring

Current status of the restore job. Possible values are:

  • COMPLETED
  • FAILED
  • PENDING
  • QUEUED
  • RUNNING
targetDeploymentItemNamestringName of the target Atlas project of the restore job.
targetProjectIdstringUnique identifier of the Atlas project to which the restore job restores the snapshot.
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest --include \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--request POST "https://cloud.mongodb.com/api/atlas/v1.0/groups/571c390a7cea7e4dbf32b625/clusters/M2AWS/backup/tenant/restore"
-- data '
{
"snapshotId": "5ced491ce7a2e10517c81fa7",
"targetProjectId": "571c390a7cea7e4dbf32b625",
"targetDeploymentItemName": "M2AWS"
}
'
HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=ISO-8859-1
Date: {dateInUnixFormat}
WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false
Content-Length: {requestLengthInBytes}
Connection: keep-alive
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
{
"clusterName":"M2AWS",
"deliveryType":"RESTORE",
"expirationDate":"2019-05-29T13:10:27Z",
"id":"5cee4c83e7a2e10d2ad35971",
"projectId":"571c390a7cea7e4dbf32b625",
"restoreScheduledDate":"2019-05-29T09:10:27Z",
"snapshotFinishedDate":"2019-05-28T14:44:01Z",
"snapshotId":"5ced491ce7a2e10517c81fa7",
"status":"PENDING",
"targetDeploymentItemName":"M2AWS",
"targetProjectId":"571c390a7cea7e4dbf32b625"
}
Give Feedback