Update Snapshot Schedule for One Cluster
Deprecated
Updates the snapshot schedule for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
Effective 23 March 2020, all new clusters can use only Cloud Backups. When you upgrade to 4.2, your backup system upgrades to cloud backup if it is currently set to legacy backup. After this upgrade, all your existing legacy backup snapshots remain available. They expire over time in accordance with your retention policy. Your backup policy resets to the default schedule. If you had a custom backup policy in place with legacy backups, you must re-create it with the procedure outlined in the Cloud Backup documentation.
Path parameters
-
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
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.
Format should match the following pattern:
^([a-f0-9]{24})$
. -
Human-readable label that identifies the cluster with the snapshot you want to return.
Format should match the following pattern:
^[a-zA-Z0-9][a-zA-Z0-9-]*$
.
Query parameters
-
Flag that indicates whether Application wraps the response in an
envelope
JSON object. 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. Application adds the status parameter to the response body.Default value is
false
. -
Flag that indicates whether the response body should be in the prettyprint format.
Default value is
false
.Prettyprint
Body
Required
Update the snapshot schedule for one cluster in the specified project.
-
Quantity of time expressed in minutes between successive cluster checkpoints. This parameter applies only to sharded clusters. This number determines the granularity of continuous cloud backups for sharded clusters.
Values are
15
,30
, or60
. -
Unique 24-hexadecimal digit string that identifies the cluster with the snapshot you want to return.
Format should match the following pattern:
^([a-f0-9]{24})$
. -
Quantity of time to keep daily snapshots. MongoDB Cloud expresses this value in days. Set this value to
0
to disable daily snapshot retention.Values are
0
,3
,4
,5
,6
,7
,15
,30
,60
,90
,120
,180
, or360
. -
Number of months that MongoDB Cloud must keep monthly snapshots. Set this value to
0
to disable monthly snapshot retention.Values are
0
,1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,13
,18
,24
, or36
. -
Number of hours before the current time from which MongoDB Cloud can create a Continuous Cloud Backup snapshot.
-
Number of hours that must elapse before taking another snapshot.
Values are
6
,8
,12
, or24
. -
Number of days that MongoDB Cloud must keep recent snapshots.
Values are
2
,3
,4
, or5
. -
Number of weeks that MongoDB Cloud must keep weekly snapshots. Set this value to
0
to disable weekly snapshot retention.Values are
0
,1
,2
,3
,4
,5
,6
,7
,8
,12
,16
,20
,24
, or52
.
curl \
--request PATCH 'https://cloud.mongodb.com/api/atlas/v2/groups/32b6e34b3d91647abb20e7b8/clusters/{clusterName}/snapshotSchedule' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/vnd.atlas.2023-01-01+json"
{
"clusterCheckpointIntervalMin": 15,
"clusterId": "32b6e34b3d91647abb20e7b8",
"dailySnapshotRetentionDays": 0,
"monthlySnapshotRetentionMonths": 0,
"pointInTimeWindowHours": 42,
"snapshotIntervalHours": 6,
"snapshotRetentionDays": 2,
"weeklySnapshotRetentionWeeks": 0
}
{
"clusterCheckpointIntervalMin": 15,
"clusterId": "32b6e34b3d91647abb20e7b8",
"dailySnapshotRetentionDays": 0,
"groupId": "32b6e34b3d91647abb20e7b8",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"monthlySnapshotRetentionMonths": 0,
"pointInTimeWindowHours": 42,
"snapshotIntervalHours": 6,
"snapshotRetentionDays": 2,
"weeklySnapshotRetentionWeeks": 0
}
{
"error": 400,
"detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
"reason": "Bad Request",
"errorCode": "VALIDATION_ERROR"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"error": 404,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
"reason": "Not Found",
"errorCode": "RESOURCE_NOT_FOUND"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}