- API >
- MMS Public API >
- Backup Configurations
Backup Configurations¶
On this page
The resource modification operation PATCH
only accepts requests
from whitelisted IP addressses. You can only modify a backup
configuration if the request originates 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 this backup configuration. |
clusterId | string | ID of the cluster that this backup configuration is for. |
statusName | enum | The current (or desired) status of the backup configuration. Possible
values are: INACTIVE PROVISIONING STARTED STOPPED TERMINATING |
authMechanismName | enum | The name of the authentication mechanism to use when connecting to the
sync cource database. Only present when using authentication. Possible
values are: MONGODB_CR GSSAPI |
username | string | The username to use to connect to the sync source database. Only present when backing up mongod instances that require clients to authenticate. |
password | string | The password to use to connect to the sync source
database. Only present when backup the mongod
instances that require clients to authenticate. You may only
send this field to MMS when updating backup configuration.
GET request do not include this field. |
sslEnabled | boolean | Is SSL enabled for the sync source database? |
syncSource | string | The mongod instance to get backup data
from. Possible values are either a specific hostname or one of:
PRIMARY and SECONDARY . This field is only used when
updating a backup configuration. It is not returned by a
GET request. |
excludedNamespaces | string array | A list of database names and/or collection names that to omit
from the back up. If a string has a dot (e.g. . ), then it
is a fully qualified namespace in the form of
<database>.<collection> , otherwise strings are database
names. |
Additionally, On Prem versions of MMS return the following additional field:
Name | Type | Description |
---|---|---|
provisioned | boolean | Reports if MMS has provisioned the resources needed to store a backup This field is only present when the amount of data to be backed up exceeds a certain threshold. |
Links¶
Relation | Description |
---|---|
self | Me |
cluster | The cluster that this backup configuration is for. |
group | The group that owns this backup configuration. |
snapshotSchedule | The snapshot schedule for this backup configuration. |
Operations¶
GET /api/public/v1.0/groups/GROUP-ID/backupConfigs/CLUSTER-ID
- Get a single backup configuration by cluster ID.CLUSTER-ID
must be the ID of either a replica set or a sharded cluster.GET /api/public/v1.0/groups/GROUP-ID/backupConfigs
- Get all backup configurations for a group.PATCH /api/public/v1.0/groups/GROUP-ID/backupConfigs/CLUSTER-ID
- Request a state change to an existing backup configuration. Note that these changes are generally asynchronous and will result in a response status code of 202 (Accepted). Additionally, if you issue aGET
request for a backup configuration after a successfulPATCH
, the returned entity may not immediately reflect the update given the asynchronous nature of these state transitions.When modifying the
statusName
property, these are the acceptable transitions:STARTED
- Only valid if the current status isSTOPPED
orINACTIVE
.STOPPED
- Only valid if the current status isSTARTED
.TERMINATING
- Only valid if the current status isSTOPPED
.- You cannot change the
statusName
to these values:INACTIVE PROVISIONING
.
Examples¶
Get a single backup configuration:
curl -i -u "username:apiKey" --digest "https://mms.mongodb.com/api/public/v1.0/groups/5196d3628d022db4cbc26d9e/backupConfigs/5196e5b0e4b0fca9cc88334a"
HTTP/1.1 200 OK
{
"groupId" : "5196d3628d022db4cbc26d9e",
"clusterId" : "5196e5b0e4b0fca9cc88334a",
"statusName" : "STARTED",
"sslEnabled" : false,
"excludedNamespaces" : [ ],
"links" : [ ... ]
}
Get all backup configurations for a group:
curl -i -u "username:apiKey" --digest "https://mms.mongodb.com/api/public/v1.0/groups/5196d3628d022db4cbc26d9e/backupConfigs"
HTTP/1.1 200 OK
{
"totalCount" : 3,
"results" : [ {
"groupId" : "5196d3628d022db4cbc26d9e",
"clusterId" : "5196e5b0e4b0fca9cc88334a",
"statusName" : "STARTED",
"sslEnabled" : false,
"excludedNamespaces" : [ ],
"links" : [ ... ]
}, {
"groupId" : "5196d3628d022db4cbc26d9e",
"clusterId" : "51a2ac88e4b0371c2dbf46ea",
"statusName" : "STARTED",
"sslEnabled" : false,
"excludedNamespaces" : [ ],
"links" : [ ... ]
}, {
"groupId" : "5196d3628d022db4cbc26d9e",
"clusterId" : "52d33abee4b0ca49bc6acd6c",
"statusName" : "STOPPED",
"sslEnabled" : false,
"excludedNamespaces" : [ ],
"links" : [ ... ]
} ],
"links" : [ ... ]
}
Update a backup configuration
curl -i -u "username:apiKey" --digest "https://mms.mongodb.com/api/public/v1.0/groups/5196d3628d022db4cbc26d9e/backupConfigs/5196e5b0e4b0fca9cc88334a" -H "Content-Type: application/json" -X PATCH --data @-
{
"statusName": "STOPPED"
}
HTTP/1.1 202 Accepted
{
"groupId" : "5196d3628d022db4cbc26d9e",
"clusterId" : "5196e5b0e4b0fca9cc88334a",
"statusName" : "STOPPED",
"sslEnabled" : false,
"excludedNamespaces" : [ ],
"links" : [ ... ]
}