Navigation

Get All Restore Jobs

Get all restore jobs for a cluster. CLUSTER-NAME must be the name of either a replica set or a sharded cluster.

Note

If you use the BATCH-ID query parameter, you can retrieve all restore jobs in the specified batch. When creating a restore job for a sharded cluster, Atlas creates a separate job for each shard, plus another for the config server. Each of those jobs are part of a batch. A restore job for a replica set, however, cannot be part of a batch.

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. This page uses the more familiar term group. The endpoints are as stated on the page.

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.

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

Syntax

GET /groups/{GROUP-ID}/clusters/{CLUSTER-NAME}/restoreJobs
GET /groups/{GROUP-ID}/clusters/{CLUSTER-NAME}/restoreJobs?batchId={BATCH-ID}

Request Parameters

Request Path Parameters

Path Element Required/Optional Description
GROUP-ID Required. The unique identifier of the group that owns the snapshots.
CLUSTER-NAME Required The name of the cluster that contains the snapshots that you want to retrieve.

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
pageNum integer Page number (1-based). 1
itemsPerPage integer Maximum number of items to return, up to a maximum of 100. 100
pretty boolean Display response in a prettyprint format. false
batchId ObjectId ID of the batch. Not Applicable

Request Body Parameters

This endpoint does not use HTTP request body parameters.

Response Elements

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

results Array

Name Type Description
batchId string

ID of the batch to which this restore job belongs.

Only present for a restore of a sharded cluster.

clusterId string

ID of the cluster represented by the restore job.

Only present for a restore of a cluster.

created timestamp The exact point in time when the restore job was requested in ISO 8601 date and time format in UTC.
delivery object The method and details of how the restored snapshot data shall be delivered.
delivery.expires timestamp

Date after which the URL is no longer available.

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

delivery.expirationHours number

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

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

delivery.maxDownloads number

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

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

delivery.methodName string

How the data will be delivered. Value may be one of the following:

  • HTTP
  • QUERY
delivery.statusName string

Current status of the downloadable file. Value may be one of the following:

  • NOT_STARTED
  • IN_PROGRESS
  • READY
  • FAILED
  • INTERRUPTED
  • EXPIRED
  • MAX_DOWNLOADS_EXCEEDED
delivery.url string

The URL from which the restored snapshot data can be downloaded.

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

encryptionEnabled boolean Indicates whether the restored snapshot data is encrypted.
groupId string ID of the project that owns the restore job.
hashes object 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.

Note

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

hashes.typeName string The hashing algorithm used to compute the hash value. If present, this value is SHA1.
hashes.fileName string The name of the file that has been hashed.
hashes.hash string The hash of the file.
id ObjectId The ID of the restore job.
links document array One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification
masterKeyUUID string The KMIP master key ID used to encrypt the snapshot data. This field is present only if encryptionEnabled is true for the snapshot.
snapshotId ObjectId ID of the snapshot to restore.
statusName string

Current status of the job. Value may be one of the following:

  • FINISHED
  • IN_PROGRESS
  • BROKEN
  • KILLED
timestamp object Timestamp of the latest oplog entry in the restored snapshot.
timestamp.date timestamp Timestamp in ISO 8601 date and time format in UTC of the latest oplog entry in the restored snapshot.
timestamp.increment number Order of all operations completed at the latest oplog entry in the restored snapshot.

totalCount Document

This value is the count of the total number of items in the result set. totalCount may be greater than the number of objects in the results array if the entire result set is paginated.

Examples

Example Request

curl --user "{USERNAME}:{APIKEY}" --digest \
   --header "Accept: application/json" \
   --header "Content-Type: application/json" \
   --include \
   -X GET  "https://cloud.mongodb.com/api/atlas/v1.0/groups/{groupId}/clusters/{clusterId}/restoreJobs"

Example Response

