ダッシュボード注釈API
GitLab 12.10で機能フラグを無効にして導入されました。
メトリクスダッシュボードのアノテーションは、グラフ上のイベントを1つの時点、または時間スパンで示すことができます。
新しいアノテーションの作成
POST /environments/:id/metrics_dashboard/annotations/
POST /clusters/:id/metrics_dashboard/annotations/
パラメータを指定します:
| 属性 | 種類 | 必須 | 説明 | 
|---|---|---|---|
| dashboard_path | 文字列です。 | yes | アノテーションが必要なダッシュボードのID。CGIでエスケープされたパスとして扱われ、自動的にエスケープが解除されます。 | 
| starting_at | 文字列です。 | yes | 日付時刻文字列。ISO 8601 形式。 2016-03-11T03:45:40Zなど。注釈の開始点を示すタイムスタンプ。 | 
| ending_at | 文字列です。 | いいえ | 日付時刻文字列、ISO 8601 形式、 2016-03-11T03:45:40Zのような。注釈の終了点を示すタイムスタンプ。こ れを与え ない と 、 注釈は開始点の 1 個の イ ベン ト と し て表示 さ れます。 | 
| description | 文字列です。 | yes | 注釈の説明 | 
curl --header "Private-Token: <your_access_token>" "https://gitlab.example.com/api/v4/environments/1/metrics_dashboard/annotations" \
 --data-urlencode "dashboard_path=.gitlab/dashboards/custom_metrics.yml" \
 --data-urlencode "starting_at=2016-03-11T03:45:40Z" \
 --data-urlencode "description=annotation description"
レスポンスの例
{
  "id": 4,
  "starting_at": "2016-04-08T03:45:40.000Z",
  "ending_at": null,
  "dashboard_path": ".gitlab/dashboards/custom_metrics.yml",
  "description": "annotation description",
  "environment_id": 1,
  "cluster_id": null
}
