Create One Legacy Backup Restore Job¶
On this page
MongoDB deprecated the Legacy Backup feature. Clusters that use Legacy Backup can continue to use it. MongoDB recommends using Cloud Backups. Effective 23 March 2020, all new clusters can only use Cloud Backups.
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
.
Creates one restore job for the specified cluster.
This endpoint doesn't support the following:
- Creating checkpoint restore jobs for sharded clusters
- Creating restore jobs for queryable backup snapshots
If you create an automated restore job by specifying
delivery.methodName
of AUTOMATED_RESTORE
in your
request body, Atlas removes all existing data on the target
cluster prior to the restore.
The Atlas Administration 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 Get Started with the Atlas Administration API.
All requests to this endpoint must originate from an IP address in the organization's API access list.
Request¶
Base URL: https://cloud.mongodb.com/api/atlas/v1.0
POST /groups/{GROUP-ID}/clusters/{CLUSTER-NAME}/restoreJobs
Request Parameters¶
Request Path Parameters¶
Path Parameter | Type | Necessity | Description |
---|---|---|---|
GROUP-ID | string | Required | Unique identifier of the project that owns the
snapshots. |
CLUSTER-NAME | string | Required | Name of the cluster that contains the snapshots that you want to
retrieve. |
Request Query Parameters¶
This endpoint might use any of the HTTP request query parameters available to all Atlas Administration API resources. All of these are optional.
Name | Type | Necessity | Description | Default | ||||||
---|---|---|---|---|---|---|---|---|---|---|
pretty | boolean | Optional | Flag indicating 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. This option may be needed for some API clients. These clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. For endpoints that return one result, the response body includes:
| false |
Request Body Parameters¶
Body Parameter | Type | Necessity | Description |
---|---|---|---|
checkpointId | string | Conditional: "delivery.methodName" : "AUTOMATED_RESTORE" for Sharded Clusters Only. | Unique identifier for the sharded cluster checkpoint that represents the point in time to which your data will be restored. Note If you set If you provide this setting, this endpoint restores all data up
to this checkpoint to the database you specify in the
|
delivery | object | Required | Method and details of how the restored snapshot data
will be delivered. |
delivery .expirationHours | number | Conditional: "delivery.methodName" : "HTTP" | Number of hours the download URL is valid once the restore
job is complete. |
delivery .maxDownloads | number | Conditional: "delivery.methodName" : "HTTP" | Number of times the download URL can be used. This must be
1 or greater. |
delivery .methodName | string | Required | Means by which the data is delivered. Accepted values are:
Note If you set
In addition, the response shows the |
delivery .targetClusterId | string | Conditional: "delivery.methodName" : "AUTOMATED_RESTORE" | Unique identifier of the target cluster. Use the Note If backup is not enabled on the target cluster, the
Get All Snapshots
endpoint returns an empty |
delivery .targetClusterName | string | Conditional: "delivery.methodName" : "AUTOMATED_RESTORE" | Name of the target cluster. Use the Note If backup is not enabled on the target cluster, the
Get All Snapshots
endpoint returns an empty |
delivery .targetGroupId | string | Conditional: "delivery.methodName" : "AUTOMATED_RESTORE" | Unique identifier of the project that contains the destination
cluster for the restore job. |
oplogTs | string | Conditional: "delivery.methodName" : "AUTOMATED_RESTORE" | Oplog timestamp given as a
timestamp in the number of seconds that have elapsed since the UNIX epoch. When paired with Run a query against Note If you set
If you provide this setting, this endpoint restores all data up
to and including this Oplog timestamp to the database you
specified in the |
oplogInc | string | Conditional: "delivery.methodName" : "AUTOMATED_RESTORE" | 32-bit incrementing ordinal that represents operations within a
given second. When paired with Note If you set
If you provide this setting, this endpoint restores all data up
to and including this Oplog timestamp to the database you
specified in the |
pointInTimeUTCMillis | long | Conditional: "delivery.methodName" : "AUTOMATED_RESTORE" | timestamp in the number of milliseconds that have elapsed since the UNIX epoch that represents the point in time to which your data will be restored. This timestamp must be within last 24 hours of the current time. If you provide this setting, this endpoint restores all data up
to this point in time to the database you specified in the
Note If you set |
snapshotId | string | Required | Unique identifier of the snapshot to restore. Note If you set |
Response¶
Name | Type | Description |
---|---|---|
batchId | string | Unique identifier of the batch to which this restore job belongs. Only present for a restore of a sharded cluster. |
clusterId | string | |
created | string | Timestamp in ISO 8601 date and time format in UTC when the restore job was requested. |
delivery | object | Method and details of how the restored snapshot data
shall be delivered. |
delivery.expires | string | Timestamp in ISO 8601 date and time format in UTC after which the URL is no longer available. Only present if |
delivery.expirationHours | number | Number of hours the download URL is valid once the restore job is complete. Only present if |
delivery.maxDownloads | number | Number of times the download URL can be used. This must be
Only present if |
delivery.methodName | string | Means by which the data is delivered. Accepted values include:
|
delivery.statusName | string | Current status of the downloadable file. Accepted values include:
|
delivery.url | string | URL from which the restored snapshot data can be downloaded. Only present if |
encryptionEnabled | boolean | Indicates whether the restored snapshot data is encrypted. |
groupId | string | Unique identifier of the project that owns the restore job. |
hashes | object array | If the corresponding Note For an |
hashes.typeName | string | Hashing algorithm used to compute the hash value. If
present, this value is SHA1 . |
hashes.fileName | string | Name of the file that has been hashed. |
hashes.hash | string | Hash of the file. |
id | string | Unique identifier 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 | KMIP master key ID used to encrypt the snapshot data. Only if |
snapshotId | string | Unique identifier of the snapshot to restore. |
statusName | string | Current status of the job. Accepted values include:
|
timestamp | object | Timestamp of the Oplog entry when the snapshot was created. |
timestamp.date | string | Timestamp in ISO 8601 date and time format in UTC of the latest oplog entry in the restored
snapshot. |
timestamp.increment | string | Order of all operations completed at the latest oplog entry in
the restored snapshot. |