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.
Use this endpoint to gracefully stop a running process. Ops Manager sets disabled to true for the process in the automation configuration and publishes the change. If the process is the current primary, the Automation Agent steps it down before it stops the process.
The request is asynchronous: 200 OK means Ops Manager published the change, not that the process has stopped. Poll the automation status resource until the process's lastGoalVersionAchieved equals the plan's goalVersion.
If the process is already shut down, nothing changes and the agent takes no action, but Ops Manager still publishes the configuration and records the event.
Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
Resource
POST /groups/{GROUP-ID}/process/{HOST-PORT}:shutdownRequired Roles
The API key that makes this request must have the Project Automation Admin role.
Request Path Parameters
Name | Type | Necessity | Description |
|---|---|---|---|
GROUP-ID | string | Required | Unique 24-hexadecimal digit string that identifies your project. |
HOST-PORT | string | Required | Target process, as |
Request Query Parameters
Name | Type | Necessity | Description | Default |
|---|---|---|---|---|
dryRun | boolean | Optional | If |
|
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
This endpoint doesn't use HTTP request body parameters.
Response
Ops Manager returns 200 OK and the target process as it appears in the automation configuration, with the change applied. disabled is true. The body is the same whether you set dryRun or not.
Name | Type | Description |
|---|---|---|
name | string | Name of the process in the automation configuration. |
hostname | string | Hostname of the process. |
processType | string | Type of process, for example |
version | string | MongoDB version of the process. |
disabled | boolean |
|
lastRestart | string | Timestamp, in ISO 8601 UTC format, of the last requested restart. |
lastResync | string | Timestamp, in ISO 8601 UTC format, of the last requested resync. |
The document also contains the rest of the process's automation configuration, such as args2_6, featureCompatibilityVersion, and authSchemaVersion. See the Automation Configuration reference.
Example Request
The following example shuts down the process running on node1.example.com:27017.
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --include \ --request POST "https://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{GROUP-ID}/process/node1.example.com:27017:shutdown?pretty=true"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
{ "name": "rs0_1", "processType": "mongod", "version": "8.0.4", "hostname": "node1.example.com", "disabled": true, "authSchemaVersion": 5, "featureCompatibilityVersion": "8.0", "args2_6": { "net": { "port": 27017 }, "replication": { "replSetName": "rs0" }, "storage": { "dbPath": "/data/rs0_1" }, "systemLog": { "destination": "file", "path": "/data/rs0_1/mongodb.log" } }}Response Codes
HTTP Status | Error Code | Description |
|---|---|---|
200 | -- | The change was published, or computed with |
400 | -- | The process is in manual mode, or the automation configuration failed validation. The message explains why. Not returned for a dry run. |
409 | GROUP_IN_RESTORATION_MODE | The project is reconciling after a restore. |
403 | PROCESS_EXTERNALLY_MANAGED | The project's processes are managed by an external system. |
409 | AUTOMATION_CONFIG_DRAFT_ALREADY_EXISTS | You have an unpublished automation configuration draft in the project. |
404 | PROCESS_NOT_FOUND |
|
400 | INVALID_QUERY_PARAMETER |
|
409 | AUTOMATION_CONFIG_CONCURRENT_MODIFICATION | Someone published a change while this request was in progress. Ops Manager returns this code only for a real request. |
Ops Manager checks the shared errors in the order listed. See Process Lifecycle for prerequisites and limitations.