AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。

1 つのプロジェクトでのすべてのホスト割り当てを一覧表示

1 つのプロジェクトのすべてのホスト割り当てを取得します。

このリソースを正常に呼び出すには、API キーにGlobal Ownerロールが必要です。

ベース URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0

GET /usage/groups/{groupId}/hosts

MongoDB Ops Manager にはすべてのパス パラメータが必要です。

Path Parameter
タイプ
説明

グループ ID

string

目的のホストに関連付けられたプロジェクトの一意の識別子。

名前
タイプ
必要性
説明
default

pretty

ブール値

任意

レスポンス本体をpretty-print形式にするかどうかを示すフラグ。

false

envelope

ブール値

任意

応答をエンベロープでラップするかどうかを示すフラグ。

一部の API クライアントは、HTTP レスポンス ヘッダーまたはステータス コードにアクセスできません。これを修正するには、クエリで envelope=true を設定します。

1 つの結果を返すエンドポイントの場合、レスポンス本体には次のものが含まれます。

  • status: HTTPレスポンス コード

  • content: 期待される応答本体

false

クエリ パラメータ
タイプ
必要性
説明
default

startDate

string

必須

endDate

string

必須

pageNum

integer

必須

返すホストする割り当ての開始グループ。グループ サイズは、itemsPerPage によって定義されます。この値は 1 から始まります。

itemsPerPage

integer

必須

1 つのグループで返すホスト割り当ての数。

100

このエンドポイントは、HTTP リクエスト本体パラメータを使用しません。

応答要素
タイプ
説明

ホスト

文字列の配列

提供された物理ホストにバインドされた仮想ホストのリスト。

ホスト
.groupId

string

MongoDB Ops Managerがこの仮想ホストを配置するプロジェクトの一意の識別子。

hosts
.hostname

string

物理ホストにバインドされた仮想ホストのFQDN 。

プロセス

オブジェクトの配列

仮想ホスト上で実行されている MongoDB プロセス。

processes
.[n].クラスター

オブジェクト

MongoDB プロセスが属するクラスターの名前。

プロセス
.[n].groupName

string

MongoDB プロセスが属するプロジェクトの名前。

processes
.[n].orgName

string

MongoDB プロセスが属する組織の名前。

プロセス
.[n].groupId

string

MongoDB プロセスが属するプロジェクトの一意の識別子です。

プロセス
.[n].hasConflictingServerType

ブール値

ノードのサーバータイプが他のノードと異なるかどうかを示すフラグ。

processes
.[n].name

string

MongoDB プロセスをホストしているノードの名前。

processes
.[n].processType

integer

MongoDB プロセスのタイプを表す数値。

serverType

オブジェクト

物理ホストのサーバータイプ。

詳細については、「 MongoDB の使用状況 」ページを参照してください。

serverType.name

string

MongoDB Ops Manager は、次のいずれかの値を返します。

  • DEV_SERVER

  • TEST_SERVER

  • PRODUCTION_SERVER

  • RAM_POOL

serverType. labels

string

MongoDB Ops Manager は、次のいずれかの値を返します。

  • Dev Server

  • Test Server

  • Production Server

  • Ram Pool

curl --user "{publicApiKey}:{privateApiKey}" --digest \ --header "Accept: application/json" \ --include \ --request GET "https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0/usage/groups/{groupId}/hosts?startDate=2020-07-23&endDate=2020-07-28&pageNum=1&itemsPerPage=100&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}
{ "links": [{ "rel": "self", "href": "http://usage.example.com/api/public/v1.0/usage/assignments?startDate=2020-07-23&endDate=2020-07-28&pageNum=1&itemsPerPage=100" }], "totalCount": 3, "results": [{ "hostname": "virtual.host.lqhfcxlgzqtimcxf.internal.mongodb-0", "processes": [{ "cluster": "sdivabux", "groupName": "{projectName}", "orgName": "{orgName}", "groupId": "{groupId}", "hasConflictingServerType": true, "name": "replicaPrimary-0-proc0-run51839", "processType": 7 }, { "cluster": "sdivabux", "groupName": "{projectName}", "orgName": "{orgName}", "groupId": "{groupId}", "hasConflictingServerType": true, "name": "replicaPrimary-0-proc1-run51839", "processType": 7 } ], "serverType": { "name": "PRODUCTION_SERVER", "label": "Production Server" }, "isChargeable": true, "memSizeMB": 178 }, { "hostname": "virtual.host.lqhfcxlgzqtimcxf.internal.mongodb-1", "processes": [{ "cluster": "sdivabux", "groupName": "{projectName}", "orgName": "{orgName}", "groupId": "{groupId}", "hasConflictingServerType": true, "name": "replicaSecondary-0-proc0-run51839", "processType": 8 }, { "cluster": "sdivabux", "groupName": "{projectName}", "orgName": "{orgName}", "groupId": "{groupId}", "hasConflictingServerType": true, "name": "replicaSecondary-0-proc1-run51839", "processType": 8 } ], "serverType": { "name": "PRODUCTION_SERVER", "label": "Production Server" }, "isChargeable": true, "memSizeMB": 178 }, { "hostname": "virtual.host.lqhfcxlgzqtimcxf.internal.mongodb-2", "processes": [{ "cluster": "sdivabux", "groupName": "{projectName}", "orgName": "{orgName}", "groupId": "{groupId}", "hasConflictingServerType": true, "name": "replicaSecondary-0-proc1-run51839", "processType": 8 }, { "cluster": "sdivabux", "groupName": "{projectName}", "orgName": "{orgName}", "groupId": "{groupId}", "hasConflictingServerType": true, "name": "replicaSecondary-0-proc0-run51839", "processType": 8 } ], "serverType": { "name": "RAM_POOL", "label": "RAM Pool" }, "isChargeable": true, "memSizeMB": 178 } ] }