{
     "links": [{
             "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/6b77777887d9d61443b41645/clusters/Cluster0/restoreJobs?pageNum=1&itemsPerPage=100",
             "rel": "self"
     }],
     "results": [{
             "batchId": "5a66783b80eef5354c77ee13",
             "clusterId": "7c88887880eef52e5f4d0e2d",
             "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-dev.mongodb.com/backup/restore/v2/pull/5a66783b80eef5354c77ee16/MGViYTUwZGQ4YWVkNDY4MGE2YWE4NGQzODY0MzAzYTU=/config-Cluster0-config-0-5a66689487d9d61443b46149-1516661094-5a66783b80eef5354c77ee16.tar.gz"
             },
             "encryptionEnabled": false,
             "groupId": "6b77777887d9d61443b41645",
             "hashes": [{
                     "fileName": "config-Cluster0-config-0-5a66689487d9d61443b46149-1516661094-5a66783b80eef5354c77ee16.tar.gz",
                     "hash": "a98af3c1f85a9eb3061423cda0fad8b4d0a48209",
                     "typeName": "SHA1"
             }],
             "id": "5a66783b80eef5354c77ee16",
             "links": [{
                     "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/6b77777887d9d61443b41645/clusters/Cluster0/restoreJobs/5a66783b80eef5354c77ee16",
                     "rel": "self"
             }],
             "pointInTime": false,
             "snapshotId": "5a6669d5e2bfb3461861360c",
             "statusName": "FINISHED",
             "timestamp": {
                     "date": "2018-01-22T22:44:54Z",
                     "increment": 1
             }
     }, {
             "batchId": "5a66783b80eef5354c77ee13",
             "clusterId": "6b88887880eef52e5f4d0e2f",
             "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-dev.mongodb.com/backup/restore/v2/pull/5a66783b80eef5354c77ee15/N2Y1NDhkMjg0Mzk4NGU1Mzk3NTkwMjA0M2ZhODVkNDk=/Cluster0-shard-1-1516661094-5a66783b80eef5354c77ee15.tar.gz"
             },
             "encryptionEnabled": false,
             "groupId": "6b77777887d9d61443b41645",
             "hashes": [{
                     "fileName": "Cluster0-shard-1-1516661094-5a66783b80eef5354c77ee15.tar.gz",
                     "hash": "86bc2f505c0874cdc0eaaa82ead2ef48aaf56d67",
                     "typeName": "SHA1"
             }],
             "id": "5a66783b80eef5354c77ee15",
             "links": [{
                     "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/6b77777887d9d61443b41645/clusters/Cluster0/restoreJobs/5a66783b80eef5354c77ee15",
                     "rel": "self"
             }],
             "pointInTime": false,
             "snapshotId": "5a6669d9fcc178211a0d75a8",
             "statusName": "FINISHED",
             "timestamp": {
                     "date": "2018-01-22T22:44:54Z",
                     "increment": 1
             }
     }, {
             "batchId": "5a66783b80eef5354c77ee13",
             "clusterId": "6b99987880eef52e5f4d0e31",
             "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-dev.mongodb.com/backup/restore/v2/pull/5a66783b80eef5354c77ee14/NjMxOWFhNTA3MGY1NDU0Mzk5ZDU1YjE0YWY2ZjQ5NDM=/Cluster0-shard-0-1516661094-5a66783b80eef5354c77ee14.tar.gz"
             },
             "encryptionEnabled": false,
             "groupId": "6b77777887d9d61443b41645",
             "hashes": [{
                     "fileName": "Cluster0-shard-0-1516661094-5a66783b80eef5354c77ee14.tar.gz",
                     "hash": "18a8617d0b6bfff97b7232d1ebeeea16edc216b0",
                     "typeName": "SHA1"
             }],
             "id": "5a66783b80eef5354c77ee14",
             "links": [{
                     "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/6b77777887d9d61443b41645/clusters/Cluster0/restoreJobs/5a66783b80eef5354c77ee14",
                     "rel": "self"
             }],
             "pointInTime": false,
             "snapshotId": "5a6669d9e2bfb34668cfe459",
             "statusName": "FINISHED",
             "timestamp": {
                     "date": "2018-01-22T22:44:54Z",
                     "increment": 1
             }
     }],
     "totalCount": 3
}