Navigation

Create a Cloud Provider Snapshot Restore Job

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 uses HTTP Digest Authentication. Provide your Atlas username and API key as the username and password when constructing the HTTP request.

For complete documentation on configuring API access for an Atlas project, see Configure Atlas API Access.

All requests to this endpoint must originate from an IP address on the Atlas user’s API whitelist. For complete documentation on configuring API whitelists, see Provide Access to Whitelisted API Operations.

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

Syntax

POST /groups/{GROUP-ID}/clusters/{CLUSTER-NAME}/backup/restoreJobs/

Request Path Parameters

Path Element Description
GROUP-ID The unique identifier of the project for the Atlas cluster whose snapshot you want to restore.
CLUSTER-NAME The name of the Atlas cluster whose snapshot you want to restore.

Request Query Parameters

This endpoint may use any of the HTTP request query parameters available to all Atlas API resources. These are all optional.

Name Type Description Default
pretty boolean Display response in a prettyprint format. false
envelope boolean Specifies whether or not to wrap the response in an envelope. false

Request Body Parameters

All listed fields are required unless specified otherwise.

Name Type Description
snapshotId string Unique identifier of the snapshot to restore.
deliveryType string

Type of restore job to create. Possible values are:

automated
Atlas automatically restores the snapshot with snapshotId to the Atlas cluster with name targetClusterName in the Atlas project with targetGroupId.
download
Atlas provides a URL to download a .tar.gz of the snapshot with snapshotId. The Atlas user can download the archive and restore it manually with a tool like mongorestore.
targetClusterName string Name of the target Atlas cluster to which the restore job restores the snapshot. Only required if deliveryType is automated.
targetGroupId string Unique ID of the target Atlas project for the specified targetClusterName. Only required if deliveryType is automated.

Response

Name Type Description
cancelled boolean Indicates whether the restore job was canceled.
createdAt Date UTC ISO 8601 formatted point in time when Atlas created the restore job.
deliveryType string

Type of restore job to create. Possible values are:

automated
Atlas automatically restores the snapshot with snapshotId to the Atlas cluster with name targetClusterName in the Atlas project with targetGroupId.
download
Atlas 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 Download your Snapshot via HTTPS.
deliveryUrl string URL to the .tar.gz of the snapshot for manual download. Only visible if deliveryType is download.
expired boolean Indicates whether the restore job expired.
expiresAt Date UTC ISO 8601 formatted point in time when the restore job expires.
finishedAt Date UTC ISO 8601 formatted point in time when the restore job completed.
id ObjectId The unique identifier of the restore job.
links array One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification.
snapshotId string Unique identifier of the source snapshot ID of the restore job.
targetGroupId string Name of the target Atlas project of the restore job. Only visible if deliveryType is automated.
targetClusterName string Name of the target Atlas cluster to which the restore job restores the snapshot. Only visible if deliveryType is automated.
timestamp string Timestamp in ISO 8601 date and time format in UTC when the snapshot associated to snapshotId was taken.

Example Request

curl --user "{username:apiKey}" --digest --include \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --request POST "https://cloud.mongodb.com/api/atlas/v1.0/groups/5b6212af90dc76637950a2c6/clusters/MyCluster/backup/restoreJobs"
  --data '
    {
      "snapshotId" : "5b6211ff87d9d663c59d3feg",
      "deliveryType" : "automated",
      "targetClusterName" : "MyOtherCluster",
      "targetGroupId" : "5b6212af90dc76637950a2c6"
    }
  '

Example Response

{
    "cancelled": false,
    "deliveryType": "automated",
    "expired": false,
    "expiresAt": "2018-08-02T02:08:48Z",
    "id": "5b622f7087d9d6039fafe03f",
    "links": [
        {
            "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5b6212af90dc76637950a2c6/clusters/Cluster0/backup/restoreJobs/5b622f7087d9d6039fafe03f",
            "rel": "self"
        },
        {
            "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5b6212af90dc76637950a2c6/clusters/Cluster0/backup/snapshots/5b6211ff87d9d663c59d3dee",
            "rel": "http://mms.mongodb.com/snapshot"
        },
        {
            "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5b6212af90dc76637950a2c6/clusters/Cluster0",
            "rel": "http://mms.mongodb.com/cluster"
        },
        {
            "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5b6212af90dc76637950a2c6",
            "rel": "http://mms.mongodb.com/group"
        }
    ],
    "snapshotId": "5b6211ff87d9d663c59d3feg",
    "targetClusterName": "MyOtherCluster",
    "targetGroupId": "5b6212af90dc76637950a2c6",
    "timestamp": "2018-08-01T20:02:07Z"
}