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/monitors/edit-a-monitor.md. A documentation index is available at /llms.txt.
Language
Datadog site

모니터 편집하기

PUThttps://api.datadoghq.com/api/v1/monitor/{monitor_id}https://api.us3.datadoghq.com/api/v1/monitor/{monitor_id}https://api.us5.datadoghq.com/api/v1/monitor/{monitor_id}https://api.datadoghq.eu/api/v1/monitor/{monitor_id}https://api.ap1.datadoghq.com/api/v1/monitor/{monitor_id}https://api.ap2.datadoghq.com/api/v1/monitor/{monitor_id}https://api.uk1.datadoghq.com/api/v1/monitor/{monitor_id}https://api.ddog-gov.com/api/v1/monitor/{monitor_id}https://api.us2.ddog-gov.com/api/v1/monitor/{monitor_id}

개요

지정된 모니터를 편집합니다.

This endpoint requires any of the following permissions:

  • monitors_write
  • monitors_draft_write

OAuth apps require one of the following authorization scopes to access this endpoint: monitors_write, monitors_draft_write.

인수

경로 파라미터

이름
유형
설명
monitor_id [required]
integer

The ID of the monitor.

요청

Body Data (required)

모니터 요청 본문을 편집합니다.

항목
유형
설명
assets
[object]

모니터 업데이트 요청을 설명하는 객체입니다.

draft_status
enum

Indicates whether the monitor is in a draft or published state.

draft: The monitor appears as Draft and does not send notifications. published: The monitor is active and evaluates conditions and notify as configured.

This field is in preview. The draft value is only available to customers with the feature enabled.

Default: published
Allowed enum values: draft, published
message
string

A message to include with notifications for this monitor.

name
string

The monitor name.

options
object

List of options associated with your monitor.

priority
int64

Integer from 1 (high) to 5 (low) indicating alert severity.

query
string

The monitor query.

restricted_roles
[string]

A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the Roles API and are located in the data.id field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the Restriction Policies API to manage write authorization for individual monitors by teams and users, in addition to roles.

tags
[string]

Tags associated to your monitor.

type
enum

The type of the monitor. For more information about type, see the monitor options docs.

Allowed enum values: composite, event alert, log alert, metric alert, process alert, query alert, rum alert, service check, synthetics alert, trace-analytics alert
Show 13 moreslo alert, event-v2 alert, audit alert, ci-pipelines alert, ci-tests alert, error-tracking alert, database-monitoring alert, network-performance alert, cost alert, data-quality alert, network-path alert, data-jobs alert, llm-observability alert

응답

OK

Object describing a monitor.

항목
유형
설명
assets
[object]

The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks).

created
date-time

Timestamp of the monitor creation.

creator
object

Object describing the creator of the shared element.

deleted
date-time

Whether or not the monitor is deleted. (Always null)

draft_status
enum

Indicates whether the monitor is in a draft or published state.

draft: The monitor appears as Draft and does not send notifications. published: The monitor is active and evaluates conditions and notify as configured.

This field is in preview. The draft value is only available to customers with the feature enabled.

Default: published
Allowed enum values: draft, published
id
int64

ID of this monitor.

matching_downtimes
[object]

A list of active v1 downtimes that match this monitor.

message
string

A message to include with notifications for this monitor.

modified
date-time

Last timestamp when the monitor was edited.

multi
boolean

Whether or not the monitor is broken down on different groups.

name
string

The monitor name.

options
object

List of options associated with your monitor.

overall_state
enum

The different states your monitor can be in.

Allowed enum values: Alert, Ignored, No Data, OK, Skipped, Unknown, Warn
priority
int64

Integer from 1 (high) to 5 (low) indicating alert severity.

query [required]
string

The monitor query.

restricted_roles
[string]

A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the Roles API and are located in the data.id field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the Restriction Policies API to manage write authorization for individual monitors by teams and users, in addition to roles.

state
object

Wrapper object with the different monitor states.

tags
[string]

Tags associated to your monitor.

type [required]
enum

The type of the monitor. For more information about type, see the monitor options docs.

