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/fleet-automation/upgrade-hosts.md. A documentation index is available at /llms.txt.
Language
Datadog site

호스트 업그레이드

POSThttps://api.datadoghq.com/api/v2/fleet/deployments/upgradehttps://api.us3.datadoghq.com/api/v2/fleet/deployments/upgradehttps://api.us5.datadoghq.com/api/v2/fleet/deployments/upgradehttps://api.datadoghq.eu/api/v2/fleet/deployments/upgradehttps://api.ap1.datadoghq.com/api/v2/fleet/deployments/upgradehttps://api.ap2.datadoghq.com/api/v2/fleet/deployments/upgradehttps://api.uk1.datadoghq.com/api/v2/fleet/deployments/upgradehttps://api.ddog-gov.com/api/v2/fleet/deployments/upgradehttps://api.us2.ddog-gov.com/api/v2/fleet/deployments/upgrade

개요

지정된 필터 쿼리와 일치하는 호스트에서 새 패키지 업그레이드를 생성하고 즉시 시작합니다.

이 엔드포인트를 사용하면 지정된 필터 쿼리와 일치하는 호스트에서 Datadog Agent를 특정 버전으로 업그레이드할 수 있습니다.

배포가 자동으로 생성되고 시작됩니다. 시스템:

  1. 필터 쿼리와 일치하는 모든 호스트를 식별합니다.
  2. 지정된 버전을 사용할 수 있는지 확인합니다.
  3. 대상 호스트에 패키지 업그레이드 배포를 시작합니다.

filter_query 또는 target_packages가 누락되었거나, 대상 패키지에 이름이나 버전이 없거나, 필터 쿼리가 업그레이드 가능한 호스트와 일치하지 않는 경우 400을 반환합니다. 하나 이상의 대상 호스트에서 충돌하는 업그레이드가 이미 실행 중인 경우 409를 반환합니다.

This endpoint requires all of the following permissions:

  • agent_upgrade_write
  • fleet_policies_write

요청

Body Data (required)

패키지 업그레이드 세부 정보가 포함된 요청 페이로드입니다.

항목
유형
설명
data [required]
object

새 v2 패키지 업그레이드 배포를 생성하기 위한 요청 페이로드입니다.

응답

CREATED

Response containing the newly created deployment.

항목
유형
설명
data [required]
object

A deployment in the v2 API 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/fleet/deployments/upgrade" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter_query": "env:prod AND service:web",
      "target_packages": [
        {
          "name": "datadog-agent",
          "version": "7.52.0"
        }
      ]
    },
    "type": "deployment"
  }
}
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/fleet/deployments/upgrade" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter_query": "env:prod AND service:web",
      "target_packages": [
        {
          "name": "datadog-agent",
          "version": "7.52.0"
        }
      ]
    },
    "type": "deployment"
  }
}
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/fleet/deployments/upgrade" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter_query": "env:prod AND service:web",
      "target_packages": [
        {
          "name": "datadog-agent",
          "version": "7.52.0"
        }
      ]
    },
    "type": "deployment"
  }
}
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/fleet/deployments/upgrade" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter_query": "env:prod AND service:web",
      "target_packages": [
        {
          "name": "datadog-agent",
          "version": "7.52.0"
        }
      ]
    },
    "type": "deployment"
  }
}
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/fleet/deployments/upgrade" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter_query": "env:prod AND service:web",
      "target_packages": [
        {
          "name": "datadog-agent",
          "version": "7.52.0"
        }
      ]
    },
    "type": "deployment"
  }
}
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/fleet/deployments/upgrade" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter_query": "env:prod AND service:web",
      "target_packages": [
        {
          "name": "datadog-agent",
          "version": "7.52.0"
        }
      ]
    },
    "type": "deployment"
  }
}
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/fleet/deployments/upgrade" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter_query": "env:prod AND service:web",
      "target_packages": [
        {
          "name": "datadog-agent",
          "version": "7.52.0"
        }
      ]
    },
    "type": "deployment"
  }
}
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/fleet/deployments/upgrade" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter_query": "env:prod AND service:web",
      "target_packages": [
        {
          "name": "datadog-agent",
          "version": "7.52.0"
        }
      ]
    },
    "type": "deployment"
  }
}
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/fleet/deployments/upgrade" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter_query": "env:prod AND service:web",
      "target_packages": [
        {
          "name": "datadog-agent",
          "version": "7.52.0"
        }
      ]
    },
    "type": "deployment"
  }
}
EOF