Navigation

mongocli cloud-manager backup snapshots list

The backup snapshots list command retrieves the list of snapshots for the specified cluster. You can also view the list of snapshots through the MongoDB Cloud Manager UI or API.

mongocli cloud-manager|cm backup snapshots list|ls <cluster-ID>
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]
[ --projectId <project-ID> ]
Note

Use -h or --help to view the command-line help for this command.

Option
Type
Description
Required?
<cluster-ID>
string
The ID of the cluster.
yes
--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

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.

Field
Type
Description
clusterId
string
The unique ID of the cluster that the snapshot represents.
complete
boolean
Indicates whether the snapshot exists. This is false if the snapshot creation job is in progress.
created
Document
The components of a timestamp.
created.date
timestamp
The exact point in time when the snapshot was taken in ISO 8601 date and time format in UTC .
created.increment
integer
The operation order in which this snapshot took place at this exact point in time. To learn how timestamps work in MongoDB, see timestamp.
doNotDelete
boolean
Specifies whether the snapshot can be deleted.
expires
timestamp

The date in ISO 8601 date and time format in UTC after which Atlas deletes the snapshot.

If doNotDelete is set to true, any value in expires is removed.

If the expires value is earlier than the current date and time, the snaphot cannot be edited.

groupId
objectId
ID of the project that owns the snapshot.
id
objectId
ID of the snapshot.
lastOplogAppliedTimestamp
document
The components of the timestamp of the last oplog entry was applied.
lastOplogAppliedTimestamp.date
timestamp
The exact point in time when the last oplog was applied in ISO 8601 date and time format in UTC .
lastOplogAppliedTimestamp.increment
integer
The operation order in which the last oplog was applied at this exact point in time. To learn how timestamps work in MongoDB, see timestamp.
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.
namespaceFilterList
object
The namespaces that are included or excluded from this snapshot.
namespaceFilterList.filterList
string array

A comma-separated list of any combination of databases or namespaces that are exclusively included or explicitly excluded from the snapshot.

The default value is an empty array ([]).

namespaceFilterList.filterType
string

A value that determines how namespaces are filtered for this snapshot.

  • If this value is set to blacklist, namespaces in namespaceFilterList.filterList are excluded from the snapshot.
  • If this value is set to whitelist, only namespaces in namespaceFilterList.filterList are included in the snapshot.

The default value is blacklist.

parts
document array

The individual parts that comprise the complete snapshot.

  • For a replica set, this array contains a single document.
  • For a sharded cluster, this array contains one document for each shard plus one document for the config server.
parts.clusterId
objectId
ID of the replica set.
parts.compressionSetting
string
Method of compression for the snapshot.
parts.dataSizeBytes
number
The total size of the data in the snapshot in bytes.
parts.encryptionEnabled
boolean
Indicates whether the snapshot is encrypted.
parts.fileSizeBytes
number
The total size of the data files in bytes.
parts.masterKeyUUID
objectId

The KMIP master key ID used to encrypt the snapshot data.

Note
This appears only if parts.encryptionEnabled is true.
parts.mongodVersion
string
The version of MongoDB that the replica set primary was running when the snapshot was created.
parts.replicaSetName
string
Name of the replica set.
parts.shardName
string
Name of the shard.
parts.storageSizeBytes
number
The total size of space allocated for document storage.
parts.typeName
string

The type of server that the part represents:

  • REPLICA_SET
  • CONFIG_SERVER_REPLICA_SET

The following example uses the mongocli cm backup snapshots ls command to retrieve the list of snapshots for a cluster specified by ID. The command uses the default profile where the project ID and the Programmatic API Keys are stored.

mongocli cloud-manager backup snapshots ls 5e84cb9e8036fa746da0e60d --output json

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

{
"results": [
{
"clusterId": "5e84cb9e8036fa746da0e60d",
"complete": true,
"created": {
"date": "2020-04-01T17:19:45Z",
"increment": 1
},
"doNotDelete": false,
"expires": "2021-03-31T17:18:06Z",
"groupId": "5e84b94c003f2d6370004f4e",
"id": "5e84cd874fcd014f22847958",
"lastOplogAppliedTimestamp": {
"date": "2020-04-01T17:19:45Z",
"increment": 1
},
"links": [
{
"rel": "self",
"href": "https://cloud.mongodb.com/api/public/v1.0/groups/5e84b94c003f2d6370004f4e/clusters/5e84cb9e8036fa746da0e60d/snapshots/5e84cd874fcd014f22847958"
}
],
"namespaceFilterList": {
"filterList": [],
"filterType": "blacklist"
},
"parts": [
{
"replicaSetName": "cm-clstr-repl",
"typeName": "REPLICA_SET",
"clusterId": "5e84cb9e8036fa746da0e60d",
"compressionSetting": "GZIP",
"dataSizeBytes": 18425,
"encryptionEnabled": false,
"fileSizeBytes": 323584,
"mongodVersion": "4.2.1",
"storageSizeBytes": 323584,
"shardName": "",
"tokenDiscovered": false,
"tokenTimestamp": {
"date": "",
"increment": 0
}
}
]
}
],
"links": [
{
"rel": "self",
"href": "https://cloud.mongodb.com/api/public/v1.0/groups/5e84b94c003f2d6370004f4e/clusters/5e84cb9e8036fa746da0e60d/snapshots?pageNum=1\u0026itemsPerPage=100"
}
],
"totalCount": 1
}
Give Feedback