1개의 프로젝트에 대한 모든 호스트 할당을 검색합니다.
필수 역할
이 리소스 를 성공적으로 호출하려면 API 키에 Global Owner 역할 이 있어야 합니다.
요청
기본 URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
GET /usage/groups/{groupId}/hosts 
요청 경로 매개변수
Ops Manager에는 모든 경로 매개 변수가 필요합니다.
| 경로 매개 변수 | 유형 | 설명 | 
|---|---|---|
| groupId | 문자열 | 원하는 호스트와 연결된 프로젝트의 고유 식별자입니다. | 
요청 쿼리 매개변수
| 이름 | 유형 | 필요성 | 설명 | 기본값 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| pretty | 부울 | 옵션 | 응답 본문이 pretty-print 형식이어야 하는지 여부를 나타내는 플래그입니다. | 
 | ||||||
| envelope | 부울 | 옵션 | 응답을 엔벨로프에 래핑할지 여부를 나타내는 플래그입니다. 일부 API 클라이언트는 HTTP 응답 헤더 또는 상태 코드에 액세스할 수 없습니다. 이 문제를 해결하려면 쿼리에서 envelope=true를 설정합니다. 하나의 결과를 반환하는 엔드포인트의 경우 응답 본문에는 다음이 포함됩니다. 
 | 
 | 
| 쿼리 매개변수 | 유형 | 필요성 | 설명 | 기본값 | 
|---|---|---|---|---|
| startDate | 문자열 | 필수 사항 | 호스팅하다 할당 목록이 시작될 때 ISO 8601 날짜 형식의 날짜입니다. | |
| endDate | 문자열 | 필수 사항 | 호스팅하다 할당 목록이 종료될 때 ISO 8601 날짜 형식의 날짜입니다. | |
| pageNum | integer | 필수 사항 | 반환할 호스트 할당 그룹의 시작. 그룹 크기는 itemsPerPage 에서 정의됩니다. 이 값은 1로 시작합니다. | |
| itemsPerPage | integer | 필수 사항 | 한 그룹에서 반환할 호스트 할당량의 수입니다. | 
 | 
요청 본문 매개변수
이 엔드포인트는 HTTP 요청 본문 매개변수를 사용하지 않습니다.
응답
| 응답 요소 | 유형 | 설명 | 
|---|---|---|
| 호스트 | 문자열 배열 | 제공된 물리적 호스트에 바인딩된 가상 호스트의 목록입니다. | 
| hosts .groupId | 문자열 | Ops Manager가 이 가상 호스트를 배치하는 프로젝트의 고유 식별자입니다. | 
| hosts .hostname | 문자열 | 물리적 호스트에 바인딩된 가상 호스트의 FQDN 입니다. | 
| 프로세스 | 객체 배열 | 가상 호스트에서 실행 중인 MongoDB 프로세스. | 
| processes .[n].cluster | 객체 | MongoDB 프로세스가 속한 cluster의 이름입니다. | 
| processes .[n].groupName | 문자열 | MongoDB 프로세스가 속한 프로젝트의 이름입니다. | 
| processes .[n].orgName | 문자열 | MongoDB 프로세스가 속한 조직의 이름입니다. | 
| processes .[n].groupId | 문자열 | MongoDB 프로세스가 속한 프로젝트의 고유 식별자입니다. | 
| processes .[n].hasConflictingServerType | 부울 | 노드가 다른 노드와 다른 서버 유형을 가지고 있는지 여부를 나타내는 플래그입니다. | 
| processes .[n].name | 문자열 | MongoDB 프로세스를 호스팅하는 노드의 이름입니다. | 
| processes .[n].processType | integer | MongoDB 프로세스 유형을 나타내는 숫자입니다. | 
| serverType | 객체 | 물리적 호스트의 서버 유형입니다. 학습 내용은 MongoDB 사용법을 참조하세요. | 
| serverType.name | 문자열 | Ops Manager는 다음 값 중 하나를 반환합니다. 
 | 
| serverType.label | 문자열 | Ops Manager는 다음 값 중 하나를 반환합니다. 
 | 
요청 예시
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" 
응답 예시
응답 헤더
 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 
 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} 
응답 본문
1    { 2      "links": [{ 3        "rel": "self", 4        "href": "http://usage.example.com/api/public/v1.0/usage/assignments?startDate=2020-07-23&endDate=2020-07-28&pageNum=1&itemsPerPage=100" 5      }], 6      "totalCount": 3, 7      "results": [{ 8        "hostname": "virtual.host.lqhfcxlgzqtimcxf.internal.mongodb-0", 9        "processes": [{ 10          "cluster": "sdivabux", 11          "groupName": "{projectName}", 12          "orgName": "{orgName}", 13          "groupId": "{groupId}", 14          "hasConflictingServerType": true, 15          "name": "replicaPrimary-0-proc0-run51839", 16          "processType": 7 17        }, 18        { 19          "cluster": "sdivabux", 20          "groupName": "{projectName}", 21          "orgName": "{orgName}", 22          "groupId": "{groupId}", 23          "hasConflictingServerType": true, 24          "name": "replicaPrimary-0-proc1-run51839", 25          "processType": 7 26        } 27      ], 28        "serverType": { 29          "name": "PRODUCTION_SERVER", 30          "label": "Production Server" 31        }, 32        "isChargeable": true, 33        "memSizeMB": 178 34      }, 35      { 36        "hostname": "virtual.host.lqhfcxlgzqtimcxf.internal.mongodb-1", 37        "processes": [{ 38          "cluster": "sdivabux", 39          "groupName": "{projectName}", 40          "orgName": "{orgName}", 41          "groupId": "{groupId}", 42          "hasConflictingServerType": true, 43          "name": "replicaSecondary-0-proc0-run51839", 44          "processType": 8 45        }, 46        { 47          "cluster": "sdivabux", 48          "groupName": "{projectName}", 49          "orgName": "{orgName}", 50          "groupId": "{groupId}", 51          "hasConflictingServerType": true, 52          "name": "replicaSecondary-0-proc1-run51839", 53          "processType": 8 54        } 55      ], 56        "serverType": { 57          "name": "PRODUCTION_SERVER", 58          "label": "Production Server" 59        }, 60        "isChargeable": true, 61        "memSizeMB": 178 62      }, 63      { 64        "hostname": "virtual.host.lqhfcxlgzqtimcxf.internal.mongodb-2", 65        "processes": [{ 66          "cluster": "sdivabux", 67          "groupName": "{projectName}", 68          "orgName": "{orgName}", 69          "groupId": "{groupId}", 70          "hasConflictingServerType": true, 71          "name": "replicaSecondary-0-proc1-run51839", 72          "processType": 8 73        }, 74        { 75          "cluster": "sdivabux", 76          "groupName": "{projectName}", 77          "orgName": "{orgName}", 78          "groupId": "{groupId}", 79          "hasConflictingServerType": true, 80          "name": "replicaSecondary-0-proc0-run51839", 81          "processType": 8 82        } 83      ], 84        "serverType": { 85          "name": "RAM_POOL", 86          "label": "RAM Pool" 87        }, 88        "isChargeable": true, 89        "memSizeMB": 178 90      } 91    ] 92    }