스키마 조언 받기
- Cloud Manager 에 대한 프로그래밍 방식의 액세스 를 위한 OAuth 2.0 인증 은 Preview 기능 으로 제공됩니다.
- 기능 및 해당 설명서는 미리 보기 기간에 언제든지 변경될 수 있습니다. OAuth 2.0 인증 을 사용하려면 Cloud Manager 공개 API 에 대한 요청에 사용할서비스 계정을 만듭니다.
가장 활동적인 20 컬렉션을 분석하여 클러스터 에 대한 스키마 개선 권장 사항을 제공합니다.
기본 URL: https://cloud.mongodb.com/api/public/v1.0
Resource
GET /groups/{PROJECT-ID}/performanceAdvisor/schemaAdvice
요청 경로 매개변수
Parameter | 유형 | 설명 |
---|---|---|
프로젝트 ID | 문자열 | (필수 사항) 이 MongoDB deployment 소유한 프로젝트 의 고유 식별자입니다. 그룹과 프로젝트는 동의어입니다. 그룹 ID 프로젝트 ID 와 동일합니다. |
요청 쿼리 매개변수
clusterId
또는 hostId
중 하나가 필요합니다.
요청 본문 매개변수
이 엔드포인트는 HTTP 요청 본문 매개변수를 사용하지 않습니다.
응답
이름 | 유형 | 설명 |
---|---|---|
| 객체 목록 | 네임스페이스 별 스키마 개선을 위한 제안 조치가 포함되어 있습니다. |
| 객체 | Performance Advisor 스키마 개선 제안이 있는 네임스페이스. |
| 배열 | 네임스페이스 목록 및 해당 네임스페이스가 권장 사항을 트리거한 이유에 대한 정보입니다. |
| 문자열 | 영향을 받는 컬렉션 의 네임스페이스입니다. 이는 |
| 객체 | 권장 사항을 활성화한 트리거하다 에 대한 세부 정보입니다. |
| 문자열 | 트리거하다 유형에 대한 설명입니다. |
| 문자열 | 트리거하다 유형입니다. 옵션에는 다음이 포함됩니다.
|
| 문자열 | 지정된 권장 사항에 대한 설명입니다. |
| 문자열 | 추천 유형입니다. 옵션에는 다음이 포함됩니다.
|
요청 예시
curl --user '{PUBLIC-KEY}:{PRIVATE-KEY}' --digest \ --header 'Accept: application/json' \ --include \ --request GET 'https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/performanceAdvisor/schemaAdvice?clusterId={clusterId}&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}
응답 본문
{ "content" : { "recommendations" : [ { "affectedNamespaces" : [ { "namespace" : "someDb.someCollection", "triggers" : [ { "description" : "Documents larger than 2 MB found in the collection(s) scanned", "triggerType" : "DOC_SIZE_TOO_LARGE" } ] }, { "namespace" : "someDb1.someCollection1", "triggers" : [ { "description" : "Documents larger than 2 MB found in the collection(s) scanned", "triggerType" : "DOC_SIZE_TOO_LARGE" } ] } ], "description" : "Reduce the size of documents", "recommendation" : "REDUCE_DOCUMENT_SIZE" }, { "affectedNamespaces" : [ { "namespace" : "someDb2.someCollection2", "triggers" : [ { "description" : "More than 30 indexes detected in the collection(s) scanned", "triggerType" : "NUM_INDEXES" } ] }, { "namespace" : "someDb3.someCollection3", "triggers" : [ { "description" : "More than 30 indexes detected in the collection(s) scanned", "triggerType" : "NUM_INDEXES" } ] } ], "description" : "Remove unnecessary indexes", "recommendation" : "REMOVE_UNNECESSARY_INDEXES" }, { "affectedNamespaces" : [ { "namespace" : "someDb4.someCollection4", "triggers" : [ { "description" : "Arrays with over 10000 entries detected in the collection(s) scanned", "triggerType" : "DOCS_CONTAIN_UNBOUNDED_ARRAY" } ] } ], "description" : "Avoid using unbounded arrays in documents", "recommendation" : "AVOID_UNBOUNDED_ARRAY" } ] }, "status" : 200 }