For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/fr/api/latest/execution-policy/update-an-execution-policy.md. A documentation index is available at /llms.txt.
Language
Datadog site

Update an execution policy

WARNINGNote: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
PUThttps://api.datadoghq.com/api/v2/actions/execution-policies/{policy_id}https://api.us3.datadoghq.com/api/v2/actions/execution-policies/{policy_id}https://api.us5.datadoghq.com/api/v2/actions/execution-policies/{policy_id}https://api.datadoghq.eu/api/v2/actions/execution-policies/{policy_id}https://api.ap1.datadoghq.com/api/v2/actions/execution-policies/{policy_id}https://api.ap2.datadoghq.com/api/v2/actions/execution-policies/{policy_id}https://api.uk1.datadoghq.com/api/v2/actions/execution-policies/{policy_id}https://api.ddog-gov.com/api/v2/actions/execution-policies/{policy_id}https://api.us2.ddog-gov.com/api/v2/actions/execution-policies/{policy_id}

Présentation

Update an existing execution policy. Returns the execution policy object when the request is successful.

This endpoint requires the execution_groups_write permission.

Arguments

Paramètres du chemin

Name
Type
Description
policy_id [required]
string

The ID of the execution policy.

Requête

Body Data (required)

The new execution policy.

Champ
Type
Description
data [required]
object

Object for a single execution policy.

Réponse

OK

Response object that includes a single execution policy.

Champ
Type
Description
data [required]
object

Object for a single execution policy.

Exemple de code

# Path parameters
export policy_id="3fa85f64-5717-4562-b3fc-2c963f66afa6"

# 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/v2/actions/execution-policies/${policy_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "action_pattern": {
        "action_fqns": [
          "com.datadoghq.script.*"
        ],
        "integration": "INTEGRATION_SCRIPT"
      },
      "effect": "allow",
      "name": "Block prod restarts"
    },
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "type": "execution_policy"
  }
}
EOF
# Path parameters
export policy_id="3fa85f64-5717-4562-b3fc-2c963f66afa6"

# 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/v2/actions/execution-policies/${policy_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "action_pattern": {
        "action_fqns": [
          "com.datadoghq.script.*"
        ],
        "integration": "INTEGRATION_SCRIPT"
      },
      "effect": "allow",
      "name": "Block prod restarts"
    },
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "type": "execution_policy"
  }
}
EOF
# Path parameters
export policy_id="3fa85f64-5717-4562-b3fc-2c963f66afa6"

# 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/v2/actions/execution-policies/${policy_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "action_pattern": {
        "action_fqns": [
          "com.datadoghq.script.*"
        ],
        "integration": "INTEGRATION_SCRIPT"
      },
      "effect": "allow",
      "name": "Block prod restarts"
    },
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "type": "execution_policy"
  }
}
EOF
# Path parameters
export policy_id="3fa85f64-5717-4562-b3fc-2c963f66afa6"

# 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/v2/actions/execution-policies/${policy_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "action_pattern": {
        "action_fqns": [
          "com.datadoghq.script.*"
        ],
        "integration": "INTEGRATION_SCRIPT"
      },
      "effect": "allow",
      "name": "Block prod restarts"
    },
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "type": "execution_policy"
  }
}
EOF
# Path parameters
export policy_id="3fa85f64-5717-4562-b3fc-2c963f66afa6"

# 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/v2/actions/execution-policies/${policy_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "action_pattern": {
        "action_fqns": [
          "com.datadoghq.script.*"
        ],
        "integration": "INTEGRATION_SCRIPT"
      },
      "effect": "allow",
      "name": "Block prod restarts"
    },
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "type": "execution_policy"
  }
}
EOF
# Path parameters
export policy_id="3fa85f64-5717-4562-b3fc-2c963f66afa6"

# 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/v2/actions/execution-policies/${policy_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "action_pattern": {
        "action_fqns": [
          "com.datadoghq.script.*"
        ],
        "integration": "INTEGRATION_SCRIPT"
      },
      "effect": "allow",
      "name": "Block prod restarts"
    },
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "type": "execution_policy"
  }
}
EOF
# Path parameters
export policy_id="3fa85f64-5717-4562-b3fc-2c963f66afa6"

# 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/v2/actions/execution-policies/${policy_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "action_pattern": {
        "action_fqns": [
          "com.datadoghq.script.*"
        ],
        "integration": "INTEGRATION_SCRIPT"
      },
      "effect": "allow",
      "name": "Block prod restarts"
    },
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "type": "execution_policy"
  }
}
EOF
# Path parameters
export policy_id="3fa85f64-5717-4562-b3fc-2c963f66afa6"

# 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/v2/actions/execution-policies/${policy_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "action_pattern": {
        "action_fqns": [
          "com.datadoghq.script.*"
        ],
        "integration": "INTEGRATION_SCRIPT"
      },
      "effect": "allow",
      "name": "Block prod restarts"
    },
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "type": "execution_policy"
  }
}
EOF
# Path parameters
export policy_id="3fa85f64-5717-4562-b3fc-2c963f66afa6"

# 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/v2/actions/execution-policies/${policy_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "action_pattern": {
        "action_fqns": [
          "com.datadoghq.script.*"
        ],
        "integration": "INTEGRATION_SCRIPT"
      },
      "effect": "allow",
      "name": "Block prod restarts"
    },
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "type": "execution_policy"
  }
}
EOF