コンテンツにスキップ

メジャーメントスキーマ情報の取得



GET /api/v1/metric_info/measurement/schema

概要

メジャーメント名に基づいて、そのスキーマ情報(fields および tags 情報を含む)を取得します。

Query リクエストパラメータ

パラメータ名 必須 説明
measurement string Y メジャーメント名
空の場合は許可されません: False

パラメータ補足説明

メジャーメントのスキーマ情報(フィールドリスト、フィールドタイプ、単位、説明など)を取得します。

  • 本APIは常に完全な fields を返します。
  • field.tagsget_metric_field_tags_info() を介して取得し、そのキャッシュ機能を再利用します。
  • クエリの時間範囲は、ワークスペースタイムゾーンの当日 0 時から 24 時までに統一され、キャッシュのヒット率を向上させます。
  • そのため、本APIは常に完全な fields を返し、field.tags は現在のクエリ結果またはキャッシュ結果から直接取得されます。

リクエスト例

curl -k 'https://openapi.guance.com/api/v1/metric_info/measurement/schema?measurement=cpu' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--compressed

レスポンス

{
    "code": 200,
    "content": {
        "declaration": {
            "business": "",
            "organization": "663dbba102482200070bbb02"
        },
        "fields": [
            {
                "description": "",
                "name": "load5s",
                "tags": [
                    {
                        "description": "",
                        "name": "region"
                    },
                    {
                        "description": "",
                        "name": "cpu"
                    },
                    {
                        "description": "",
                        "name": "host"
                    },
                    {
                        "description": "",
                        "name": "zone_id"
                    }
                ],
                "type": "gauge",
                "unit": "",
                "value_type": "float"
            },
            {
                "description": "",
                "name": "usage_guest",
                "tags": [
                    {
                        "description": "",
                        "name": "region"
                    },
                    {
                        "description": "",
                        "name": "cpu"
                    },
                    {
                        "description": "",
                        "name": "host"
                    },
                    {
                        "description": "",
                        "name": "zone_id"
                    }
                ],
                "type": "gauge",
                "unit": "",
                "value_type": "float"
            }
        ],
        "measurement": "cpu"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "69ba6c7800000000d2108e22fe3fb1dc"
} 

フィードバック

このページは役に立ちましたか?