Allowed enum values: composite, event alert, log alert, metric alert, process alert, query alert, rum alert, service check, synthetics alert, trace-analytics alert
Show 13 moreslo alert, event-v2 alert, audit alert, ci-pipelines alert, ci-tests alert, error-tracking alert, database-monitoring alert, network-performance alert, cost alert, data-quality alert, network-path alert, data-jobs alert, llm-observability alert

코드 예시

Edit a monitor returns "OK" response
# Path parameters
export monitor_id="666486743"

# 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 PUT "https://api.${DD_SITE}/api/v1/monitor/${monitor_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "My monitor-updated",
  "priority": null,
  "options": {
    "evaluation_delay": null,
    "new_group_delay": 600,
    "new_host_delay": null,
    "renotify_interval": null,
    "thresholds": {
      "critical": 2,
      "warning": null
    },
    "timeout_h": null
  }
}
EOF
# Path parameters
export monitor_id="666486743"

# 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 PUT "https://api.${DD_SITE}/api/v1/monitor/${monitor_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "My monitor-updated",
  "priority": null,
  "options": {
    "evaluation_delay": null,
    "new_group_delay": 600,
    "new_host_delay": null,
    "renotify_interval": null,
    "thresholds": {
      "critical": 2,
      "warning": null
    },
    "timeout_h": null
  }
}
EOF
# Path parameters
export monitor_id="666486743"

# 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 PUT "https://api.${DD_SITE}/api/v1/monitor/${monitor_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "My monitor-updated",
  "priority": null,
  "options": {
    "evaluation_delay": null,
    "new_group_delay": 600,
    "new_host_delay": null,
    "renotify_interval": null,
    "thresholds": {
      "critical": 2,
      "warning": null
    },
    "timeout_h": null
  }
}
EOF
# Path parameters
export monitor_id="666486743"

# 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 PUT "https://api.${DD_SITE}/api/v1/monitor/${monitor_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "My monitor-updated",
  "priority": null,
  "options": {
    "evaluation_delay": null,
    "new_group_delay": 600,
    "new_host_delay": null,
    "renotify_interval": null,
    "thresholds": {
      "critical": 2,
      "warning": null
    },
    "timeout_h": null
  }
}
EOF
# Path parameters
export monitor_id="666486743"

# 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 PUT "https://api.${DD_SITE}/api/v1/monitor/${monitor_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "My monitor-updated",
  "priority": null,
  "options": {
    "evaluation_delay": null,
    "new_group_delay": 600,
    "new_host_delay": null,
    "renotify_interval": null,
    "thresholds": {
      "critical": 2,
      "warning": null
    },
    "timeout_h": null
  }
}
EOF
# Path parameters
export monitor_id="666486743"

# 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 PUT "https://api.${DD_SITE}/api/v1/monitor/${monitor_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "My monitor-updated",
  "priority": null,
  "options": {
    "evaluation_delay": null,
    "new_group_delay": 600,
    "new_host_delay": null,
    "renotify_interval": null,
    "thresholds": {
      "critical": 2,
      "warning": null
    },
    "timeout_h": null
  }
}
EOF
# Path parameters
export monitor_id="666486743"

# 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 PUT "https://api.${DD_SITE}/api/v1/monitor/${monitor_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "My monitor-updated",
  "priority": null,
  "options": {
    "evaluation_delay": null,
    "new_group_delay": 600,
    "new_host_delay": null,
    "renotify_interval": null,
    "thresholds": {
      "critical": 2,
      "warning": null
    },
    "timeout_h": null
  }
}
EOF
# Path parameters
export monitor_id="666486743"

# 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 PUT "https://api.${DD_SITE}/api/v1/monitor/${monitor_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "My monitor-updated",
  "priority": null,
  "options": {
    "evaluation_delay": null,
    "new_group_delay": 600,
    "new_host_delay": null,
    "renotify_interval": null,
    "thresholds": {
      "critical": 2,
      "warning": null
    },
    "timeout_h": null
  }
}
EOF
# Path parameters
export monitor_id="666486743"

# 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 PUT "https://api.${DD_SITE}/api/v1/monitor/${monitor_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "My monitor-updated",
  "priority": null,
  "options": {
    "evaluation_delay": null,
    "new_group_delay": 600,
    "new_host_delay": null,
    "renotify_interval": null,
    "thresholds": {
      "critical": 2,
      "warning": null
    },
    "timeout_h": null
  }
}
EOF