Skip to main content
Data Infrastructure Insights
본 한국어 번역은 사용자 편의를 위해 제공되는 기계 번역입니다. 영어 버전과 한국어 버전이 서로 어긋나는 경우에는 언제나 영어 버전이 우선합니다.

API를 통해 보고 데이터베이스에 액세스합니다

기여자 netapp-alavoie

Data Infrastructure Insights의 강력한 API를 사용하면 Cognos 보고 환경을 거치지 않고도 Data Infrastructure Insights 보고 데이터베이스를 직접 쿼리할 수 있습니다.

참고 이 문서에서는 Data Infrastructure Insights Premium Edition에서 사용할 수 있는 Data Infrastructure Insights 보고 기능에 대해 설명합니다.

OData입니다

Data Infrastructure Insights Reporting API는 "OData v4"보고 데이터베이스 쿼리에 대한 (Open Data Protocol) 표준을 따릅니다. 자세한 내용 또는 자세한 내용은 OData 를 "이 자습서"참조하십시오.

모든 요청은 URL_\https://<Data 인프라 인사이트 URL >/REST/v1/dwh-management/odData_로 시작합니다

APIKey를 생성하는 중입니다

에 대해 자세히 "Data Infrastructure Insights API를 참조하십시오"알아보세요.

API 키를 생성하려면 다음을 수행합니다.

  • Data Infrastructure Insights 환경에 로그인하고 * Admin > API Access * 를 선택합니다.

  • “+API 액세스 토큰”을 클릭합니다.

  • 이름 및 설명을 입력합니다.

  • 유형으로 _ 데이터 웨어하우스 _ 를 선택합니다.

  • 권한을 읽기/쓰기로 설정합니다.

  • 욕망 만료 날짜를 설정합니다.

  • "저장"을 클릭한 다음 * 키를 복사하여 안전한 곳에 저장합니다 *. 나중에 전체 키에 액세스할 수 없습니다.

APIkeys는 에 Sync 또는 Async적합합니다.

테이블 직접 쿼리

API 키가 있으면 이제 보고 데이터베이스의 직접 쿼리를 수행할 수 있습니다. 전체 https://<Data 인프라 인사이트 URL>/REST/v1/dwh-management/OData가 아니라 표시 목적으로 https://…​/odata/으로 URL을 단순화할 수 있습니다

과 같은 간단한 쿼리를 사용해 보세요

  • https://<Data 인프라 인사이트 URL>/rest/v1/dwh-management/odata/dwh_custom

  • https://<Data 인프라 인사이트 URL>/rest/v1/dwh-management/odata/dwh_inventory 를 입력합니다

  • https://<Data 인프라 인사이트 URL>/rest/v1/dwh-management/odata/dwh_inventory/storage

  • https://<Data 인프라 인사이트 URL>/rest/v1/dwh-management/odata/dwh_inventory/disk

  • https://…​/odata/dwh_custom/custom_queries

REST API 예제

모든 호출의 URL은 _\https://<Data 인프라 인사이트 URL>/REST/v1/dwh-management/odata_입니다.

  • Get/{schema}/** - 보고 데이터베이스에서 데이터를 검색합니다.

형식:_\https://<Data 인프라 인사이트 URL>/REST/v1/dwh-management/OData/<schema_name>/<query>_

예:

 https://<domain>/rest/v1/dwh-management/odata/dwh_inventory/fabric?$count=true&$orderby=name
결과:
{
   "@odata.context": "$metadata#fabric",
   "@odata.count": 2,
   "value": [
       {
           "id": 851,
           "identifier": "10:00:50:EB:1A:40:3B:44",
           "wwn": "10:00:50:EB:1A:40:3B:44",
           "name": "10:00:50:EB:1A:40:3B:44",
           "vsanEnabled": "0",
           "vsanId": null,
           "zoningEnabled": "0",
           "url": "https://<domain>/web/#/assets/fabrics/941716"
       },
       {
           "id": 852,
           "identifier": "10:00:50:EB:1A:40:44:0C",
           "wwn": "10:00:50:EB:1A:40:44:0C",
           "name": "10:00:50:EB:1A:40:44:0C",
           "vsanEnabled": "0",
           "vsanId": null,
           "zoningEnabled": "0",
           "url": "https://<domain>/web/#/assets/fabrics/941836"
        }
    ]
}

유용한 힌트

보고 API 쿼리 작업 시 다음 사항을 염두에 두십시오.

  • 쿼리 페이로드는 올바른 JSON 문자열이어야 합니다

  • 쿼리 페이로드는 한 줄에 포함되어야 합니다

  • 큰따옴표는 이스케이프되어야 합니다. 즉, \"

  • 탭은 \t로 지원됩니다

  • 의견을 피합니다

  • 소문자 테이블 이름이 지원됩니다

추가 사항:

  • 헤더 2개 필요:

    • 이름 "X-CloudInsights - ApiKey"

    • 속성 값 "<apikey>"

API 키는 Data Infrastructure Insights 환경과 관련이 있습니다.

동기식 또는 비동기식?

기본적으로 API 명령은 _synchronous_mode에서 작동하므로 요청을 보내고 응답이 즉시 반환됩니다. 그러나 쿼리를 실행하는 데 시간이 오래 걸릴 수 있으므로 요청 시간이 초과될 수 있습니다. 이 문제를 해결하려면 요청을 비동기적으로 _ 실행할 수 있습니다. 비동기 모드에서 요청은 실행을 모니터링할 수 있는 URL을 반환합니다. URL이 준비되면 결과가 반환됩니다.

비동기 모드에서 쿼리를 실행하려면 요청에 헤더를 추가합니다 Prefer: respond-async. 성공적으로 실행되면 응답에 다음 헤더가 포함됩니다.

Status Code: 202 (which means ACCEPTED)
preference-applied: respond-async
location: https://<Data Infrastructure Insights URL>/rest/v1/dwh-management/odata/dwh_custom/asyncStatus/<token>

위치 URL을 쿼리하면 응답이 아직 준비되지 않은 경우 동일한 헤더가 반환되고 응답이 준비되면 상태 200으로 반환됩니다. 응답 내용은 텍스트 형식이며 원본 쿼리의 http 상태와 일부 메타데이터를 포함하고 그 다음에 원본 쿼리의 결과가 나옵니다.

HTTP/1.1 200 OK
 OData-Version: 4.0
 Content-Type: application/json;odata.metadata=minimal
 oDataResponseSizeCounted: true

 { <JSON_RESPONSE> }

모든 비동기 쿼리 목록과 준비된 쿼리를 보려면 다음 명령을 사용합니다.

 GET https://<Data Infrastructure Insights URL>/rest/v1/dwh-management/odata/dwh_custom/asyncList
응답의 형식은 다음과 같습니다.
{
   "queries" : [
       {
           "Query": "https://<Data Infrastructure Insights URL>/rest/v1/dwh-management/odata/dwh_custom/heavy_left_join3?$count=true",
           "Location": "https://<Data Infrastructure Insights URL>/rest/v1/dwh-management/odata/dwh_custom/asyncStatus/<token>",
           "Finished": false
       }
   ]
}