Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of MongoDB Ops Manager, refer to the upgrade documentation.
You were redirected from a different version of the documentation. Click here to go back.

List All Host Assignments

Retrieves all host assignments.

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/assignments

Request Path Parameters

This endpoint does not use HTTP request path parameters.

Request Query Parameters

Name Type Necessity Description Default
pretty boolean Optional Flag indicating whether the response body should be in a prettyprint format. 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
envelope Expected response body
false
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. Group size gets defined in itemsPerPage. This value starts with 1.  
itemsPerPage integer Required Number of host assignments to return in one group. 100

Request Body Parameters

This endpoint does not 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
.groupId
string Unique identifier of the project into which Ops Manager places this virtual host.
hosts
.hostname
string FQDN of the virtual host bound to the physical host.
processes array of objects MongoDB processes running on the virtual host.
processes
.[n].cluster
object Name of the cluster to which the MongoDB process belongs.
processes
.[n].groupName
string Name of the project to which the MongoDB process belongs.
processes
.[n].orgName
string Name of the organization to which the MongoDB process belongs.
processes
.[n].groupId
string Unique identifier of the project to which the MongoDB process belongs.
processes
.[n].hasConflictingServerType
Boolean Flag that indicates whether the node has a different server type than the other nodes.
processes
.[n].name
string Name of the node hosting the MongoDB process.
processes
.[n].processType
integer Number representing the type of MongoDB process.
serverType object

Server Type of the physical host.

See also

MongoDB Usage

serverType.name string

Ops Manager returns one of the following values:

  • DEV_SERVER
  • TEST_SERVER
  • PRODUCTION_SERVER
  • RAM_POOL
serverType.label string

Ops Manager returns one of the following values:

  • Dev Server
  • Test Server
  • Production Server
  • Ram Pool

Example Request

curl --user "{publicApiKey}:{privateApiKey}" --digest \
     --header 'Accept: application/json' \
     --include \
     --request GET 'https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0/usage/assignments?startDate=2020-07-23&endDate=2020-07-28&pageNum=1&itemsPerPage=100&pretty=true'

Example Response

Response Header

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}

Response Body

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
   {
     "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
     }
   ]
   }