For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/ko/api/latest/reporting-and-sharing/create-a-graph-snapshot.md. A documentation index is available at /llms.txt.
Language
Datadog site

그래프 스냅샷 만들기

경고Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
POSThttps://api.datadoghq.com/api/v2/snapshothttps://api.us3.datadoghq.com/api/v2/snapshothttps://api.us5.datadoghq.com/api/v2/snapshothttps://api.datadoghq.eu/api/v2/snapshothttps://api.ap1.datadoghq.com/api/v2/snapshothttps://api.ap2.datadoghq.com/api/v2/snapshothttps://api.uk1.datadoghq.com/api/v2/snapshothttps://api.ddog-gov.com/api/v2/snapshothttps://api.us2.ddog-gov.com/api/v2/snapshot

개요

그래프 위젯의 스냅샷을 생성합니다. 스냅샷은 비동기식으로 렌더링되며 반환된 URL을 폴링하여 이미지가 준비되었는지 확인할 수 있습니다.

요청

Body Data (required)

항목
유형
설명
data [required]
object

그래프 스냅샷 생성을 위한 요청 본문입니다.

응답

OK

Response body for a snapshot creation request.

항목
유형
설명
data [required]
object

Data envelope for the snapshot creation response.

코드 예시

그래프 스냅샷 만들기
# 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/v2/snapshot" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "additional_config": {
        "template_variables": [
          {
            "name": "host",
            "prefix": "host",
            "values": [
              "web-server-1",
              "web-server-2"
            ]
          }
        ],
        "timeseries_legend_type": "expanded",
        "timezone_offset_minutes": 300
      },
      "end": 1692464800000,
      "height": 185,
      "is_authenticated": false,
      "start": 1692464000000,
      "ttl": "60d",
      "widget_definition": {
        "requests": [
          {
            "q": "avg:system.cpu.user{*}"
          }
        ],
        "type": "timeseries"
      },
      "width": 300
    },
    "type": "create_snapshot"
  }
}
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/v2/snapshot" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "additional_config": {
        "template_variables": [
          {
            "name": "host",
            "prefix": "host",
            "values": [
              "web-server-1",
              "web-server-2"
            ]
          }
        ],
        "timeseries_legend_type": "expanded",
        "timezone_offset_minutes": 300
      },
      "end": 1692464800000,
      "height": 185,
      "is_authenticated": false,
      "start": 1692464000000,
      "ttl": "60d",
      "widget_definition": {
        "requests": [
          {
            "q": "avg:system.cpu.user{*}"
          }
        ],
        "type": "timeseries"
      },
      "width": 300
    },
    "type": "create_snapshot"
  }
}
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/v2/snapshot" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "additional_config": {
        "template_variables": [
          {
            "name": "host",
            "prefix": "host",
            "values": [
              "web-server-1",
              "web-server-2"
            ]
          }
        ],
        "timeseries_legend_type": "expanded",
        "timezone_offset_minutes": 300
      },
      "end": 1692464800000,
      "height": 185,
      "is_authenticated": false,
      "start": 1692464000000,
      "ttl": "60d",
      "widget_definition": {
        "requests": [
          {
            "q": "avg:system.cpu.user{*}"
          }
        ],
        "type": "timeseries"
      },
      "width": 300
    },
    "type": "create_snapshot"
  }
}
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/v2/snapshot" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "additional_config": {
        "template_variables": [
          {
            "name": "host",
            "prefix": "host",
            "values": [
              "web-server-1",
              "web-server-2"
            ]
          }
        ],
        "timeseries_legend_type": "expanded",
        "timezone_offset_minutes": 300
      },
      "end": 1692464800000,
      "height": 185,
      "is_authenticated": false,
      "start": 1692464000000,
      "ttl": "60d",
      "widget_definition": {
        "requests": [
          {
            "q": "avg:system.cpu.user{*}"
          }
        ],
        "type": "timeseries"
      },
      "width": 300
    },
    "type": "create_snapshot"
  }
}
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/v2/snapshot" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "additional_config": {
        "template_variables": [
          {
            "name": "host",
            "prefix": "host",
            "values": [
              "web-server-1",
              "web-server-2"
            ]
          }
        ],
        "timeseries_legend_type": "expanded",
        "timezone_offset_minutes": 300
      },
      "end": 1692464800000,
      "height": 185,
      "is_authenticated": false,
      "start": 1692464000000,
      "ttl": "60d",
      "widget_definition": {
        "requests": [
          {
            "q": "avg:system.cpu.user{*}"
          }
        ],
        "type": "timeseries"
      },
      "width": 300
    },
    "type": "create_snapshot"
  }
}
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/v2/snapshot" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "additional_config": {
        "template_variables": [
          {
            "name": "host",
            "prefix": "host",
            "values": [
              "web-server-1",
              "web-server-2"
            ]
          }
        ],
        "timeseries_legend_type": "expanded",
        "timezone_offset_minutes": 300
      },
      "end": 1692464800000,
      "height": 185,
      "is_authenticated": false,
      "start": 1692464000000,
      "ttl": "60d",
      "widget_definition": {
        "requests": [
          {
            "q": "avg:system.cpu.user{*}"
          }
        ],
        "type": "timeseries"
      },
      "width": 300
    },
    "type": "create_snapshot"
  }
}
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/v2/snapshot" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "additional_config": {
        "template_variables": [
          {
            "name": "host",
            "prefix": "host",
            "values": [
              "web-server-1",
              "web-server-2"
            ]
          }
        ],
        "timeseries_legend_type": "expanded",
        "timezone_offset_minutes": 300
      },
      "end": 1692464800000,
      "height": 185,
      "is_authenticated": false,
      "start": 1692464000000,
      "ttl": "60d",
      "widget_definition": {
        "requests": [
          {
            "q": "avg:system.cpu.user{*}"
          }
        ],
        "type": "timeseries"
      },
      "width": 300
    },
    "type": "create_snapshot"
  }
}
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/v2/snapshot" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "additional_config": {
        "template_variables": [
          {
            "name": "host",
            "prefix": "host",
            "values": [
              "web-server-1",
              "web-server-2"
            ]
          }
        ],
        "timeseries_legend_type": "expanded",
        "timezone_offset_minutes": 300
      },
      "end": 1692464800000,
      "height": 185,
      "is_authenticated": false,
      "start": 1692464000000,
      "ttl": "60d",
      "widget_definition": {
        "requests": [
          {
            "q": "avg:system.cpu.user{*}"
          }
        ],
        "type": "timeseries"
      },
      "width": 300
    },
    "type": "create_snapshot"
  }
}
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/v2/snapshot" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "additional_config": {
        "template_variables": [
          {
            "name": "host",
            "prefix": "host",
            "values": [
              "web-server-1",
              "web-server-2"
            ]
          }
        ],
        "timeseries_legend_type": "expanded",
        "timezone_offset_minutes": 300
      },
      "end": 1692464800000,
      "height": 185,
      "is_authenticated": false,
      "start": 1692464000000,
      "ttl": "60d",
      "widget_definition": {
        "requests": [
          {
            "q": "avg:system.cpu.user{*}"
          }
        ],
        "type": "timeseries"
      },
      "width": 300
    },
    "type": "create_snapshot"
  }
}
EOF