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

Start a Process with the Public API

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 start a process that was previously shut down. Ops Manager sets disabled to false for the process in the automation configuration and publishes the change.

The request is asynchronous: 200 OK means Ops Manager published the change, not that the process is running. Poll the automation status resource until the plan completes. Then confirm that the member's replicaStateName on the v2.0 Get One Host by ID endpoint returns to SECONDARY or PRIMARY.

If the process is already running, nothing changes and the agent takes no action, but Ops Manager still publishes the configuration and records the event. If the oplog rolled over while the process was down, the member stays in RECOVERING and doesn't resync on its own. Use Resync a Process instead.

Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0

POST /groups/{GROUP-ID}/process/{HOST-PORT}:startup

The API key that makes this request must have the Project Automation Admin role.

Name
Type
Necessity
Description

GROUP-ID

string

Required

Unique 24-hexadecimal digit string that identifies your project.

HOST-PORT

string

Required

Target process, as hostname:port. For example, node1.example.com:27017.

Name
Type
Necessity
Description
Default

dryRun

boolean

Optional

If true, Ops Manager validates the request and returns the changed process without publishing it or adding an activity feed event. Ops Manager rejects any value other than true or false with 400 INVALID_QUERY_PARAMETER.

false

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.

false

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:

  • status: HTTP response code

  • content: Expected response body

false

This endpoint doesn't use HTTP request body parameters.

Ops Manager returns 200 OK and the target process as it appears in the automation configuration, with the change applied. disabled is false. 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 mongod.

version

string

MongoDB version of the process.

disabled

boolean

true if the process is shut down.

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.

The following example starts 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:startup?pretty=true"
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-alive
HTTP/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}
{ "name": "rs0_1", "processType": "mongod", "version": "8.0.4", "hostname": "node1.example.com", "disabled": false, "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" } }}
HTTP Status
Error Code
Description

200

--

The change was published, or computed with dryRun=true. Returns the process document.

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

HOST-PORT doesn't match a process in the project's automation configuration.

400

INVALID_QUERY_PARAMETER

dryRun isn't true or false.

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.