Navigation

mongocli ops-manager backup snapshots list

On this page

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

Syntax

mongocli ops-manager backup snapshots list|ls <cluster-ID>
     [ --profile|-P <profile-name> ]
     [ --projectId <project-ID> ]

Note

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

Options

Option Type Description Required?
<cluster-ID> string The ID of the cluster. yes
--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 that contains the cluster. If omitted, uses the project ID in the profile or environment variable. no

Output

The command prints the following fields in JSON 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.

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

Example

The following example uses the mongocli om 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 ops-manager backup snapshots ls 1e2bcd3456e7d890ae12f345

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

{
        "results": [
                {
                        "clusterId": "1e2bcd3456e7d890ae12f345",
                        "complete": true,
                        "created": {
                                "date": "2020-03-26T13:25:16Z",
                                "increment": 1
                        },
                        "doNotDelete": false,
                        "expires": "2020-03-28T13:25:16Z",
                        "groupId": "1a2b3c4a56b7d890ab123456",
                        "id": "5e7cad8243b1d948cb474471",
                        "lastOplogAppliedTimestamp": {
                                "date": "2020-03-26T13:25:16Z",
                                "increment": 1
                        },
                        "links": [
                                {
                                        "rel": "self",
                                        "href": "http://ec2-12-345-678-912.eu-west-1.compute.amazonaws.com:9080/api/public/v1.0/groups/1a2b3c4a56b7d890ab123456/clusters/1e2bcd3456e7d890ae12f345/snapshots/5e7cad8243b1d948cb474471"
                                }
                        ],
                        "namespaceFilterList": {
                                "filterList": [],
                                "filterType": "blacklist"
                        },
                        "parts": [
                                {
                                        "replicaSetName": "myDemo",
                                        "typeName": "REPLICA_SET",
                                        "clusterId": "1e2bcd3456e7d890ae12f345",
                                        "compressionSetting": "GZIP",
                                        "dataSizeBytes": 3111,
                                        "encryptionEnabled": false,
                                        "fileSizeBytes": 304371,
                                        "mongodVersion": "4.0.17",
                                        "storageSizeBytes": 73728,
                                        "shardName": "",
                                        "tokenDiscovered": false,
                                        "tokenTimestamp": {
                                                "date": "",
                                                "increment": 0
                                        }
                                }
                        ]
                },
                {
                        "clusterId": "1e2bcd3456e7d890ae12f345",
                        "complete": true,
                        "created": {
                                "date": "2020-03-26T05:25:16Z",
                                "increment": 1
                        },
                        "doNotDelete": false,
                        "expires": "2020-04-23T05:25:16Z",
                        "groupId": "1a2b3c4a56b7d890ab123456",
                        "id": "5e7c3d0143b1d948cb47268e",
                        "lastOplogAppliedTimestamp": {
                                "date": "2020-03-26T05:25:16Z",
                                "increment": 1
                        },
                        "links": [
                                {
                                        "rel": "self",
                                        "href": "http://ec2-12-345-678-912.eu-west-1.compute.amazonaws.com:9080/api/public/v1.0/groups/1a2b3c4a56b7d890ab123456/clusters/1e2bcd3456e7d890ae12f345/snapshots/5e7c3d0143b1d948cb47268e"
                                }
                        ],
                        "namespaceFilterList": {
                                "filterList": [],
                                "filterType": "blacklist"
                        },
                        "parts": [
                                {
                                        "replicaSetName": "myDemo",
                                        "typeName": "REPLICA_SET",
                                        "clusterId": "1e2bcd3456e7d890ae12f345",
                                        "compressionSetting": "GZIP",
                                        "dataSizeBytes": 2699,
                                        "encryptionEnabled": false,
                                        "fileSizeBytes": 238836,
                                        "mongodVersion": "4.0.17",
                                        "storageSizeBytes": 57344,
                                        "shardName": "",
                                        "tokenDiscovered": false,
                                        "tokenTimestamp": {
                                                "date": "",
                                                "increment": 0
                                        }
                                }
                        ]
                },
                {
                        "clusterId": "1e2bcd3456e7d890ae12f345",
                        "complete": true,
                        "created": {
                                "date": "2020-03-25T21:25:16Z",
                                "increment": 1
                        },
                        "doNotDelete": false,
                        "expires": "2020-04-22T21:25:16Z",
                        "groupId": "1a2b3c4a56b7d890ab123456",
                        "id": "5e7bcc7f43b1d948cb4708a2",
                        "lastOplogAppliedTimestamp": {
                                "date": "2020-03-25T21:25:15Z",
                                "increment": 1
                        },
                        "links": [
                                {
                                        "rel": "self",
                                        "href": "http://ec2-12-345-678-912.eu-west-1.compute.amazonaws.com:9080/api/public/v1.0/groups/1a2b3c4a56b7d890ab123456/clusters/1e2bcd3456e7d890ae12f345/snapshots/5e7bcc7f43b1d948cb4708a2"
                                }
                        ],
                        "namespaceFilterList": {
                                "filterList": [],
                                "filterType": "blacklist"
                        },
                        "parts": [
                                {
                                        "replicaSetName": "myDemo",
                                        "typeName": "REPLICA_SET",
                                        "clusterId": "1e2bcd3456e7d890ae12f345",
                                        "compressionSetting": "GZIP",
                                        "dataSizeBytes": 2655,
                                        "encryptionEnabled": false,
                                        "fileSizeBytes": 214255,
                                        "mongodVersion": "4.0.17",
                                        "storageSizeBytes": 40960,
                                        "shardName": "",
                                        "tokenDiscovered": false,
                                        "tokenTimestamp": {
                                                "date": "",
                                                "increment": 0
                                        }
                                }
                        ]
                }
        ],
        "links": [
                {
                        "rel": "self",
                        "href": "http://ec2-12-345-678-912.eu-west-1.compute.amazonaws.com:9080/api/public/v1.0/groups/1a2b3c4a56b7d890ab123456/clusters/1e2bcd3456e7d890ae12f345/snapshots?pageNum=1\u0026itemsPerPage=100"
                }
        ],
        "totalCount": 3
}