Create embed

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

概要

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

注: ある組織内の同じクエリに対して既に埋め込みが存在する場合、 埋め込みは新規作成されず、古い埋め込みデータが返されます。

テンプレート変数の使用を検討されている場合は、 テンプレート変数で埋め込み可能なグラフを参照してください。

This endpoint requires the embeddable_graphs_share permission.

リクエスト

Body Data (required)

埋め込み可能なグラフ本文

Expand All

フィールド

種類

説明

graph_json [required]

string

The graph definition in JSON.

Same format that is available on the JSON tab of the graph editor.

legend

enum

The flag determining if the graph includes a legend. Allowed enum values: yes,no

default: no

size

enum

The size of the graph. Allowed enum values: small,medium,large,xlarge

default: medium

timeframe

enum

The timeframe for the graph. Allowed enum values: 1_hour,4_hours,1_day,2_days,1_week

default: 1_hour

title

string

Determines graph title. Must be at least 1 character.

default: Embed created through API

{
  "graph_json": "",
  "legend": "string",
  "size": "string",
  "timeframe": "string",
  "title": "string"
}

応答

Payload accepted

Embeddable graph.

Expand All

フィールド

種類

説明

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.

{
  "dash_name": "string",
  "dash_url": "string",
  "embed_id": "string",
  "graph_title": "string",
  "html": "string",
  "revoked": false,
  "shared_by": "integer"
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication Error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例

                  ## default
# 

# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.uk1.datadoghq.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/graph/embed" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -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