Navigation

mongocli ops-manager backup restore list

The backup restore list command lists the restore jobs for a deployment. You can also list restore jobs using the Ops Manager API.

mongocli ops-manager|om backup|backups restore|restores list|ls
<cluster-ID>
[ --limit <items-per-page>]
[ --output|-o <output-format> ]
[ --page <page-num> ]
[ --profile|-P <profile-name> ]
[ --projectId <project-ID> ]
Option
Type
Description
Required?
<cluster-ID>
string
Unique identifier of the cluster that contains the restore jobs you want to list.
yes
--limit
integer
Number of items to return per page, up to a maximum of 500. Defaults to 100 if not specified.
no
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format
  • go-template for custom output using the Go template
  • go-template-file for custom output specified using the Go template file

If omitted, the command returns output in the default format.

no
--profile, -P
string
Name of the profile where the project ID and the Programmatic API Keys for the project are saved. If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI.
no
--projectId
string

Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable.

no
--page
integer
Page number (1-based). Defaults to 1 if not specified.
no

The command prints the following fields in the specified format to the terminal if the command succeeds. If the command returns an error, see Troubleshooting for recommended solutions.

The response JSON document includes an array of result objects, an array of link objects and a count of the total number of result objects retrieved.

Name
Type
Description
results
array
Array includes one object for each item detailed in the results Embedded Document.
links
array
Array includes one or more links to sub-resources and/or related resources. The relations between URL s are explained in the Web Linking Specification.
totalCount
number
Integer count of the total number of items in the result set. It may be greater than the number of objects in the results array if the entire result set is paginated.
Name
Type
Description
batchId
string
Conditional: sharded cluster only. Unique identifier of the batch to which this restore job belongs.
clusterId
string
Conditional: cluster only. Unique identifier of the cluster that the restore job represents.
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 values are:

  • HTTP

    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.url
string
Conditional: "delivery.methodName" : "HTTP". URL from which the restored snapshot data can be downloaded.
encryptionEnabled
boolean
Flag indicating 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 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
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 links arrays in responses include at least one link called self. The relationships between URL s are explained in the Web Linking Specification.
masterKeyUUID
string
Conditional: "encryptionEnabled" : true. KMIP master key ID used to encrypt the snapshot data.
pointInTime
boolean
Flag indicating that the job for a PIT restore.
snapshotId
string
Unique identifier of the snapshot to restore.
statusName
string

Current status of the job. Accepted values are:

  • FINISHED
  • IN_PROGRESS
  • BROKEN
  • KILLED
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.

The following example uses the mongocli cm backup restore list command to retrieve the restore jobs for the cluster ID 7c88887880eef52e5f4d0e2d. The command uses the default profile.

mongocli cm backup restore list Cluster0 --output json

The previous command prints the following fields to the terminal. To learn more about these fields, see Output.

{
"links": [
{
"href": "https://cloud.mongodb.com/api/cm/v1.0/groups/6b77777887d9d61443b41645/clusters/Cluster0/restoreJobs?pageNum=1&itemsPerPage=100",
"rel": "self"
}
],
"results": [
{
"batchId": "5a66783b80eef5354c77ee13",
"clusterId": "7c88887880eef52e5f4d0e2d",
"created": "2018-01-22T23:48:11Z",
"delivery": {
"expirationHours": 48,
"expires": "2018-01-22T23:49:38Z",
"maxDownloads": 2147483647,
"methodName": "HTTP",
"statusName": "EXPIRED",
"url": "https://ops-host.com:27017/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/cm/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": "7c88887880eef52e5f4d0e2d",
"created": "2018-01-22T23:48:11Z",
"delivery": {
"expirationHours": 48,
"expires": "2018-01-22T23:49:38Z",
"maxDownloads": 2147483647,
"methodName": "HTTP",
"statusName": "EXPIRED",
"url": "https://ops-host.com:27017/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/cm/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": "7c88887880eef52e5f4d0e2d",
"created": "2018-01-22T23:48:11Z",
"delivery": {
"expirationHours": 48,
"expires": "2018-01-22T23:49:38Z",
"maxDownloads": 2147483647,
"methodName": "HTTP",
"statusName": "EXPIRED",
"url": "https://ops-host.com:27017/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/cm/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
}
Give Feedback