Docs Menu
Docs Home
/ /

Create Import Deployment Request

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.

Create a new import deployment request to add existing MongoDB processes to Ops Manager automation. This endpoint initiates the process of importing multiple MongoDB processes into both monitoring and automation management.

Important

This feature is available starting in Ops Manager 8.0.13.

The imported deployments are added to the project's automation configuration. The MongoDB Agent will begin monitoring the processes and manage them according to the automation configuration.

This endpoint requires the Project Automation Admin role.

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

POST /automation/importDeployment/{PROJECT-ID}
Name
Type
Necessity
Description

PROJECT-ID

string

Required

Unique identifier of the project that will own the imported deployments.

The following query parameters are optional:

Name
Type
Necessity
Description
Default

pretty

boolean

Optional

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:

Name
Description

status

HTTP response code

content

Expected response body

false

Name
Type
Necessity
Description

seedHostport

string

Required

Hostname and port of the seed MongoDB process to connect to for discovery (e.g., mongodb1.example.com:27017).

requiredProcesses

array

Required

Array of hostname:port strings representing MongoDB processes that must be discovered before the import can proceed.

timeouts

object

Optional

Timeout settings for various import phases.

timeouts.seedHostConnectionSec

number

Optional

Timeout in seconds for connecting to the seed host. Range: 60-86400 seconds. Default uses system settings.

timeouts.processesDiscoverySec

number

Optional

Timeout in seconds for discovering all required processes. Range: 60-86400 seconds. Default uses system settings.

timeouts.automationImported

number

Optional

Timeout in seconds for completing the automation import. Range: 60-86400 seconds. Default uses system settings.

timeouts.goalStateSec

number

Optional

Timeout in seconds for reaching automation goal state. Range: 60-86400 seconds. Default uses system settings.

authMechanism

string

Optional

Authentication mechanism for connecting to the MongoDB processes. Possible values are:

  • MONGODB_CR (This covers SCRAM-SHA-1, SCRAM-SHA-256, and MONGODB-CR.)

  • GSSAPI

  • PLAIN

  • MONGODB_X509

  • NONE

username

string

Conditional

Username for authenticating to the MongoDB processes. Required if authMechanism is specified.

password

string

Conditional

Password for authenticating to the MongoDB processes. Required if authMechanism is MONGODB_CR.

Ops Manager doesn't include this parameter in response documents.

adminDb

string

Optional

Database to authenticate against. Default: admin.

pemKeyFilePath

string

Optional

Path to the PEM key file for TLS client authentication.

pemKeyFilePassword

string

Optional

Password for the PEM key file.

Ops Manager doesn't include this parameter in response documents.

adminKerberosKeytab

string

Optional

Path to the Kerberos keytab file for GSSAPI authentication.

adminLdapGroupDn

string

Optional

LDAP group distinguished name for PLAIN authentication.

saslServiceName

string

Optional

SASL service name for GSSAPI authentication.

caFilePath

string

Optional

Path to the Certificate Authority file for TLS connections.

clusterCaFilePath

string

Optional

Path to the cluster Certificate Authority file for TLS connections.

clientCertificateMode

string

Optional

Client certificate mode for TLS connections.

Returns an empty success response with HTTP status 200 if the import request is successfully submitted.

Note

This endpoint does not return the ID of the created import request. To track the status of your import request, use the Get Import Deployment Requests endpoint to list all requests for the project and identify your request by creation time or other properties.

curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--include \
--request POST "https://<OpsManagerHost>:<Port>/api/public/v1.0/automation/importDeployment/{PROJECT-ID}?pretty=true" \
--data '{
"seedHostport": "mongodb1.example.com:27017",
"requiredProcesses": [
"mongodb1.example.com:27017",
"mongodb2.example.com:27017",
"mongodb3.example.com:27018"
],
"timeouts": {
"seedHostConnectionSec": 300,
"processesDiscoverySec": 600,
"automationImported": 600,
"goalStateSec": 1200
},
"authMechanism": "MONGODB_CR",
"username": "admin",
"password": "password123",
"adminDb": "admin"
}'
HTTP/1.1 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
HTTP/1.1 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}
{}

Back

Import Deployments

On this page