Docs Menu

Change a Snapshot Expiration

On this page

  • Request
  • Request Parameters
  • Request Path Parameters
  • Request Query Parameters
  • Request Body Parameters
  • Response Elements
  • Examples
  • Example Request
  • Example Response
Important
Legacy Backup Deprecated

Effective 23 March 2020, all new clusters can only use Cloud Backups.

When you upgrade from 4.0 to 4.2, your backup system upgrades to cloud backup if it is currently set to legacy backup. After this upgrade:

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 Administration 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 Get Started with the Atlas Administration API.

All requests to this endpoint must originate from an IP address in the organization's API access list.

Tip

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

PATCH /groups/{GROUP-ID}/clusters/{CLUSTER-NAME}/snapshots/{SNAPSHOT-ID}
Path Element
Necessity
Description
GROUP-ID
Required
The unique identifier of the project that owns the snapshots.
CLUSTER-NAME
Required
The name of the cluster that contains the snapshots that you want to retrieve.
SNAPSHOT-ID
Required
The ID of the desired snapshot.

This endpoint might use any of the HTTP request query parameters available to all Atlas Administration API resources. All of these are optional.

Name
Type
Necessity
Description
Default
pretty
boolean
Optional
Flag indicating whether the response body should be in a prettyprint format.
false
envelope
boolean
Optional

Flag indicating if Atlas should wrap the response in a JSON envelope.

This option may be needed for some API clients. These clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query.

For endpoints that return one result, the response body includes:

status
HTTP response code
envelope
Expected response body
false
Name
Type
Description
doNotDelete
boolean

Indicator that the snapshot cannot be deleted.

Important

You cannot set doNotDelete to true and set a timestamp for expires in the same request. If you do, Atlas returns an error: Cannot modify snapshot because of invalid fields.

expires
timestamp

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

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

If expires is set to a timestamp at or before the current date and time, Atlas deletes the snapshot at its next opportunity. There is no guarantee that the snapshot would be deleted immediately.

If the current expires timestamp has already passed, the snapshot cannot be edited.

Name
Type
Description
clusterId
string
The unique ID of the cluster that the snapshot represents.
complete
boolean
Indicates whether the snapshot exists. This is false if the snapshot creation job is 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 in 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 timestamp.
doNotDelete
boolean
Specifies whether the snapshot can be deleted.
expires
timestamp

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.

groupId
objectId
ID of the project that owns the snapshot.
id
objectId
ID of the snapshot.
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 in UTC.
lastOplogAppliedTimestamp.increment
integer
The operation order in which the last oplog was applied at this exact point in time. To learn how timestamps work in MongoDB, see timestamp.
links
document array
One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification.
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
Indicates whether the snapshot is encrypted.
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 parts.encryptionEnabled is true.
parts.mongodVersion
string
The version of MongoDB 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
curl -X PATCH -i -u "{PUBLIC-KEY}:{PRIVATE-KEY}" -H "Content-Type: application/json" --digest "https://cloud.mongodb.com/api/atlas/v1.0/groups/6c7498dg87d9e6526801572b/clusters/Cluster0/snapshots/6b5380e6jvn128560506942b" --data '{"expires":"2018-12-01"}'
{
"clusterId": "57c2487d833e9e75286093696",
"complete": true,
"created": {
"date": "2017-12-26T16:32:16Z",
"increment": 1
},
"doNotDelete": false,
"expires": "2018-12-01T00:00:00Z",
"groupId": "56c7498dg87d9e6526801572b",
"id": "5a4279d4fcc178500596745a",
"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": "57c2487d833e9e75286093696",
"compressionSetting": "GZIP",
"dataSizeBytes": 4502,
"encryptionEnabled": false,
"fileSizeBytes": 324760,
"mongodVersion": "4.0.0",
"replicaSetName": "Cluster0-shard-0",
"storageSizeBytes": 53248,
"typeName": "REPLICA_SET"
}
]
}
←  Get a SnapshotDelete a Snapshot →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.