Create One Restore Job for One Legacy Mirrored Config Server
On this page
- OAuth 2.0 authentication for programmatic access to Cloud Manager is available as a Preview feature.
- The feature and the corresponding documentation might change at any time during the Preview period. To use OAuth 2.0 authentication, create a service account to use in your requests to the Cloud Manager Public API.
Base URL: https://cloud.mongodb.com/api/public/v1.0
Resource
POST /groups/{PROJECT-ID}/hosts/{HOST-ID}/restoreJobs
Request Path Parameters
Name | Type | Description |
---|---|---|
PROJECT-ID | string | Unique identifier of the project that owns the job. |
HOST-ID | string | Unique identifier of the mirrored config server (SCCC) that the job represents. |
Request Query Parameters
The following query parameters 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 that indicates whether or not to wrap 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. For endpoints that return one result, the response body includes:
| false |
Request Body Parameters
Name | Type | Necessity | Description |
---|---|---|---|
checkpointId | string | Conditional | Unique identifier for the sharded cluster checkpoint that represents the point in time to which your data will be restored. Conditions:
If you provide this setting, this endpoint restores all data up
to this checkpoint to the database you
specified in the |
delivery | object | Required | Method and details of how the restored snapshot data
is delivered. |
delivery .expires | string | Conditional | Timestamp in ISO 8601 date and time format in UTC after which the URL is no longer available.
|
delivery .expirationHours | number | Conditional | Number of hours the download URL is valid once the restore job is complete.
|
delivery .maxDownloads | number | Conditional | Number of times the download URL can be used. This must be
|
delivery .methodName | string | Required | Means by which Cloud Manager delivers the data. Accepted values are:
If you set
In addition, the response shows the IMPORTANT: Restore delivery via SCP has been removed as of March 27, 2018. |
delivery .targetClusterId | string | Conditional | Unique identifier of the target cluster. Use the
If backup is not enabled on the target cluster, the
Get All Snapshots
endpoint returns an empty |
delivery .targetGroupId | string | Conditional | Unique identifier of the project that contains the destination cluster for the restore job.
|
oplogTs | string | Conditional | 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
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 | 32-bit incrementing ordinal
that represents operations within a given second. When paired
with
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 | 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
If you set |
snapshotId | string | Conditional | Unique identifier of the snapshot to restore. |
Response
Name | Type | Description |
---|---|---|
batchId | string | Conditional: sharded cluster only.
Unique identifier of the batch to which this restore
job belongs. |
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
is delivered. |
delivery.expirationHours | number | Conditional: "delivery.methodName" : "HTTP" .
Number of hours the download URL is valid once the restore
job is complete. |
delivery.expires | string | Conditional: "delivery.methodName" : "HTTP" .
Timestamp in ISO 8601 date and time format in UTC after which the URL is no longer available. |
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 | Means by which the data is delivered. Accepted value is
IMPORTANT: Restore delivery via SCP has been removed as of March 27, 2018. |
delivery.statusName | string | Current status of the downloadable file. Accepted values are:
|
delivery.targetClusterId | string | Conditional: delivery.methodName" : "AUTOMATED_RESTORE" .
Unique identifier of the destination cluster to perform the
restore job. |
delivery.targetGroupId | string | Conditional: delivery.methodName" : "AUTOMATED_RESTORE" .
Unique identifier of the project that contains the
destination cluster for the restore job. |
delivery.url | string | Conditional: "delivery.methodName" : "HTTP" .
URL from which the restored snapshot data can be
downloaded. |
groupId | string | Unique identifier of the group that owns the restore
job. |
hashes | object array | If the corresponding For an |
hashes.fileName | string | Name of the snapshot file that has been hashed. |
hashes.hash | string | Hash of the snapshot file. |
hashes.typeName | string | Hashing algorithm used to compute the hash value. If
present, this value is SHA1 . |
hostId | string | Conditional: mirrored config server
(SCCC).
Unique identifier of the config server to which this
restore job belongs. |
id | string | Unique identifier of the restore job. |
links | object array | One or more links to sub-resources and/or related resources. All
|
snapshotId | string | Unique identifier of the snapshot to restore. |
statusName | string | Current status of the job. Accepted values are:
|
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. |
Example Request
Create a restore job that transfers a compressed snapshot using HTTP.
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --include \ --request POST "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/hosts/{HOST-ID}/restoreJobs?pretty=true" \ --data ' { "delivery" : { "expirationHours" : 1, "expires" : "2017-04-21T04:49:57Z", "maxDownloads" : 1, "methodName" : "HTTP", "statusName" : "READY", "url" : "https://api-backup.mongodb.com/backup/restore/v2/pull/{JOB-ID}/OTY0ZmFiNmEzZjEzNGUyMTlhZjJjNjM3NGMyNGM4ZTM=/electron_0-1492636465-{JOB-ID}.tar.gz" }, "snapshotId" : "{SNAPSHOT-ID}" }'
Example Response
Response Header
401 Unauthorized Content-Type: application/json;charset=ISO-8859-1 Date: {dateInUnixFormat} WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false Content-Length: {requestLengthInBytes} Connection: keep-alive
200 OK Vary: Accept-Encoding Content-Type: application/json Strict-Transport-Security: max-age=300 Date: {dateInUnixFormat} Connection: keep-alive Content-Length: {requestLengthInBytes} X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
Response Body
{ "created" : "2017-08-25T16:22:15Z", "delivery" : { "expirationHours" : 1, "expires" : "2017-04-21T04:49:57Z", "maxDownloads" : 1, "methodName" : "HTTP", "statusName" : "READY", "url" : "https://api-backup.mongodb.com/backup/restore/v2/pull/{JOB-ID}/OTY0ZmFiNmEzZjEzNGUyMTlhZjJjNjM3NGMyNGM4ZTM=/electron_0-1492636465-{JOB-ID}.tar.gz" }, "encryptionEnabled" : true, "groupId" : "{PROJECT-ID}", "hostId" : "{HOST-ID}", "id" : "{JOB-ID}", "links" : [ { "href" : "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/hosts/{HOST-ID}/restoreJobs/{JOB-ID}", "rel" : "self" }, { "href" : "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/hosts/{HOST-ID}", "rel" : "http://mms.mongodb.com/cluster" }, { "href" : "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/hosts/{HOST-ID}/snapshots/{SNAPSHOT-ID}", "rel" : "http://mms.mongodb.com/snapshot" }, { "href" : "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}", "rel" : "http://mms.mongodb.com/group" } ], "masterKeyUUID" : "{UUID}", "snapshotId" : "{SNAPSHOT-ID}", "statusName" : "IN_PROGRESS" }