API 経由で Reporting Database にアクセスします
Cloud Insights の強力な API を使用すると、 Cognos Reporting 環境を介さずに、 Cloud Insights Reporting データベースを直接照会できます。
このドキュメントでは、で使用できる Cloud Insights レポート機能について説明します "Premium Edition の場合"。 |
OData
Cloud Insights レポート API は、に従います "OData v4 の" ( Open Data Protocol )レポートデータベースの照会の標準。
詳細や詳細については、をご覧ください "このチュートリアルでは" OData の場合。
すべての要求はURL _\ https://<Cloud Insights URL>/rest /v1/dwh-management/odata_で始まります
apiKey を生成します
詳細については、をご覧ください "Cloud Insights APIs の略"。
API キーを生成するには、次の手順を実行します。
-
Cloud Insights 環境にログインし、 * Admin > API Access * を選択します。
-
[+API Access Token] をクリックします。
-
名前と概要を入力します。
-
タイプには、 Data Warehouse _ を選択します。
-
権限を読み取り / 書き込みに設定します。
-
要望の有効期限を設定します。
-
[ 保存 ] をクリックし、 * キーをコピーして安全な場所に保存します。あとでフルキーにアクセスすることはできません。
APIKeys は、 _Sync_or_Async に適しています。
テーブルの直接クエリ
API キーを配置した状態で、 Reporting データベースの直接クエリを実行できるようになりました。長いURLは\https://<Cloud Insights URL>/rest /v1/dwh-management/odata/ではなく\https://…/odata/に簡略化して表示することもできます
次のような簡単なクエリを試してください
-
\https://<Cloud Insights URL>/rest /v1/dwh-management/odata/dwh_custom
-
\https://<Cloud Insights URL>/rest /v1/dwh-management/odata/dwh_inventory
-
\https://<Cloud Insights URL>/rest /v1/dwh-management/odata/dwh_inventory/storage
-
\https://<Cloud Insights URL>/rest /v1/dwh-management/odata/dwh_inventory/disk
-
https://…/odata/dwh_custom/custom_queries
REST API の例
すべての呼び出しのURLは、_\ https://<Cloud Insights URL>/rest /v1/dwh-management/odata_です。
-
get/{schema}/**-レポートデータベースからデータを取得します。
形式は、_\https://<Cloud Insights URL>/rest <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" } ] }
役に立つヒント
Reporting API クエリを使用する場合は、次の点に注意してください。
-
クエリペイロードには有効な JSON 文字列を指定する必要があります
-
クエリペイロードは 1 行に含める必要があります
-
二重引用符はエスケープする必要があります。
-
タブは \t としてサポートされています
-
コメントは避けてください
-
小文字のテーブル名がサポートされています
さらに、
-
2 つのヘッダーが必要です。
-
「 X-CloudInsights - apiKey 」という名前を付けます。
-
属性値「 <apiKey> 」
-
API キーは Cloud Insights 環境に固有です。