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/create-a-synthetics-downtime.md. A documentation index is available at /llms.txt.
Language
Datadog site

Create a Synthetics downtime

POSThttps://api.datadoghq.com/api/v2/synthetics/downtimeshttps://api.us3.datadoghq.com/api/v2/synthetics/downtimeshttps://api.us5.datadoghq.com/api/v2/synthetics/downtimeshttps://api.datadoghq.eu/api/v2/synthetics/downtimeshttps://api.ap1.datadoghq.com/api/v2/synthetics/downtimeshttps://api.ap2.datadoghq.com/api/v2/synthetics/downtimeshttps://api.uk1.datadoghq.com/api/v2/synthetics/downtimeshttps://api.ddog-gov.com/api/v2/synthetics/downtimeshttps://api.us2.ddog-gov.com/api/v2/synthetics/downtimes

概要

Create a new Synthetics downtime.

This endpoint requires all of the following permissions:

  • synthetics_write
  • synthetics_default_settings_write

リクエスト

Body Data (required)

フィールド
タイプ
説明
data [required]
object

The data object for a Synthetics downtime create or update request.

応答

Created

Response containing a single Synthetics downtime.

フィールド
タイプ
説明
data [required]
object

A Synthetics downtime object.

コード例

# 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/synthetics/downtimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "isEnabled": true,
      "name": "Weekly maintenance",
      "testIds": [
        "abc-def-123"
      ],
      "timeSlots": [
        {
          "duration": 3600,
          "start": {
            "day": 15,
            "hour": 10,
            "minute": 30,
            "month": 1,
            "year": 2024
          },
          "timezone": "Europe/Paris"
        }
      ]
    },
    "type": "downtime"
  }
}
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/synthetics/downtimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "isEnabled": true,
      "name": "Weekly maintenance",
      "testIds": [
        "abc-def-123"
      ],
      "timeSlots": [
        {
          "duration": 3600,
          "start": {
            "day": 15,
            "hour": 10,
            "minute": 30,
            "month": 1,
            "year": 2024
          },
          "timezone": "Europe/Paris"
        }
      ]
    },
    "type": "downtime"
  }
}
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/synthetics/downtimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "isEnabled": true,
      "name": "Weekly maintenance",
      "testIds": [
        "abc-def-123"
      ],
      "timeSlots": [
        {
          "duration": 3600,
          "start": {
            "day": 15,
            "hour": 10,
            "minute": 30,
            "month": 1,
            "year": 2024
          },
          "timezone": "Europe/Paris"
        }
      ]
    },
    "type": "downtime"
  }
}
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/synthetics/downtimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "isEnabled": true,
      "name": "Weekly maintenance",
      "testIds": [
        "abc-def-123"
      ],
      "timeSlots": [
        {
          "duration": 3600,
          "start": {
            "day": 15,
            "hour": 10,
            "minute": 30,
            "month": 1,
            "year": 2024
          },
          "timezone": "Europe/Paris"
        }
      ]
    },
    "type": "downtime"
  }
}
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/synthetics/downtimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "isEnabled": true,
      "name": "Weekly maintenance",
      "testIds": [
        "abc-def-123"
      ],
      "timeSlots": [
        {
          "duration": 3600,
          "start": {
            "day": 15,
            "hour": 10,
            "minute": 30,
            "month": 1,
            "year": 2024
          },
          "timezone": "Europe/Paris"
        }
      ]
    },
    "type": "downtime"
  }
}
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/synthetics/downtimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "isEnabled": true,
      "name": "Weekly maintenance",
      "testIds": [
        "abc-def-123"
      ],
      "timeSlots": [
        {
          "duration": 3600,
          "start": {
            "day": 15,
            "hour": 10,
            "minute": 30,
            "month": 1,
            "year": 2024
          },
          "timezone": "Europe/Paris"
        }
      ]
    },
    "type": "downtime"
  }
}
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/synthetics/downtimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "isEnabled": true,
      "name": "Weekly maintenance",
      "testIds": [
        "abc-def-123"
      ],
      "timeSlots": [
        {
          "duration": 3600,
          "start": {
            "day": 15,
            "hour": 10,
            "minute": 30,
            "month": 1,
            "year": 2024
          },
          "timezone": "Europe/Paris"
        }
      ]
    },
    "type": "downtime"
  }
}
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/synthetics/downtimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "isEnabled": true,
      "name": "Weekly maintenance",
      "testIds": [
        "abc-def-123"
      ],
      "timeSlots": [
        {
          "duration": 3600,
          "start": {
            "day": 15,
            "hour": 10,
            "minute": 30,
            "month": 1,
            "year": 2024
          },
          "timezone": "Europe/Paris"
        }
      ]
    },
    "type": "downtime"
  }
}
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/synthetics/downtimes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "isEnabled": true,
      "name": "Weekly maintenance",
      "testIds": [
        "abc-def-123"
      ],
      "timeSlots": [
        {
          "duration": 3600,
          "start": {
            "day": 15,
            "hour": 10,
            "minute": 30,
            "month": 1,
            "year": 2024
          },
          "timezone": "Europe/Paris"
        }
      ]
    },
    "type": "downtime"
  }
}
EOF