For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/ja/api/latest/synthetics/fetch-uptime-for-multiple-tests.md. A documentation index is available at /llms.txt.
Language
Datadog site

複数のテストの稼働時間を取得する

POSThttps://api.datadoghq.com/api/v1/synthetics/tests/uptimeshttps://api.us3.datadoghq.com/api/v1/synthetics/tests/uptimeshttps://api.us5.datadoghq.com/api/v1/synthetics/tests/uptimeshttps://api.datadoghq.eu/api/v1/synthetics/tests/uptimeshttps://api.ap1.datadoghq.com/api/v1/synthetics/tests/uptimeshttps://api.ap2.datadoghq.com/api/v1/synthetics/tests/uptimeshttps://api.uk1.datadoghq.com/api/v1/synthetics/tests/uptimeshttps://api.ddog-gov.com/api/v1/synthetics/tests/uptimeshttps://api.us2.ddog-gov.com/api/v1/synthetics/tests/uptimes

概要

ID で複数の Synthetic テストの稼働時間を取得します。

This endpoint requires the synthetics_read permission.

OAuth apps require the synthetics_read authorization scope to access this endpoint.

リクエスト

Body Data (required)

Synthetic テストのパブリック ID リストと期間。

フィールド
タイプ
説明
from_ts [required]
int64

Synthetic テストの ID と期間を含むオブジェクト。

public_ids [required]
[string]

An array of Synthetic test IDs you want uptimes for.

to_ts [required]
int64

Timestamp in seconds (Unix epoch) for the end of uptime.

応答

OK.

フィールド
タイプ
説明
from_ts
int64

Timestamp in seconds for the start of uptime.

overall
object

Object containing the uptime information.

public_id
string

A Synthetic test ID.

to_ts
int64

Timestamp in seconds for the end of uptime.

コード例

# 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/synthetics/tests/uptimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "from_ts": 1726041488,
  "public_ids": [
    "abc-def-123"
  ],
  "to_ts": 1726127888
}
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/synthetics/tests/uptimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "from_ts": 1726041488,
  "public_ids": [
    "abc-def-123"
  ],
  "to_ts": 1726127888
}
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/synthetics/tests/uptimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "from_ts": 1726041488,
  "public_ids": [
    "abc-def-123"
  ],
  "to_ts": 1726127888
}
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/synthetics/tests/uptimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "from_ts": 1726041488,
  "public_ids": [
    "abc-def-123"
  ],
  "to_ts": 1726127888
}
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/synthetics/tests/uptimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "from_ts": 1726041488,
  "public_ids": [
    "abc-def-123"
  ],
  "to_ts": 1726127888
}
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/synthetics/tests/uptimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "from_ts": 1726041488,
  "public_ids": [
    "abc-def-123"
  ],
  "to_ts": 1726127888
}
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/synthetics/tests/uptimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "from_ts": 1726041488,
  "public_ids": [
    "abc-def-123"
  ],
  "to_ts": 1726127888
}
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/synthetics/tests/uptimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "from_ts": 1726041488,
  "public_ids": [
    "abc-def-123"
  ],
  "to_ts": 1726127888
}
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/synthetics/tests/uptimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "from_ts": 1726041488,
  "public_ids": [
    "abc-def-123"
  ],
  "to_ts": 1726127888
}
EOF