- API >
- MMS Public API >
- Snapshot Schedule
Snapshot Schedule¶
On this page
This resource allows you to view and configure various properties of snapshot creation and retention for a replica set or cluster. In order to modify this resource, the request must originate from an IP address on the API user’s whitelist.
Sample Entity¶
Entity Fields¶
Name | Type | Description |
---|---|---|
groupId | string | ID of the group that owns the backup configuration. |
clusterId | string | ID of the cluster to which this backup configuration applies. |
snapshotIntervalHours | integer | Number of hours between snapshots. Supported values are 6, 8, 12, and 24. |
snapshotRetentionDays | integer | Number of days to keep recent snapshots. Supported values are 1 - 5. |
clusterCheckpointIntervalMin | integer | Number of minutes between successive cluster checkpoints. This only applies to sharded clusters. This number determines the granularity of point-in-time restores for sharded clusters. |
dailySnapshotRetentionDays | integer | Number of days to retain daily snapshots. Supported values are 1 - 365. |
weeklySnapshotRetentionWeeks | integer | Number of weeks to retain weekly snapshots. Supported values are 1 - 52. |
monthlySnapshotRetentionMonths | integer | Number of months to retain monthly snapshots. Supported values are 1 - 36. |
Links¶
Relation | Description |
---|---|
self | Me |
cluster | The cluster that this backup configuration is for. |
group | The group that owns this backup configuration. |
backupConfig | The backup configuration that this schedule belongs to. |
Operations¶
GET /api/public/v1.0/groups/GROUP-ID/backupConfigs/CLUSTER-ID/snapshotSchedule
- Get the snapshot schedule for a cluster.CLUSTER-ID
must be the ID of either a replica set or a sharded cluster.PATCH /api/public/v1.0/groups/GROUP-ID/backupConfigs/CLUSTER-ID/snapshotSchedule
- Change the parameters of snapshot creation and retention. Any combination of the snapshot schedule’s attributes can be modified.
Examples¶
Get a snapshot schedule:
curl -i -u "username:apiKey" --digest "https://mms.mongodb.com/api/public/v1.0/groups/525ec8394f5e625c80c7404a/backupConfigs/53bc556ce4b049c88baec825/snapshotSchedule"
HTTP/1.1 200 OK
{
"groupId" : "525ec8394f5e625c80c7404a",
"clusterId" : "53bc556ce4b049c88baec825",
"snapshotIntervalHours" : 6,
"snapshotRetentionDays" : 2,
"dailySnapshotRetentionDays" : 7,
"weeklySnapshotRetentionWeeks" : 4,
"monthlySnapshotRetentionMonths" : 13,
"links": [ ... ]
}
Update a snapshot schedule:
curl -i -u "username:apiKey" --digest "https://mms.mongodb.com/api/public/v1.0/groups/525ec8394f5e625c80c7404a/backupConfigs/53bc556ce4b049c88baec825/snapshotSchedule" -X PATCH -H "Content-Type: application/json" --data @-
{
"snapshotIntervalHours": 8,
"dailySnapshotRetentionDays": 14,
"monthlySnapshotRetentionMonths": 6
}
HTTP/1.1 200 OK
{
"groupId" : "525ec8394f5e625c80c7404a",
"clusterId" : "53bc556ce4b049c88baec825",
"snapshotIntervalHours" : 8,
"snapshotRetentionDays" : 2,
"dailySnapshotRetentionDays" : 14,
"weeklySnapshotRetentionWeeks" : 4,
"monthlySnapshotRetentionMonths" : 6,
"links": [ ... ]
}