项目的自动化配置决定了其 MongoDB 进程和代理的目标状态。 MongoDB Agent 根据指定的目标构建部署。
重要
项目的自动化配置可能包含敏感信息,例如密码或键值。此资源获取包含已编辑敏感信息的自动化配置。要获取未编辑的自动化配置,请使用 /groups/{群组 ID(group ID)}/automationConfig 端点。
所需角色
此资源需要Project Automation Admin角色。
Resource
基本 URL: https://cloud.mongodb.com/api/public/v1.0
GET /groups/{PROJECT-ID}/automationConfig/noSecrets请求
路径参数
名称 | 类型 | 必要性 | 说明 |
|---|---|---|---|
PROJECT-ID | 字符串 | 必需 | 拥有自动化配置的群组的唯一标识符。 |
查询参数
以下查询参数为可选参数:
名称 | 类型 | 必要性 | 说明 | 默认 |
|---|---|---|---|---|
pretty | 布尔 | Optional | 指示响应正文是否应采用 prettyprint 格式的标记。 |
|
envelope | 布尔 | Optional | 指示是否将响应包装在信封中的标志。 某些 API 客户端无法访问 HTTP 响应标头或状态代码。要解决这个问题,可在查询中设置 envelope=true。 对于返回一个结果的端点,响应体包括:
|
|
正文参数
此端点不使用 HTTP 请求正文参数。
响应
要查看这些参数,请参阅自动化配置参数。
请求示例
curl --user "{publicApiKey}:{privateApiKey}" --digest \ --header "Accept: application/json" \ --include \ --request GET "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/automationConfig/noSecrets?pretty=true" \ --output currentAutomationConfigRedacted.json响应示例
响应标头
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}响应体
以下示例响应正文显示了包含已编辑敏感信息的自动化配置示例。/groups/{PROJECT-ID}/automationConfig/noSecrets 终结点返回编辑文本,其中敏感字段值替换为 string <redacted>:
{ "backupVersions": [ { "hostname": "test-2.aabc.3172.mongodbdns.com" } ], "mongoDbVersions": [ { "name": "4.4.0" } ], "monitoringVersions": [ { "hostname": "test-2.aabc.3172.mongodbdns.com" } ], "options": { "downloadBase": "/var/lib/mongodb-mms-automation", "downloadBaseWindows": "%SystemDrive%\\MMSAutomation\\versions" }, "processes": [ { "args2_6": { "net": { "port": 27017 }, "operationProfiling": {}, "replication": { "replSetName": "replSet1" }, "storage": { "dbPath": "/data/replSet1_10" }, "systemLog": { "destination": "file", "path": "/data/replSet1_10/mongodb.log" } }, "hostname": "test-2.aabc.3172.mongodbdns.com", "logRotate": { "sizeThresholdMB": 1000, "timeThresholdHrs": 24 }, "auditLogRotate": { "sizeThresholdMB": 1000, "timeThresholdHrs": 24 }, "name": "replSet1_10", "directAttachVerificationKey": "<redacted>", "processType": "mongod", "version": "4.4.0", "authSchemaVersion": 5, "featureCompatibilityVersion": "4.2" }, { "args2_6": { "net": { "port": 27017 }, "operationProfiling": {}, "replication": { "replSetName": "replSet1" }, "storage": { "dbPath": "/data/replSet1_11" }, "systemLog": { "destination": "file", "path": "/data/replSet1_11/mongodb.log" } }, "hostname": "test-1.aabc.3172.mongodbdns.com", "logRotate": { "sizeThresholdMB": 1000, "timeThresholdHrs": 24 }, "auditLogRotate": { "sizeThresholdMB": 1000, "timeThresholdHrs": 24 }, "name": "replSet1_11", "directAttachVerificationKey": "<redacted>", "processType": "mongod", "version": "4.4.0", "authSchemaVersion": 5, "featureCompatibilityVersion": "4.2" }, { "args2_6": { "net": { "port": 27017 }, "operationProfiling": {}, "replication": { "replSetName": "replSet1" }, "storage": { "dbPath": "/data/replSet1_12" }, "systemLog": { "destination": "file", "path": "/data/replSet1_12/mongodb.log" } }, "hostname": "test-0.aabc.3172.mongodbdns.com", "logRotate": { "sizeThresholdMB": 1000, "timeThresholdHrs": 24 }, "auditLogRotate": { "sizeThresholdMB": 1000, "timeThresholdHrs": 24 }, "name": "replSet1_12", "directAttachVerificationKey": "<redacted>", "processType": "mongod", "version": "4.4.0", "authSchemaVersion": 5, "featureCompatibilityVersion": "4.2" }, { "args2_6": { "net": { "port": 27018 }, "operationProfiling": {}, "replication": { "replSetName": "replSet1" }, "storage": { "dbPath": "/data/replSet1_13" }, "systemLog": { "destination": "file", "path": "/data/replSet1_13/mongodb.log" } }, "hostname": "test-2.aabc.3172.mongodbdns.com", "logRotate": { "sizeThresholdMB": 1000, "timeThresholdHrs": 24 }, "auditLogRotate": { "sizeThresholdMB": 1000, "timeThresholdHrs": 24 }, "name": "replSet1_13", "directAttachVerificationKey": "<redacted>", "processType": "mongod", "version": "4.4.0", "authSchemaVersion": 5, "featureCompatibilityVersion": "4.2" } ], "replicaSets": [ { "_id": "replSet1", "protocolVersion": "1", "members": [ { "_id": 0, "arbiterOnly": false, "hidden": true, "host": "replSet1_10", "priority": 0.0, "secondaryDelaySecs": 200, "votes": 0 }, { "_id": 1, "arbiterOnly": false, "hidden": false, "host": "replSet1_11", "priority": 1.0, "secondaryDelaySecs": 0, "votes": 1 }, { "_id": 2, "arbiterOnly": false, "hidden": false, "host": "replSet1_12", "priority": 1.0, "secondaryDelaySecs": 0, "votes": 1 }, { "_id": 3, "arbiterOnly": true, "hidden": false, "host": "replSet1_13", "priority": 0.0, "secondaryDelaySecs": 0, "votes": 1 } ] } ], "roles": [], "sharding": [], "indexConfigs": [ { "key": [ [ "field", "1" ] ], "rsName": "replSet1", "dbName": "db", "collectionName": "collection" } ]}