For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/ja/api/latest/embeddable-graphs/create-embed.md. A documentation index is available at /llms.txt.
Language
Datadog site

埋め込みを作成する

POSThttps://api.datadoghq.com/api/v1/graph/embedhttps://api.us3.datadoghq.com/api/v1/graph/embedhttps://api.us5.datadoghq.com/api/v1/graph/embedhttps://api.datadoghq.eu/api/v1/graph/embedhttps://api.ap1.datadoghq.com/api/v1/graph/embedhttps://api.ap2.datadoghq.com/api/v1/graph/embedhttps://api.uk1.datadoghq.com/api/v1/graph/embedhttps://api.ddog-gov.com/api/v1/graph/embedhttps://api.us2.ddog-gov.com/api/v1/graph/embed

概要

埋め込み可能なグラフを新規作成します。

注: 特定の組織において、まったく同じクエリに対する埋め込みがすでに存在する場合、 新しい埋め込みは作成されず、古い埋め込みが返されます。

テンプレート変数を使用することに関心がある場合は、 テンプレート変数を使用した埋め込み可能なグラフ を参照してください。

This endpoint requires the embeddable_graphs_share permission.

リクエスト

Body Data (required)

埋め込み可能なグラフボディ

フィールド
タイプ
説明
graph_json [required]
string

埋め込み可能なグラフを新規作成するためのペイロード。

legend
enum

The flag determining if the graph includes a legend.

Default: no
Allowed enum values: yes, no
size
enum

The size of the graph.

Default: medium
Allowed enum values: small, medium, large, xlarge
timeframe
enum

The timeframe for the graph.

Default: 1_hour
Allowed enum values: 1_hour, 4_hours, 1_day, 2_days, 1_week
title
string

Determines graph title. Must be at least 1 character.

Default: Embed created through API

応答

Payload accepted

Embeddable graph.

フィールド
タイプ
説明
dash_name
string

Name of the dashboard the graph is on (null if none).

dash_url
string

URL of the dashboard the graph is on (null if none).

embed_id
string

ID of the embed.

graph_title
string

Title of the graph.

html
string

HTML fragment for the embed (iframe).

revoked
boolean

Boolean flag for whether or not the embed is revoked.

shared_by
int64

ID of the use who shared the embed.

コード例

埋め込みを作成する
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/graph/embed" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "graph_json": "{\"viz\":\"timeseries\",\"requests\":[{\"q\":\"avg:system.load.1{*}\",\"type\":\"line\"}]}",
  "legend": "yes",
  "size": "medium",
  "timeframe": "1_hour",
  "title": "System Load Average"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/graph/embed" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "graph_json": "{\"viz\":\"timeseries\",\"requests\":[{\"q\":\"avg:system.load.1{*}\",\"type\":\"line\"}]}",
  "legend": "yes",
  "size": "medium",
  "timeframe": "1_hour",
  "title": "System Load Average"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/graph/embed" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "graph_json": "{\"viz\":\"timeseries\",\"requests\":[{\"q\":\"avg:system.load.1{*}\",\"type\":\"line\"}]}",
  "legend": "yes",
  "size": "medium",
  "timeframe": "1_hour",
  "title": "System Load Average"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/graph/embed" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "graph_json": "{\"viz\":\"timeseries\",\"requests\":[{\"q\":\"avg:system.load.1{*}\",\"type\":\"line\"}]}",
  "legend": "yes",
  "size": "medium",
  "timeframe": "1_hour",
  "title": "System Load Average"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/graph/embed" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "graph_json": "{\"viz\":\"timeseries\",\"requests\":[{\"q\":\"avg:system.load.1{*}\",\"type\":\"line\"}]}",
  "legend": "yes",
  "size": "medium",
  "timeframe": "1_hour",
  "title": "System Load Average"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/graph/embed" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "graph_json": "{\"viz\":\"timeseries\",\"requests\":[{\"q\":\"avg:system.load.1{*}\",\"type\":\"line\"}]}",
  "legend": "yes",
  "size": "medium",
  "timeframe": "1_hour",
  "title": "System Load Average"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/graph/embed" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "graph_json": "{\"viz\":\"timeseries\",\"requests\":[{\"q\":\"avg:system.load.1{*}\",\"type\":\"line\"}]}",
  "legend": "yes",
  "size": "medium",
  "timeframe": "1_hour",
  "title": "System Load Average"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/graph/embed" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "graph_json": "{\"viz\":\"timeseries\",\"requests\":[{\"q\":\"avg:system.load.1{*}\",\"type\":\"line\"}]}",
  "legend": "yes",
  "size": "medium",
  "timeframe": "1_hour",
  "title": "System Load Average"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/graph/embed" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "graph_json": "{\"viz\":\"timeseries\",\"requests\":[{\"q\":\"avg:system.load.1{*}\",\"type\":\"line\"}]}",
  "legend": "yes",
  "size": "medium",
  "timeframe": "1_hour",
  "title": "System Load Average"
}
EOF