Navigation

Create One Restore Job for One Legacy Mirrored Config Server

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

Resource

POST /groups/{GROUP-ID}/hosts/{HOST-ID}/restoreJobs

Request Path Parameters

Name Type Description
GROUP-ID string Unique identifier of the group that owns the job.
HOST-ID string Unique identifier of the mirrored config server (SCCC) that the job represents.

Request Query Parameters

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

Name Type Description Default
pretty boolean Indicates whether the response body should be in a prettyprint format. false
envelope boolean

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:

status
HTTP response code
envelope
The expected response body
false

Request Body Parameters

Name Type Description
delivery object Method and details of how the restored snapshot data is delivered.
delivery.expires timestamp

Date after which the URL is no longer available.

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

delivery.expirationHours number

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

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

delivery.maxDownloads number

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

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

delivery.methodName string

Means by which the data is delivered. Accepted values are:

  • AUTOMATED_RESTORE
  • HTTP
  • QUERY

Note

If you specify AUTOMATED_RESTORE in the request , the response shows the delivery.methodName as HTTP. An automated restore uses the HTTP method to deliver the restore job to the target host.

Important

Restore delivery via SCP has been removed as of March 27, 2018.

delivery.targetClusterId string

Unique identifier of the destination cluster to perform the restore job.

Only required if delivery.methodName" : "AUTOMATED_RESTORE".

delivery.targetGroupId string

Unique identifier of the project that contains the destination cluster for the restore job.

Only required if delivery.methodName" : "AUTOMATED_RESTORE".

delivery.url string

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

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

snapshotId string Unique identifier of the snapshot to restore.

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

Unique identifier of the cluster that the restore job represents.

Only present for a restore of a cluster.

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

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

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

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.methodName" : "HTTP".

delivery.maxDownloads number

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

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

delivery.methodName string

Means by which the data is delivered. Accepted values are:

  • HTTP
  • QUERY

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:

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

Unique identifier of the destination cluster to perform the restore job.

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

delivery.targetGroupId string

Unique identifier of the project that contains the destination cluster for the restore job.

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

delivery.url string

URL from which the restored snapshot data can be downloaded.

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

encryptionEnabled boolean Flag indicating whether the restored snapshot data is encrypted.
groupId string Unique identifier of the group 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.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

Unique identifier of the config server to which this restore job belongs.

Only present for a restore of a mirrored config server (SCCC).

id string Unique identifier of the restore job.
links object 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 present only if "encryptionEnabled" : true.

snapshotId string Unique identifier of the snapshot to restore.
statusName string

Current status of the job. Accepted values are:

  • FINISHED
  • IN_PROGRESS
  • BROKEN
  • KILLED

Example Request

Create a restore job that transfers a compressed snapshot using HTTP.

curl --user "{USERNAME}:{APIKEY}" --digest \
 --header "Accept: application/json" \
 --header "Content-Type: application/json" \
 --include \
 --request POST "https://cloud.mongodb.com/api/public/v1.0/groups/{GROUP-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

HTTP/1.1 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
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}

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" : "{GROUP-ID}",
  "hostId" : "{HOST-ID}",
  "id" : "{JOB-ID}",
  "links" : [ {
    "href" : "https://cloud.mongodb.com/api/public/v1.0/groups/{GROUP-ID}/hosts/{HOST-ID}/restoreJobs/{JOB-ID}",
    "rel" : "self"
  }, {
    "href" : "https://cloud.mongodb.com/api/public/v1.0/groups/{GROUP-ID}/hosts/{HOST-ID}",
    "rel" : "http://mms.mongodb.com/cluster"
  }, {
    "href" : "https://cloud.mongodb.com/api/public/v1.0/groups/{GROUP-ID}/hosts/{HOST-ID}/snapshots/{SNAPSHOT-ID}",
    "rel" : "http://mms.mongodb.com/snapshot"
  }, {
    "href" : "https://cloud.mongodb.com/api/public/v1.0/groups/{GROUP-ID}",
    "rel" : "http://mms.mongodb.com/group"
  } ],
  "masterKeyUUID" : "{UUID}",
  "snapshotId" : "{SNAPSHOT-ID}",
  "statusName" : "IN_PROGRESS"
}