Skip to main content

execution_policies

Creates, updates, deletes, gets or lists an execution_policies resource.

Overview

Nameexecution_policies
TypeResource
Iddatadog.actions.execution_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the execution policy. (example: 3fa85f64-5717-4562-b3fc-2c963f66afa6)
attributesobjectAn execution policy.
typestringThe type of the resource. The value should always be execution_policy. (execution_policy) (default: execution_policy, example: execution_policy)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_execution_policyselectpolicy_idRetrieve an existing execution policy by ID.
list_execution_policiesselectpage[size], page[number], filter[name], filter[ids], filter[integration], filter[effects], filter[creator_ids], sortRetrieve a list of execution policies for the current organization.
create_execution_policyinsertdataCreate a new execution policy.
update_execution_policyreplacepolicy_id, dataUpdate an existing execution policy.<br />Returns the execution policy object when the request is successful.
delete_execution_policydeletepolicy_idDelete a specific execution policy.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
policy_idstringThe ID of the execution policy. (example: 3fa85f64-5717-4562-b3fc-2c963f66afa6)
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
filter[creator_ids]arrayFilter execution policies by a list of creator IDs. (example: [3fa85f64-5717-4562-b3fc-2c963f66afa6])
filter[effects]arrayFilter execution policies by a list of effects. (example: [allow])
filter[ids]arrayFilter execution policies by a list of IDs. (example: [3fa85f64-5717-4562-b3fc-2c963f66afa6])
filter[integration]arrayFilter execution policies by a list of integrations. (example: [INTEGRATION_SCRIPT])
filter[name]stringFilter execution policies by name. (example: Block prod restarts)
page[number]integer (int32)The page number to return. (example: 0)
page[size]integer (int32)The number of execution policies to return per page. (example: 100)
sortarrayThe sort order for the results. Prefix a field with - to sort in descending order. Valid fields are name, effect, integration, created_at, and updated_at. (example: [-created_at])

SELECT examples

Retrieve an existing execution policy by ID.

SELECT
id,
attributes,
type
FROM datadog.actions.execution_policies
WHERE policy_id = '{{ policy_id }}' -- required
;

INSERT examples

Create a new execution policy.

INSERT INTO datadog.actions.execution_policies (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;

REPLACE examples

Update an existing execution policy.<br />Returns the execution policy object when the request is successful.

REPLACE datadog.actions.execution_policies
SET
data = '{{ data }}'
WHERE
policy_id = '{{ policy_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Delete a specific execution policy.

DELETE FROM datadog.actions.execution_policies
WHERE policy_id = '{{ policy_id }}' --required
;