Navigation

Get All Cloud Backup Restore Jobs

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.

Syntax

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

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

Request Path Parameters

Parameter Type Necessity Description
GROUP-ID string Required Unique identifier of the project for the Atlas cluster.
CLUSTER-NAME string Required Name of the Atlas cluster for which you want to retrieve restore jobs.

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 Necessity Description Default
pageNum integer Optional Page number (1-based). 1
itemsPerPage integer Optional Maximum number of items to return, up to a maximum of 100. 100
includeCount boolean Optional Specifies whether the response returns the totalCount field. true
pretty boolean Optional Indicates whether the response body should be in a prettyprint format. false
envelope boolean Optional

Flag indicating if Atlas should wrap the response in a JSON envelope.

Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query.

For endpoints that return a list of results, the results object is an envelope. Atlas adds the status field to the response body.

false

Request Body Parameters

This endpoint doesn’t use HTTP request body parameters.

Response

Response Document

The response JSON document includes an array of result objects, an array of link objects and a count of the total number of result objects retrieved.

Name Type Description
results array of objects One object for each item detailed in the results Embedded Document section.
links array of objects One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification
totalCount integer Count of the total number of items in the result set. It may be greater than the number of objects in the results array if the entire result set is paginated.

results Embedded Document

Name Type Description
cancelled boolean Flag indicating whether the restore job was canceled.
createdAt string Timestamp in ISO 8601 date and time format in UTC when Atlas created the restore job.
components array of objects Collection of clusters to be downloaded. Atlas returns this parameter when restoring a sharded cluster and “deliveryType” : “download”.
components
.downloadUrl
string

URL from which the snapshot of the components.replicaSetName should be downloaded. Atlas returns null for this parameter if the download URL:

  • Has expired,
  • Has been used, or
  • Hasn’t been created.
components
.replicaSetName
string Name of the shard or config server included in the snapshot.
deliveryType string

Type of restore job to create. Possible values are:

Job Type Action
automated Atlas restores the snapshot corresponding to the snapshotId to the Atlas cluster corresponding to the name targetClusterName in the Atlas project corresponding to the targetGroupId.
download

Atlas generates and displays a URL to download a .tar.gz of the snapshot corresponding to the snapshotId. The contents of the tar.gz archive contain the data files for your Atlas cluster.

See also

To learn more about manually restoring the downloaded data files, see Procedure.

Download Limitations

Each cloud backup can have one download at a time, and each project can have a maximum of 20 downloads at a time.

pointInTime Atlas performs a Continuous Cloud Backup restore.
deliveryUrl array of strings

One or more URLs for the compressed snapshot files for manual download. Atlas returns this parameter when “deliveryType” : “download”.

Note

If empty, Atlas is processing the restore job. Use the Get All Cloud Backup Restore Jobs endpoint periodically check for a deliveryUrl download value for the restore job.

expired boolean Flag indicating whether the restore job expired.
expiresAt integer Timestamp in ISO 8601 date and time format in UTC when the restore job expires.
failed boolean Flag indicating whether the restore job failed.
finishedAt integer Timestamp in ISO 8601 date and time format in UTC when the restore job completed.
id string Unique identifier of the restore job.
links array of objects One or more links to sub-resources and/or related resources. The relation-types between URLs are explained in the Web Linking Specification.
oplogTs integer Timestamp in the number of seconds that have elapsed since the UNIX epoch from which to you want to restore this snapshot. This is the first part of an Oplog timestamp. Atlas returns this parameter when “deliveryType” : “pointInTime” and “oplogTs” > 0.
oplogInc integer Oplog operation number from which to you want to restore this snapshot. This is the second part of an Oplog timestamp. Atlas returns this parameter when “deliveryType” : “pointInTime” and “oplogTs” > 0.
pointInTimeUTCSeconds integer Timestamp in the number of seconds that have elapsed since the UNIX epoch from which Atlas restored this snapshot. Returned when “deliveryType” : “pointInTime” and “pointInTimeUTCSeconds” > 0.
snapshotId string Unique identifier of the source snapshot ID of the restore job. Returned when “deliveryType” : “automated” or “deliveryType” : “download”.
targetGroupId string Name of the target Atlas project of the restore job. Returned when “deliveryType” : “automated”.
targetClusterName string Name of the target Atlas cluster to which the restore job restores the snapshot. Atlas returns this parameter when “deliveryType” : “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 "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest --include \
     --header "Accept: application/json" \
     --header "Content-Type: application/json" \
     --request GET "https://cloud.mongodb.com/api/atlas/v1.0/groups/{PROJECT-ID}/clusters/MyCluster/backup/restoreJobs"

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
  "links": [],
  "results": [
    {
      "cancelled": false,
      "deliveryType": "automated",
      "expired": false,
      "expiresAt": "2020-08-02T02:08:48Z",
      "id": "{RESTORE-JOB-ID-1}",
      "links": [],
      "snapshotId": "{SNAPSHOT-ID}",
      "targetClusterName": "MyOtherCluster",
      "targetGroupId": "{PROJECT-ID}",
      "timestamp": "2020-08-01T20:02:07Z"
    },
    {
      "cancelled": false,
      "createdAt": "2020-08-01T22:05:41Z",
      "deliveryType": "download",
      "deliveryUrl": "https://restore.example.com:27017/restore-{RESTORE-JOB-ID-2}.tar.gz",
      "expired": false,
      "expiresAt": "2020-08-02T02:03:33Z",
      "id": "{RESTORE-JOB-ID-2}",
      "links": [],
      "snapshotId": "{SNAPSHOT-ID}",
      "timestamp": "2020-08-01T20:02:07Z"
    }
  ],
  "totalCount": 2
}