Retrieves all host assignments for one organization.
Required Roles
Your API Key must have the Global Owner role to successfully call this resource.
Request
Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
GET /usage/organizations/{orgId}/hostsRequest Path Parameters
Ops Manager requires all path parameters:
Path Parameter | Type | Description |
|---|---|---|
orgId | string | Unique identifier of the organization associated with the desired hosts. |
Request Query Parameters
Name | Type | Necessity | Description | Default |
|---|---|---|---|---|
pretty | boolean | Optional | Flag indicating whether the response body is in a prettyprint format. |
|
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:
|
|
Query Parameter | Type | Necessity | Description | Default |
|---|---|---|---|---|
startDate | string | Required | Date in ISO 8601 date format when the list of host assignments starts. | |
endDate | string | Required | Date in ISO 8601 date format when the list of host assignments ends. | |
pageNum | integer | Required | Starting group of host assignments to return. The group size is defined by itemsPerPage. This value starts with 1. | |
itemsPerPage | integer | Required | Number of host assignments to return in one group. |
|
Request Body Parameters
This endpoint doesn't use HTTP request body parameters.
Response
Response Element | Type | Description |
|---|---|---|
hosts | array of strings | List of virtual hosts bound to the provided physical host. |
hosts | string | Unique identifier of the project into which Ops Manager places this virtual host. |
hosts | string | FQDN of the virtual host bound to the physical host. |
processes | array of objects | MongoDB processes running on the virtual host. |
processes | object | Name of the cluster to which the MongoDB process belongs. |
processes | string | Name of the project to which the MongoDB process belongs. |
processes | string | Name of the organization to which the MongoDB process belongs. |
processes | string | Unique identifier of the project to which the MongoDB process belongs. |
processes | Boolean | Flag that indicates whether the node has a different server type than the other nodes. |
processes | string | Name of the node hosting the MongoDB process. |
processes | integer | Number representing the type of MongoDB process. |
serverType | object | Server Type of the physical host. To learn more, see MongoDB Usage Page. |
serverType.name | string | Ops Manager returns one of the following values:
|
serverType.label | string | Ops Manager returns one of the following values:
|
Example Request
curl --user "{publicApiKey}:{privateApiKey}" --digest \ --header "Accept: application/json" \ --include \ --request GET "https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0/usage/organizations/{orgId}/hosts?startDate=2020-07-23&endDate=2020-07-28&pageNum=1&itemsPerPage=100&pretty=true"Example Response
Response Header
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}Response Body
{ "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.ojrvazgboepawjci.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.ojrvazgboepawjci.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.ojrvazgboepawjci.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 }]}