Update One Backup Configuration
On this page
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://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
Resource
PATCH /groups/{projectId}/backupConfigs/{clusterId}
Request Parameters
Request Path Parameters
Path Parameter | Type | Necessity | Description |
---|---|---|---|
projectId | string | Required | Unique 24-hexadecimal digit string that identifies the
project that holds the cluster with the backup configuration you
want to change. |
clusterId | string | Required | Unique 24-hexadecimal digit string that identifies the cluster
whose backup configuration you want to change. |
Request Query Parameters
The following query parameters 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 that indicates whether or not to wrap the response in an 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:
| false |
Request Body Parameters
Name | Type | Necessity | Description |
---|---|---|---|
authMechanismName | string | Conditional | Authentication mechanism needed to connect to the sync source database. Ops Manager requires this parameter if the sync store uses authentication. Ops Manager accepts:
|
encryptionEnabled | boolean | Optional | Flag that indicates if encryption is enabled for the backup configuration. You must include the syncSource parameter when enabling encryption for a backup configuration. For existing backups in a project, enabling encryption requires an initial sync to recreate the backups’ head databases. FCV For more information on backup encryption for FCV 4.2 or later, see Encrypted Backup Snapshots. |
excludedNamespaces | array of strings | Conditional | NoteOps Manager accepts this parameter for backup jobs running MongoDB FCV 4.0 or earlier. Ops Manager ignores this parameter when backing up MongoDB databases running FCV 4.2 or later. List of database and collection names to omit from the backup. Each string represents one namespace. Namespaces use the format of {database} or {database}.{collection}. This parameter must meet the following conditions:
|
includedNamespaces | array of strings | Conditional | NoteOps Manager accepts this parameter for backup jobs running MongoDB FCV 4.0 or earlier. Ops Manager ignores this parameter when backing up MongoDB databases running FCV 4.2 or later. List of database and collection names to include from the backup. Each string represents one namespace. Namespaces use the format of {database} or {database}.{collection}. This parameter must meet the following conditions:
|
password | string | Conditional | Password to use to connect to the sync source database. Ops Manager
requires this parameter when the sync store mongod instances
require clients to authenticate. |
preferredMember | string | Optional | Cluster member that a user designates as the preferred replica set member to create snapshots. You can set the preferred member using the console. View available replica set members that can act as a preferred member using the Get one backup config endpoint. |
provisioned | boolean | Conditional | Flag that indicates if Ops 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. Ops Manager accepts:
|
storageEngineName | string | Optional | Storage engine used for the backup. Ops Manager accepts:
|
syncSource | string | Conditional |
Ops Manager requires this parameter if "storageEngineName" : "WIRED_TIGER". |
username | string | Conditional | Name of the user to use to connect to the sync source database.
Ops Manager requires this parameter when the sync store Send this parameter to Ops Manager when updating the backup configuration for a replica set or sharded cluster that Ops Manager doesn't manage. |
Response
Name | Type | Description |
---|---|---|
authMechanismName | string | Name of the authentication mechanism to use when connecting to
the sync source database. Ops Manager returns this parameter if the
sync store uses authentication. |
clusterId | string | Unique identifier of the cluster to which this backup
configuration applies. |
encryptionEnabled | boolean | Flag that indicates if encryption is enabled for the backup configuration. You must include the syncSource field when enabling encryption for a backup configuration. For existing backups in a project, enabling encryption requires an initial sync to recreate the backups’ head databases. FCV For more information on backup encryption for FCV 4.2 or later, see Encrypted Backup Snapshots. |
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}. |
preferredMember | string | Cluster member that a user designates as the preferred replica set member to create snapshots. You can set the preferred member using the console. View available replica set members that can act as a preferred member using the Get one backup config endpoint. |
projectId | string | Unique identifier of the project that owns this backup
configuration. |
provisioned | boolean | Flag that indicates if Ops Manager has provisioned the resources
needed to store a backup. Ops 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 status of the backup configuration. |
storageEngineName | string | Storage engine used for the backup. |
Example Request
1 curl --user "{publicKey}:{privateKey}" --digest \ 2 --header "Accept: application/json" \ 3 --header "Content-Type: application/json" \ 4 --include --request PATCH "https://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{projectId}/backupConfigs/{clusterId}" \ 5 --data ' 6 { 7 "statusName": "STARTED", 8 "storageEngineName": "WIRED_TIGER", 9 "syncSource": "primary" 10 }'
When each snapshot starts, Ops Manager selects a replica set member to run the snapshot. This automatically selected member should have the least performance impact on the replica set. You can override the default selection.
Important
Use default selection whenever possible. This choice ensures backup availability.
The following request sets the preferred member.
1 curl --user "{publicKey}:{privateKey}" --digest \ 2 --header "Accept: application/json" \ 3 --header "Content-Type: application/json" \ 4 --include --request PATCH "https://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{projectId}/backupConfigs/{clusterId}" \ 5 --data ' 6 { 7 "preferredMember":"{HOSTNAME}:{PORT}" 8 }'
Example Response
Response Header
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
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 "authMechanismName" : "NONE", 3 "clusterId" : "{clusterId}", 4 "encryptionEnabled" : false, 5 "excludedNamespaces" : [ ], 6 "groupId" : "{projectId}", 7 "links" : [ { 8 "href" : "http://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{projectId}/backupConfigs/{clusterId}", 9 "rel" : "self" 10 }, { 11 "href" : "http://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{projectId}/clusters/{clusterId}", 12 "rel" : "http://mms.mongodb.com/cluster" 13 }, { 14 "href" : "http://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{projectId}", 15 "rel" : "http://mms.mongodb.com/group" 16 }, { 17 "href" : "http://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{projectId}/backupConfigs/{clusterId}/snapshotSchedule", 18 "rel" : "http://mms.mongodb.com/snapshotSchedule" 19 } ], 20 "sslEnabled" : false, 21 "statusName" : "STARTED", 22 "storageEngineName" : "WIRED_TIGER" 23 }
When each snapshot starts, Ops Manager selects a replica set member to run the snapshot. This automatically selected member should have the least performance impact on the replica set. You can override the default selection.
Important
Use default selection whenever possible. This choice ensures backup availability.
The following response includes preferred member.
1 { 2 "authMechanismName" : "NONE", 3 "clusterId" : "{clusterId}", 4 "encryptionEnabled" : false, 5 "excludedNamespaces" : [ ], 6 "groupId" : "{projectId}", 7 "links" : [ { 8 "href" : "http://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{projectId}/backupConfigs/{clusterId}", 9 "rel" : "self" 10 }, { 11 "href" : "http://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{projectId}/clusters/{clusterId}", 12 "rel" : "http://mms.mongodb.com/cluster" 13 }, { 14 "href" : "http://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{projectId}", 15 "rel" : "http://mms.mongodb.com/group" 16 }, { 17 "href" : "http://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{projectId}/backupConfigs/{clusterId}/snapshotSchedule", 18 "rel" : "http://mms.mongodb.com/snapshotSchedule" 19 } ], 20 "sslEnabled" : false, 21 "statusName" : "STARTED", 22 "storageEngineName" : "WIRED_TIGER", 23 "preferredMember":"{HOSTNAME}:{PORT}" 24 }