Navigation

Get All Snapshots

Important With Circle IconCreated with Sketch.Important
Legacy Backup Deprecated

MongoDB deprecated the Legacy Backup feature. Clusters that use Legacy Backup can continue to use it. MongoDB recommends using Cloud Backups. Effective 23 March 2020, all new clusters can only use Cloud Backups.

Info With Circle IconCreated with Sketch.Note

Groups and projects are synonymous terms. Your {GROUP-ID} is the same as your project ID. For existing groups, your group/project ID remains the same. The resource and corresponding endpoints use the term groups.

The Atlas API authenticates using HTTP Digest Authentication. Provide a programmatic API public key and corresponding private key as the username and password when constructing the HTTP request.

To learn how to configure API access for an Atlas project, see Configure Atlas API Access.

https://cloud.mongodb.com/api/atlas/v1.0

GET /groups/{GROUP-ID}/clusters/{CLUSTER-NAME}/snapshots
Path ElementNecessityDescription
GROUP-IDRequired.The unique identifier of the project that owns the snapshots.
CLUSTER-NAMERequiredThe name of the cluster that contains the snapshots that you want to retrieve.

The following query parameters are optional:

NameTypeNecessityDescriptionDefault
pageNumintegerOptionalPage number, starting with one, that Atlas returns of the total number of objects.1
itemsPerPageintegerOptionalNumber of items that Atlas returns per page, up to a maximum of 500.100
includeCountbooleanOptionalFlag that indicates whether Atlas returns the totalCount parameter in the response body.true
prettybooleanOptionalFlag that indicates whether Atlas returns the JSON response in the prettyprint format.false
envelopebooleanOptional

Flag that indicates whether Atlas wraps the response in an envelope.

Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query.

Endpoints that return a list of results use the results object as an envelope. Atlas adds the status parameter to the response body.

false

This endpoint does not use HTTP request body parameters.

The HTTP response returns a JSON document that includes the following elements:

NameTypeDescription
clusterIdstringThe unique ID of the cluster that the snapshot represents.
completebooleanIndicates whether the snapshot exists. This is false if the snapshot creation job is in progress.
createdDocumentThe components of a timestamp.
created.datetimestampThe exact point in time when the snapshot was taken in ISO 8601 date and time format in UTC .
created.incrementintegerThe operation order in which this snapshot took place at this exact point in time. To learn how timestamps work in MongoDB, see timestamp.
doNotDeletebooleanSpecifies whether the snapshot can be deleted.
expirestimestamp

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.

groupIdobjectIdID of the project that owns the snapshot.
idobjectIdID of the snapshot.
lastOplogAppliedTimestampdocumentThe components of the timestamp of the last oplog entry was applied.
lastOplogAppliedTimestamp.datetimestampThe exact point in time when the last oplog was applied in ISO 8601 date and time format in UTC .
lastOplogAppliedTimestamp.incrementintegerThe operation order in which the last oplog was applied at this exact point in time. To learn how timestamps work in MongoDB, see timestamp.
linksdocument arrayOne or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification.
partsdocument array

The individual parts that comprise the complete snapshot.

parts.clusterIdobjectIdID of the replica set.
parts.compressionSettingstringMethod of compression for the snapshot.
parts.dataSizeBytesnumberThe total size of the data in the snapshot in bytes.
parts.encryptionEnabledbooleanIndicates whether the snapshot is encrypted.
parts.fileSizeBytesnumberThe total size of the data files in bytes.
parts.masterKeyUUIDobjectId

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

Info With Circle IconCreated with Sketch.Note
This appears only if parts.encryptionEnabled is true.
parts.mongodVersionstringThe version of MongoDB that the replica set primary was running when the snapshot was created.
parts.replicaSetNamestringName of the replica set.
parts.storageSizeBytesnumberThe total size of space allocated for document storage.
parts.typeNamestring

The type of server that the part represents:

  • REPLICA_SET
  • CONFIG_SERVER_REPLICA_SET

The links array includes one or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification.

RelationDescription
selfThe URL endpoint for this resource.

This value is the count of the total number of items in the result set. totalCount may be greater than the number of objects in the results array if the entire result set is paginated.

curl -X GET -i --digest -u "{PUBLIC-KEY}:{PRIVATE-KEY}" "https://cloud.mongodb.com/api/atlas/v1.0/groups/6c7498dg87d9e6526801572b/clusters/Cluster0/snapshots"
HTTP/1.1 200 OK
{
"links": [{
"href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/6c7498dg87d9e6526801572b/clusters/Cluster0/snapshots?pageNum=1&itemsPerPage=100",
"rel": "self"
}],
"results": [{
"clusterId": "7c2487d833e9e75286093696",
"complete": true,
"created": {
"date": "2017-12-26T16:32:16Z",
"increment": 1
},
"doNotDelete": false,
"expires": "2018-12-25T16:32:16Z",
"groupId": "6c7498dg87d9e6526801572b",
"id": "5b2479g9fhh175800596754k",
"lastOplogAppliedTimestamp": {
"date": "2017-12-26T16:32:15Z",
"increment": 1
},
"links": [{
"href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/6c7498dg87d9e6526801572b/clusters/Cluster0/snapshots/5a4279d4fcc178500596745a",
"rel": "self"
}],
"parts": [{
"clusterId": "7c2487d833e9e75286093696",
"compressionSetting": "GZIP",
"dataSizeBytes": 4502,
"encryptionEnabled": false,
"fileSizeBytes": 324760,
"mongodVersion": "3.6.10",
"replicaSetName": "Cluster0-shard-0",
"storageSizeBytes": 53248,
"typeName": "REPLICA_SET"
}]
}],
"totalCount": 1
}
Give Feedback