Navigation

Create One Restore Job for One Legacy Mirrored Config Server

Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0

Resource

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

Request Path Parameters

Name Type Description
GROUP-ID ObjectId ID of the group that owns the job.
HOST-ID ObjectId ID 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 Ops Manager 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

Request Body Parameters

Name Type Description
delivery object The method and details of how the restored snapshot data will 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 needed if "delivery.methodName" : "HTTP".

delivery.formatName string

Format in which data from an SCP restore should be written to the destination. Value may be one of the following:

  • ARCHIVE
  • INDIVIDUAL

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

delivery.hostname string

Hostname of the server to which the data should be written for an SCP restore.

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

delivery.maxDownloads number

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

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

delivery.methodName string

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

  • AUTOMATED_RESTORE
  • HTTP
  • QUERY
  • SCP

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.

SCP Restore Deprecated

Restore delivery via SCP is a deprecated feature. This feature will be removed in Ops Manager 3.8.

delivery.password string

Password to use for SCP.

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

Note

It is never exposed in a restore job response document.

delivery.passwordTypeName string

Type of authentication to use for SCP. Value may be one of the following:

  • PASSWORD
  • SSH_KEY

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

delivery.port number

Port to use for SCP.

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

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.targetDirectory string

Target directory to which the data should be written for an SCP restore.

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

delivery.url string

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

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

delivery.username string

Username to use for SCP.

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

encryptionEnabled boolean Indicates whether the restored snapshot data is encrypted.
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.

Only needed if "encryptionEnabled" : true for the snapshot.

pointInTime boolean Indicates that the job is a PIT restore.
snapshotId ObjectId ID of the snapshot to restore.
timestamp BSON timestamp

Timestamp of the latest oplog entry in the restored snapshot.

If you include this parameter, you are requesting a PIT restore job.

Important

  • If your group (GROUP-ID) has the client-side PIT restore feature enabled, including timestamp in your request results in an error.
  • If your group (GROUP-ID) does not have the client-side PIT restore feature enabled, including timestamp in your request triggers a server-side PIT restore job.
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.

Response

Name Type Description
batchId ObjectId

ID of the batch to which this restore job belongs.

Only present for a restore of a sharded cluster.

clusterId ObjectId

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.formatName string

Format in which data from an SCP restore should be written to the destination. Value may be one of the following:

  • ARCHIVE
  • INDIVIDUAL

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

delivery.hostname string

Hostname of the server to which the data should be written for an SCP restore.

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

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
  • SCP

SCP Restore Deprecated

Restore delivery via SCP is a deprecated feature. This feature will be removed in Ops Manager 3.8.

delivery.port number

Port to use for SCP.

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

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.targetDirectory string

Target directory to which the data should be written for an SCP restore.

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

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 ObjectId ID 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.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.
hostId ObjectId

ID of the config server to which this restore job belongs.

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

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.
pointInTime boolean Indicates that the job for a PIT restore.
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 BSON timestamp 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.

Example Request

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

curl --user "{USERNAME}:{APIKEY}" --digest \
 --header "Accept: application/json" \
 --header "Content-Type: application/json" \
 --include \
 --request POST "https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0/groups/{GROUP-ID}/hosts/{HOST-ID}/restorejobs?pretty=true" \
 --data '
  {
    "delivery" : {
      "formatName" : "ARCHIVE",
      "hostname" : "restore.example.com",
      "methodName" : "SCP",
      "password" : "{SCP-PASSWORD}",
      "passwordTypeName" : "TEXT",
      "port" : "8080",
      "targetDirectory" : "/data/restore",
      "username" : "{SCP-USERNAME}"
    },
    "snapshotId" : "{SNAPSHOT-ID}",
    "timestamp" : {
      "date" : "2016-08-24T23:51:30Z",
      "increment" : 1
    }
  }'

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  "created" : "2017-08-25T16:22:15Z",
  "delivery" : {
    "formatName" : "ARCHIVE",
    "hostname" : "restore.example.com",
    "methodName" : "SCP",
    "password" : "{SCP-PASSWORD}",
    "passwordTypeName" : "PASSWORD",
    "port" : "8443",
    "statusName" : "IN_PROGRESS",
    "targetDirectory" : "/data/restore",
    "username" : "{SCP-USERNAME}"
  },
  "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}",
  "pointInTime" : true,
  "snapshotId" : "{SNAPSHOT-ID}",
  "statusName" : "IN_PROGRESS",
  "timestamp" : {
    "date" : "2017-08-24T23:51:30Z",
    "increment" : 1
  }
}