Navigation

Get All Snapshots for One Cluster

Base URL: https://cloud.mongodb.com/api/public/v1.0

Syntax

GET /api/public/v1.0/groups/{groupId}/clusters/{clusterId}/snapshots

Request Parameters

Request Path Parameters

Name Type Description
groupId string ID of the group that owns the snapshot.
clusterId string ID of the cluster that the snapshot represents.

Request Query Parameters

This endpoint may use any of the HTTP request query parameters available to all Cloud Manager API resources. These are all optional.

Name Type Description Default
pageNum integer Page number (1-based). 1
itemsPerPage integer Maximum number of items to return, up to a maximum of 100. 100
pretty boolean Display response in a prettyprint format. false

Request Body Parameters

This endpoint does not use HTTP request body parameters.

Response Elements

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

results Array

This document array includes one document for each MongoDB snapshot.

Name Type Description
clusterId objectId ID of the cluster the snapshot represents.
complete boolean Indicator that the snapshot has been created. This is false if the snapshot creation job is still 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 at 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 Timestamps.
doNotDelete boolean Indicator that the snapshot cannot be deleted.
expires timestamp

The date in ISO 8601 date and time format at UTC after which this snapshot can be deleted.

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

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

groupId objectId ID of the group that owns the snapshot.
id objectId ID of the snapshot.
isPossiblyInconsistent boolean

Indicator of the consistency of this snapshot.

Note

This appears for sharded cluster snapshots only.

To take a snapshot of a sharded cluster in a consistent state, the Backup Agent temporarily turns off the balancer before creating the snapshot. In some cases, it cannot turn off the balancer in a timely manner. The snapshot is then created with the balancer still running.

If this happens, the snapshot may be in an inconsistent state (e.g., chunk migrations may be in progress).

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 at UTC.
lastOplogAppliedTimestamp.increment integer The operation order in which last oplog was applied at this exact point in time. To learn how timestamps work in MongoDB, see Timestamps.
links document array See links Array.
namespaceFilterList document array 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.

missingShards document array

List of shards that the snapshot is missing.

Note

This appears for sharded cluster snapshots only.

In steady state, this array is empty. If the Backup Agent cannot connect to a shard when a snapshot is created, the shard is omitted from the snapshot. Each document in the array is a cluster document containing a self link.

missingShards.id objectId ID of the missing shard.
missingShards.groupId objectId ID of the group that owns the missing shard.
missingShards.typeName string

The type of server that the missing shard represents:

  • CONFIG_SERVER_REPLICA_SET
  • REPLICA_SET
missingShards.clusterName string The name of the cluster for the missing shard.
missingShards.shardName string The name of the missing shard.
missingShards.replicaSetName string Name of the replica set in the missing shard.
missingShards.lastHeartbeat timestamp The exact point in time in ISO 8601 date and time format at UTC when the last heartbeat was received from the missing shard.
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 Indicator of the state of encryption of the snapshot data.
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 this snapshot has parts.encryptionEnabled : true.

parts.mongodVersion string The version of mongod that the replica set primary was running when the snapshot was created.
parts.replicaSetName string Name of the replica set.
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

totalCount Document

This value is the 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.

Examples

Example Request

curl --user "{username}:{apiKey}" --digest \
 --header "Accept: application/json" \
 --header "Content-Type: application/json" \
 --include \
 --request GET "https://cloud.mongodb.com/api/public/v1.0/groups/{groupId}/clusters/{clusterId}/snapshots?pretty=true"

Example Response

Response Header

HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=ISO-8859-1
Date: {dateInUnixFormat}
WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false
Content-Length: {requestLengthInBytes}
Connection: keep-alive
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}

Response Body

{
  "links" : [ {
    "href" : "https://cloud.mongodb.com/api/public/v1.0/groups/{groupId}/clusters/{clusterId}/snapshots?pretty=true&pageNum=1&itemsPerPage=100",
    "rel" : "self"
  } ],
  "results" : [ {
    "clusterId" : "{clusterId}",
    "complete" : true,
    "created" : {
      "date" : "2016-08-21T23:47:38Z",
      "increment" : 1
    },
    "doNotDelete" : false,
    "expires" : "2017-08-20T23:47:38Z",
    "groupId" : "{groupId}",
    "id" : "{snapshotId}",
    "links" : [ {
      "href" : "https://cloud.mongodb.com/api/public/v1.0/groups/{groupId}/clusters/{clusterId}/snapshots/{snapshotId}",
      "rel" : "self"
    } ],
    "namespaceFilterList" : {
      "filterList" : [ ],
      "filterType" : "blacklist"
    },
    "parts" : [ {
      "clusterId" : "{clusterId}",
      "compressionSetting" : "GZIP",
      "dataSizeBytes" : 503779557,
      "encryptionEnabled" : false,
      "fileSizeBytes" : 2855605344,
      "mongodVersion" : "3.2.9",
      "replicaSetName" : "proton",
      "storageSizeBytes" : 547516416,
      "typeName" : "REPLICA_SET"
    } ]
  }, {
    ...
  } ],
  "totalCount" : 28
}