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.
Update the configuration of a monitored MongoDB process.
Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
Resource
PATCH /groups/{PROJECT-ID}/hosts/{HOST-ID}Request Path Parameters
Parameter | Type | Necessity | Description |
|---|---|---|---|
PROJECT-ID | string | Required | Unique identifier of the project that owns this MongoDB process. |
HOST-ID | string | Required | Unique identifier of the host for the MongoDB process. |
Request Query Parameters
The following query parameters are optional:
Name | Type | Necessity | Description | Default |
|---|---|---|---|---|
pretty | boolean | Optional | Flag indicating whether the response body is in a prettyprint format. |
|
envelope | boolean | Optional | Flag that indicates whether 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:
|
|
Request Body Parameters
Parameter | Type | Necessity | Description |
|---|---|---|---|
alertsEnabled | boolean | Optional | Set to |
authMechanismName | string | Optional | Specify which authentication mechanism should be used to connect to this MongoDB process. Possible values are:
|
logsEnabled | boolean | Optional | Set to |
password | string | Conditional | Password for connecting to this MongoDB process. Specify if |
profilerEnabled | boolean | Optional | Set to |
sslEnabled | boolean | Conditional | Set to |
username | string | Conditional | Username needed to connect to this MongoDB process. Specify if |
If authMechanismName is NONE then any existing values for username and password are cleared. If authMechanismName is SCRAM-SHA-1, then you must provide both the username and password.
Response
Name | Type | Description |
|---|---|---|
aliases | array of strings | Array of alternate hostname and port combinations that Ops Manager discovered for the MongoDB process. These combinations can include hostnames, FQDNs, IPv4 addresses, and IPv6 addresses. |
alertsEnabled | boolean |
|
authMechanismName | string | Authentication mechanism used to connect to this MongoDB process. This displays only one of the following values:
|
clusterId | string | Unique identifier of the cluster to which the MongoDB process belongs. |
created | date | Date Ops Manager created or first discovered this MongoDB process. |
groupId | string | Unique identifier of the group that owns this host. |
hasStartupWarnings | boolean |
|
hidden | boolean |
|
hiddenSecondary | boolean |
|
hostEnabled | boolean |
|
hostname | string | Primary hostname as Ops Manager can best determine. This can be a hostname, an FQDN, an IPv4 address, or an IPv6 address. |
id | string | Unique identifier. |
ipAddress | string | IPv4 or IPv6 address associated with the |
journalingEnabled | boolean |
|
lastDataSizeBytes | number | Uncompressed size of the host's databases on disk in bytes excluding indexes. |
lastIndexSizeBytes | number | Uncompressed size of the host's database indexes on disk in bytes. This number does not include the size of the index for the local database. |
lastPing | date | Timestamp in ISO 8601 date and time format in UTC when the last ping for this MongoDB process was received. |
lastRestart | date | Timestamp in ISO 8601 date and time format in UTC when this process last restarted. If the MongoDB process has never been restarted, the |
links | array | Array that includes one or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification. At minimum, a |
logsEnabled | boolean |
|
lowUlimit | boolean |
|
port | number | Port on which the MongoDB process listens. |
profilerEnabled | boolean |
|
replicaSetName | string | Name of the replica set this process belongs to. Only present if this process is part of a replica set. |
replicaStateName | string | Current state of this MongoDB process within a replica set. Only present if this process is part of a replica set. See Replica Set Member States for possible values. |
shardName | string | Name of the shard to which this process belongs. Only present if the process is part of a sharded cluster. |
secondaryDelaySecs | number | Number of seconds this replica set member's data trails the primary. If this value is set to |
sslEnabled | boolean |
|
systemInfo | object | Object that contains RAM and CPU information for this MongoDB process' server as reported by the operating system or container. |
systemInfo.memSizeMB | number | Amount of RAM in megabytes. |
systemInfo.numCores | number | Number of CPU cores. |
typeName | string | Type for this MongoDB process. Possible values are:
The type for new hosts added to Ops Manager will be |
uptimeMsec | number | Number of milliseconds since this process last restarted. |
version | string | Version of MongoDB running for this process. |
Example Request
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --include \ --request PATCH "https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0/groups/{PROJECT-ID}/hosts/{HOST-ID}?pretty=true" \ --data ' { "sslEnabled": true, "username": "mongodb", "password": "M0ng0DB!:)" }'Example Response
Response Header
HTTP/1.1 401 UnauthorizedContent-Type: application/json;charset=ISO-8859-1Date: {dateInUnixFormat}WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=falseContent-Length: {requestLengthInBytes}Connection: keep-aliveHTTP/1.1 200 OKVary: Accept-EncodingContent-Type: application/jsonStrict-Transport-Security: max-age=300Date: {dateInUnixFormat}Connection: keep-aliveContent-Length: {requestLengthInBytes}X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}Response Body
{ "alertsEnabled" : true, "authMechanismName" : "SCRAM-SHA-1", "clusterId" : "{CLUSTER-ID}", "created" : "2024-04-22T19:56:50Z", "groupId" : "{PROJECT-ID}", "hasStartupWarnings" : false, "hidden" : false, "hostEnabled" : true, "hostname" : "server1.example.com", "id" : "{HOST-ID}", "ipAddress": "10.1.0.10", "journalingEnabled" : false, "lastDataSizeBytes" : 470208719, "lastIndexSizeBytes" : 110420592, "lastPing" : "2024-08-15T17:57:12Z", "links" : [ ], "logsEnabled" : false, "lowUlimit" : false, "muninEnabled" : false, "port" : 26000, "profilerEnabled" : false, "replicaSetName": "rs1", "replicaStateName" : "SECONDARY", "sslEnabled" : true, "systemInfo" : { "memSizeMB" : 65536, "numCores" : 16 }, "typeName": "REPLICA_SECONDARY", "uptimeMsec": 489182394, "username" : "mongodb", "version" : "4.4.0"}Note
Although Ops Manager returns muninEnabled in the response, Munin is unsupported as of Ops Manager 4.4.