Navigation

Get All Cloud Backup Restore Jobs

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.

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

GET /groups/{GROUP-ID}/clusters/{CLUSTER-NAME}/backup/restoreJobs
ParameterTypeNecessityDescription
GROUP-IDstringRequiredUnique identifier of the project for the Atlas cluster.
CLUSTER-NAMEstringRequiredName of the Atlas cluster for which you want to retrieve restore jobs.

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

NameTypeNecessityDescriptionDefault
pageNumintegerOptionalPage number, starting with one, that Atlas returns of the total number of objects.1
itemsPerPageintegerOptionalNumber of items that Atlas returns per page, up to a maximum of 500.100
includeCountbooleanOptionalFlag that indicates whether Atlas returns the totalCount parameter in the response body.true
prettybooleanOptionalFlag that indicates whether Atlas returns the JSON response in the prettyprint format.false
envelopebooleanOptional

Flag that indicates whether Atlas wraps the response in an envelope.

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

Endpoints that return a list of results use the results object as an envelope. Atlas adds the status parameter to the response body.

false

This endpoint doesn't use HTTP request body parameters.

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.

NameTypeDescription
resultsarray of objectsOne object for each item detailed in the results Embedded Document section.
linksarray of objectsOne or more links to sub-resources and/or related resources. The relations between URL s are explained in the Web Linking Specification
totalCountintegerCount 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.
NameTypeDescription
cancelledbooleanFlag indicating whether the restore job was canceled.
createdAtstringTimestamp in ISO 8601 date and time format in UTC when Atlas created the restore job.
componentsarray of objectsCollection 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
stringName of the shard or config server included in the snapshot.
deliveryTypestring

Type of restore job to create. Possible values are:

Job TypeAction
automatedAtlas 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.

Bulb IconTip
See Also:

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

Info With Circle IconCreated with Sketch.Note
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.

pointInTimeAtlas performs a Continuous Cloud Backup restore.
deliveryUrlarray of strings

One or more URL s for the compressed snapshot files for manual download. Atlas returns this parameter when "deliveryType" : "download".

Info With Circle IconCreated with Sketch.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.

expiredbooleanFlag indicating whether the restore job expired.
expiresAtintegerTimestamp in ISO 8601 date and time format in UTC when the restore job expires.
failedbooleanFlag indicating whether the restore job failed.
finishedAtintegerTimestamp in ISO 8601 date and time format in UTC when the restore job completed.
idstringUnique identifier of the restore job.
linksarray of objectsOne or more links to sub-resources and/or related resources. The relation-types between URL s are explained in the Web Linking Specification.
oplogTsintegerTimestamp 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.
oplogIncintegerOplog 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.
pointInTimeUTCSecondsintegerTimestamp 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.
snapshotIdstringUnique identifier of the source snapshot ID of the restore job. Returned when "deliveryType" : "automated" or "deliveryType" : "download".
targetGroupIdstringName of the target Atlas project of the restore job. Returned when "deliveryType" : "automated".
targetClusterNamestringName of the target Atlas cluster to which the restore job restores the snapshot. Atlas returns this parameter when "deliveryType" : "automated".
timestampstringTimestamp in ISO 8601 date and time format in UTC when the snapshot associated to snapshotId was taken.
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"
1{
2 "links": [],
3 "results": [
4 {
5 "cancelled": false,
6 "deliveryType": "automated",
7 "expired": false,
8 "expiresAt": "2020-08-02T02:08:48Z",
9 "id": "{RESTORE-JOB-ID-1}",
10 "links": [],
11 "snapshotId": "{SNAPSHOT-ID}",
12 "targetClusterName": "MyOtherCluster",
13 "targetGroupId": "{PROJECT-ID}",
14 "timestamp": "2020-08-01T20:02:07Z"
15 },
16 {
17 "cancelled": false,
18 "createdAt": "2020-08-01T22:05:41Z",
19 "deliveryType": "download",
20 "deliveryUrl": "https://restore.example.com:27017/restore-{RESTORE-JOB-ID-2}.tar.gz",
21 "expired": false,
22 "expiresAt": "2020-08-02T02:03:33Z",
23 "id": "{RESTORE-JOB-ID-2}",
24 "links": [],
25 "snapshotId": "{SNAPSHOT-ID}",
26 "timestamp": "2020-08-01T20:02:07Z"
27 }
28 ],
29 "totalCount": 2
30}
Give Feedback