Navigation

Update One Backup Configuration

Note

Groups and projects are synonymous terms. Your {PROJECT-ID} is the same as your project id. For existing groups, your group/project id remains the same. This page uses the more familiar term group when referring to descriptions. The endpoint remains as stated in the document.

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

Resource

PATCH /groups/{projectId}/backupConfigs/{clusterId}

Request Parameters

Request Path Parameters

Path Parameter Type Necessity Description
projectId string Required Unique identifier for the project that holds the cluster with the backup configuration you want to change.
clusterId string Required Unique indentifier of the cluster whose backup configuration you want to change.

Request Query Parameters

The following query parameters are optional:

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

Flag that indicates whether or not to wrap the response in a JSON envelope.

Some API 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:

Name Description
status HTTP response code
envelope Expected response body
false

Request Body Parameters

Name Type Necessity Description
authMechanismName string Conditional

Authentication mechanism needed to connect to the sync source database. Cloud Manager requires this parameter if the sync store uses authentication. Cloud Manager accepts:

  • MONGODB_CR (This covers SCRAM-SHA-1, SCRAM-SHA-256, and MONGODB-CR.)
  • GSSAPI
  • PLAIN
  • MONGODB_X509
  • NONE
excludedNamespaces array of strings Optional

List of database names and collection names to omit from the backup. Each string is a namespace in the form of {database} or {database}.{collection}.

  • You can set this parameter or includedNamespaces, not both.
  • You must send the new full list of excluded namespaces, including any that were already listed.
  • If your new list removes any namespaces from the previous list, set the syncSource parameter. Removing an excluded namespace necessitates a full resync. Without the syncSource parameter, the request fails.
  • If your new list only adds to the previous list, don’t set syncSource.
includedNamespaces array of strings Optional

List of database names and collection names to include in the backup. Each string is a namespace in the form of {database} or {database}.{collection}. Cloud Manager doesn’t backup any namespace not listed in this array.

  • You can set this parameter or excludedNamespaces, not both.
  • You must send the new full list of included namespaces, including any that were already listed.
  • If the new list removes any namespaces from the previous list, set the syncSource parameter. Removing an included namespace requires a full resync. Without the syncSource parameter, the request will fail.
  • If the new list only removes namespaces from the previous list, don’t set syncSource.
password string Conditional Password to use to connect to the sync source database. Cloud Manager requires this parameter when the sync store mongod instances require clients to authenticate.
provisioned boolean Conditional Flag that indicates if Cloud Manager has provisioned the resources needed to store a backup.
sslEnabled boolean Optional Flag that indicates if TLS is enabled for the sync source database.
statusName string Optional

Current (or desired) status of the backup configuration. Cloud Manager accepts:

  • INACTIVE
  • PROVISIONING
  • STARTED
  • STOPPED
  • TERMINATING
storageEngineName string Optional

Storage engine used for the backup. Cloud Manager accepts:

  • MEMORY_MAPPED
  • WIRED_TIGER
syncSource string Conditional

mongod instance to get backup data from. Cloud Manager accepts either a specific hostname or one of: PRIMARY and SECONDARY.

Cloud Manager requires this parameter if “storageEngineName” : “WIRED_TIGER”.

username string Conditional

Name of the user to use to connect to the sync source database. Cloud Manager requires this parameter when the sync store mongod instances require clients to authenticate.

Send this parameter to Cloud Manager when updating the backup configuration for a replica set or sharded cluster that Cloud Manager doesn’t manage.

Response

Name Type Description
authMechanismName string Name of the authentication mechanism to use when connecting to the sync source database. Cloud Manager returns this parameter if the sync store uses authentication.
clusterId string Unique identifier of the cluster to which this backup configuration applies.
excludedNamespaces array of strings List of database names and collection names to omit from the backup. Each string is a namespace in the form of {database} or {database}.{collection}.
includedNamespaces array of strings List of database names and collection names to include in the backup. Each string is a namespace in the form of {database} or {database}.{collection}.
links object array One or more links to sub-resources and/or related resources. All links arrays in responses include at least one link called self. The relationships between URLs are explained in the Web Linking Specification.
projectId string Unique identifier of the project that owns this backup configuration.
provisioned boolean Flag that indicates if Cloud Manager has provisioned the resources needed to store a backup. Cloud Manager returns this parameter when the amount of data to be backed up exceeds a certain threshold.
sslEnabled boolean Flag that indicates if TLS is enabled for the sync source database.
statusName string Current (or desired) status of the backup configuration.
storageEngineName string Storage engine used for the backup.

Example Request

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
curl --user "{publicKey}:{privateKey}" --digest \
     --header "Accept: application/json" \
     --header "Content-Type: application/json" \
     --include --request PATCH "https://cloud.mongodb.com/api/public/v1.0/groups/{projectId}/backupConfigs/{clusterId}"
     --data '
       {
         "statusName": "STARTED",
         "storageEngineName": "WIRED_TIGER",
         "syncSource": "primary"
       }'

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}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}

Response Body

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
  "authMechanismName" : "NONE",
  "clusterId" : "{clusterId}",
  "encryptionEnabled" : false,
  "excludedNamespaces" : [ ],
  "groupId" : "{projectId}",
  "links" : [ {
    "href" : "http://cloud.mongodb.com/api/public/v1.0/groups/{projectId}/backupConfigs/{clusterId}",
    "rel" : "self"
  }, {
    "href" : "http://cloud.mongodb.com/api/public/v1.0/groups/{projectId}/clusters/{clusterId}",
    "rel" : "http://mms.mongodb.com/cluster"
  }, {
    "href" : "http://cloud.mongodb.com/api/public/v1.0/groups/{projectId}",
    "rel" : "http://mms.mongodb.com/group"
  }, {
    "href" : "http://cloud.mongodb.com/api/public/v1.0/groups/{projectId}/backupConfigs/{clusterId}/snapshotSchedule",
    "rel" : "http://mms.mongodb.com/snapshotSchedule"
  } ],
  "sslEnabled" : false,
  "statusName" : "STARTED",
  "storageEngineName" : "WIRED_TIGER"
}