Skip to main content

restriction_query_roles

Creates, updates, deletes, gets or lists a restriction_query_roles resource.

Overview

Namerestriction_query_roles
TypeResource
Iddatadog.logs.restriction_query_roles

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the restriction query. (example: 79a0e60a-644a-11ea-ad29-43329f7f58b5)
attributesobjectAttributes of the restriction query.
typestringRestriction queries type. (default: logs_restriction_queries, example: logs_restriction_queries)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_role_restriction_queryselectrole_idGet restriction query for a given role.
list_restriction_query_rolesselectrestriction_query_idpage[size], page[number]Returns all roles that have a given restriction query.
add_role_to_restriction_queryinsertrestriction_query_idAdds a role to a restriction query.<br /><br />Note: This operation automatically grants the logs_read_data permission to the role if it doesn't already have it.
remove_role_from_restriction_querydeleterestriction_query_idRemoves a role from a restriction query.

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
restriction_query_idstringThe ID of the restriction query.
role_idstringThe ID of the role.
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.
page[number]integer (int64)Specific page number to return.
page[size]integer (int64)Number of items to return per page. The maximum allowed value is 100.

SELECT examples

Get restriction query for a given role.

SELECT
id,
attributes,
type
FROM datadog.logs.restriction_query_roles
WHERE role_id = '{{ role_id }}' -- required
;

INSERT examples

Adds a role to a restriction query.<br /><br />Note: This operation automatically grants the logs_read_data permission to the role if it doesn't already have it.

INSERT INTO datadog.logs.restriction_query_roles (
data,
restriction_query_id
)
SELECT
'{{ data }}',
'{{ restriction_query_id }}'
;

DELETE examples

Removes a role from a restriction query.

DELETE FROM datadog.logs.restriction_query_roles
WHERE restriction_query_id = '{{ restriction_query_id }}' --required
;