For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/ko/api/latest/fleet-automation/create-a-configuration-deployment.md. A documentation index is available at /llms.txt.
Language
Datadog site

설정 및 배포 만들기

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

개요

새 배포를 생성하여 구성 변경 사항을 지정된 필터 쿼리와 일치하는 호스트 플릿에 적용합니다.

이 엔드포인트는 두 가지 유형의 다음 구성 작업을 지원합니다.

  • merge-patch: 제공된 패치 데이터를 기존 구성 파일과 병합하고 파일이 없는 경우 파일을 생성합니다.
  • delete: 대상 호스트에서 지정된 구성 파일을 제거합니다.

target_packages를 필요시 사용하여 특정 패키지 버전에만 구성 변경 사항을 적용할 수 있습니다.

배포가 자동으로 생성되고 시작됩니다. 여러 구성 작업을 지정하여 각 대상 호스트에서 순서대로 실행할 수 있습니다. 필터 쿼리를 사용하여 Datadog 쿼리 구문으로 특정 호스트를 대상으로 지정합니다.

dry_run을 true로 설정하여 구성을 검증하고 아무것도 배포하지 않은 상태에서 대상 호스트 및 패키지를 확인합니다. 드라이 런은 배포를 생성하고 시작하는 대신 검증 결과와 함께 200을 반환합니다.

filter_query 또는 config_operations가 누락되었거나, 대상 패키지에 이름이나 버전이 없거나 확인할 수 없거나, 구성 검증에 실패하거나, 필터 쿼리가 배포 대상 호스트와 일치하지 않는 경우 400을 반환합니다.

This endpoint requires all of the following permissions:

  • agent_upgrade_write
  • fleet_policies_write

요청

Body Data (required)

배포 세부 정보가 포함된 요청 페이로드입니다.

항목
유형
설명
data [required]
object

새 v2 구성 배포를 생성하기 위한 요청 페이로드입니다.

응답

OK

Response containing the result of a configuration deployment dry run.

항목
유형
설명
data [required]
object

The result of a configuration deployment dry run.

코드 예시

설정 및 배포 만들기
## default

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "apm_config": {
              "enabled": true
            },
            "log_level": "info",
            "logs_enabled": true
          }
        }
      ],
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF

## Dry run

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "log_level": "info"
          }
        }
      ],
      "dry_run": true,
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF
## default

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "apm_config": {
              "enabled": true
            },
            "log_level": "info",
            "logs_enabled": true
          }
        }
      ],
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF

## Dry run

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "log_level": "info"
          }
        }
      ],
      "dry_run": true,
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF
## default

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "apm_config": {
              "enabled": true
            },
            "log_level": "info",
            "logs_enabled": true
          }
        }
      ],
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF

## Dry run

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "log_level": "info"
          }
        }
      ],
      "dry_run": true,
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF
## default

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "apm_config": {
              "enabled": true
            },
            "log_level": "info",
            "logs_enabled": true
          }
        }
      ],
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF

## Dry run

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "log_level": "info"
          }
        }
      ],
      "dry_run": true,
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF
## default

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "apm_config": {
              "enabled": true
            },
            "log_level": "info",
            "logs_enabled": true
          }
        }
      ],
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF

## Dry run

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "log_level": "info"
          }
        }
      ],
      "dry_run": true,
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF
## default

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "apm_config": {
              "enabled": true
            },
            "log_level": "info",
            "logs_enabled": true
          }
        }
      ],
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF

## Dry run

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "log_level": "info"
          }
        }
      ],
      "dry_run": true,
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF
## default

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "apm_config": {
              "enabled": true
            },
            "log_level": "info",
            "logs_enabled": true
          }
        }
      ],
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF

## Dry run

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "log_level": "info"
          }
        }
      ],
      "dry_run": true,
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF
## default

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "apm_config": {
              "enabled": true
            },
            "log_level": "info",
            "logs_enabled": true
          }
        }
      ],
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF

## Dry run

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "log_level": "info"
          }
        }
      ],
      "dry_run": true,
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF
## default

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "apm_config": {
              "enabled": true
            },
            "log_level": "info",
            "logs_enabled": true
          }
        }
      ],
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF

## Dry run

# 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/configure" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "log_level": "info"
          }
        }
      ],
      "dry_run": true,
      "filter_query": "env:prod AND datacenter:us-east-1"
    },
    "type": "deployment"
  }
}
EOF