- API >
- Public API Resources >
- Backup and Restore >
- Snapshots
Snapshots¶
On this page
Overview¶
This resource allows you to view snapshot metadata and remove existing
snapshots. A snapshot is a complete copy of the data in a mongod
instance at a point in time. To delete a resource, you must issue the request
from an IP address on your user account’s whitelist.
You can retrieve snapshot metadata for the whole cluster or replica set, or for a single config server in a cluster.
In order to perform a restore of the snapshot data, you must create a restore job.
Endpoints¶
Get All Snapshots for a Cluster¶
CLUSTER-ID
must be the ID of either a replica set or a sharded cluster.
Get a Single Snapshot for a Cluster¶
Delete a Snapshot¶
Remove a single snapshot. Note that while the two above methods return metadata about the snapshot, this will actually remove the underlying backed-up data.
Get All Snapshots for a Config Server¶
Get all snapshots for a config server. HOST-ID
must be the ID
of a config server.
Get a Single Snapshot for a Config Server¶
Sample Entity¶
The following is a sample snapshot document.
Entity Fields¶
Name |
Type | Description |
---|---|---|
groupId |
string | ID of the group that owns the snapshot. |
clusterId |
string | ID of the cluster represented by the snapshot. Not present for a config server snapshot. |
hostId |
string | ID of the config server represented by the snapshot. Present only for a config server snapshot. |
created |
BSON timestamp | The exact point-in-time at which the snapshot was taken. |
expires |
timestamp | The date after which this snapshot is eligible for deletion. |
complete |
boolean | Is this snapshot complete? This will be false if the snapshot creation job is still in progress. |
isPossiblyInconsistent |
boolean | Could this snapshot be inconsistent? isPossiblyInconsistent
is only present for sharded cluster
snapshots. In order to take a snapshot of a sharded cluster in
a consistent state, the backup agent will temporarily turn off
the balancer before creating the snapshot. In some cases, it will
not be able to turn off the balancer in a timely manner, so the
snapshot will be created with the balancer still running. If this
happens, the snapshot may be in an inconsistent state (e.g.,
because chunk migrations may be in progress). |
missingShards |
array of clusters | List of shards that are missing from the snapshot. Only present for a
sharded cluster snapshot. In steady state, this array will be empty.
However, if the backup agent is unable to connect to a shard when a
snapshot is created, it will be omitted from the snapshot. Each document
in the array is a cluster document containing a self link. |
parts |
array of parts | The individual parts that comprise the complete snapshot. For a replica set, this array will contain a single element. For a sharded cluster, there will be one element for each shard plus one element for the config server. |
parts.typeName |
string | The type of server represented by the part. Possible values are:
|
parts.clusterId |
string | ID of the replica set. Not present for a config server. |
parts.replicaSetName |
string | Name of the replica set. Not present for a config server. |
parts.encryptionEnabled |
boolean | Indicates whether the snapshot data is encrypted. |
parts.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. |
parts.hostId |
string | ID of a config server. Not present for a replica set. |
parts.mongodVersion |
string | The version of mongod that was running when the snapshot was created. |
parts.dataSizeBytes |
number | The total size of the data in the snapshot. |
parts.storageSizeBytes |
number | The total size of space allocated for document storage. |
parts.fileSizeBytes |
number | The total size of the data files. |
Links¶
Relation | Description |
---|---|
self |
Me |
http://mms.mongodb.com/cluster |
The cluster that this snapshot belongs to. |
http://mms.mongodb.com/group |
The group that owns this snapshot. |