Fleet Automation

Upgrade hosts

Create and immediately start a new package upgrade on hosts matching the specified filter query.

This endpoint allows you to upgrade the Datadog Agent to a specific version on hosts matching the specified filter query.

The deployment is created and started automatically. The system:

  1. Identifies all hosts matching the filter query.
  2. Validates that the specified version is available.
  3. Begins rolling out the package upgrade to the target hosts.

Returns a 400 if filter_query or target_packages is missing, a target package is missing a name or version, or the filter query does not match any host eligible for the upgrade. Returns a 409 if a conflicting upgrade is already running on one or more target hosts.

post/api/v2/fleet/deployments/upgrade

Request

Request body

Example request

{
  "data": {
    "attributes": {
      "filter_query": "env:prod AND service:web",
      "target_packages": [
        {
          "name": "datadog-agent",
          "version": "7.52.0"
        }
      ]
    },
    "type": "deployment"
  }
}

Response

CREATED

Example response

{
  "data": {
    "attributes": {
      "author": "alice@datadoghq.com",
      "config_operations": [
        {
          "file_op": "merge-patch",
          "file_path": "/datadog.yaml",
          "patch": {
            "apm_config": {
              "enabled": true
            },
            "log_level": "debug",
            "logs_enabled": true
          }
        }
      ],
      "duration_seconds": 1000,
      "error_summary": "A host failed to update",
      "estimated_finished_at": 1699999999,
      "is_scheduled": true,
      "query": "env:prod AND service:web",
      "schedule_id": "sched-123",
      "started_at": 1699990000,
      "status": "pending",
      "target_versions": [
        "7.52.0"
      ],
      "total_hosts": 42,
      "update_type": "update_config_operations"
    },
    "id": "k7Q-3mX-p9Z",
    "type": "deployment"
  }
}

Changes

Changes to this operation have not been checked yet.