For AI agents: a documentation index is available at https://www.mongodb.com/ja-jp/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.

Process Lifecycle Management API

You can use the Ops Manager API to shut down, start, restart, and resync a MongoDB process. Each request updates the process in the automation configuration and publishes the change immediately. The target host's Automation Agent applies the change on its next check-in. If the process is the current primary, the agent first steps it down so that another member can take over, then stops or restarts it.

Each operation is asynchronous. A 200 OK response means Ops Manager published the change, not that the process has stopped, started, restarted, or resynced. The response includes no job ID. To follow the change to completion, poll the automation status resource. If the agent can't apply the change, the plan shows as failed there and the agent keeps retrying.

Every endpoint accepts an optional dryRun=true query parameter. Use it to preview a change before you apply it. Ops Manager runs all the same checks and returns the process document as it would look after the change, but sends nothing to the agent and changes nothing in your deployment. For example, after a shutdown the returned document contains "disabled": true. Review it, then send the same request without dryRun=true to apply the change.

Before you use the Process Lifecycle resources, review the following requirements.

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

To use the Process Lifecycle resources, you must be an Ops Manager user with the Project Automation Admin role.

Your deployment must run Ops Manager 8.0.28 or 9.0.2 or later. Automation must be enabled for the project, and the target host's Automation Agent must be running.

If you have an unpublished automation configuration draft in the project, Ops Manager rejects every request, including a dry run, with a 409 AUTOMATION_CONFIG_DRAFT_ALREADY_EXISTS error. Publish or discard the draft before you continue.

All validation applies to dry runs too, so a successful dry run predicts that the real request passes the same checks. A real request can still fail on a concurrent change or on manual-mode validation.

Important

Process lifecycle operations are not supported for externally managed projects or Kubernetes Operator (MCK) deployments.

Warning

These endpoints provide no quorum protection. Shutting down too many members of a replica set leaves it without a primary. Shut members down one at a time and wait for each to stop before you continue.

The following table lists the endpoints available for the Process Lifecycle resource.

Method
Endpoint
Description

POST

Gracefully stops a running process.

POST

Starts a process that was previously shut down.

POST

Gracefully restarts a running process.

POST

Triggers an initial sync on a replica set member.

Each successful request that isn't a dry run adds one event to the project's activity feed, alongside the usual automation configuration published event. The activity feed attributes requests made with the API to the Public API.

Operation
Event type
What it tells you

AUTOMATION_PROCESS_SHUTDOWN_REQUESTED

A shutdown request was made for this process. Check this event if a member went offline unexpectedly.

AUTOMATION_PROCESS_STARTUP_REQUESTED

A request was made to start a stopped process.

AUTOMATION_PROCESS_RESTART_REQUESTED

A restart request was made for this process. Check this event if a member briefly dropped out or an election occurred.

AUTOMATION_PROCESS_RESYNC_REQUESTED

A resync request was made for this process. Check this event if a member went into STARTUP2 or RECOVERING and is re-copying data.