restriction_query_roles
Creates, updates, deletes, gets or lists a restriction_query_roles resource.
Overview
| Name | restriction_query_roles |
| Type | Resource |
| Id | datadog.logs.restriction_query_roles |
Fields
The following fields are returned by SELECT queries:
- get_role_restriction_query
- list_restriction_query_roles
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the restriction query. (example: 79a0e60a-644a-11ea-ad29-43329f7f58b5) |
attributes | object | Attributes of the restriction query. |
type | string | Restriction queries type. (default: logs_restriction_queries, example: logs_restriction_queries) |
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the role. (example: <ROLE_ID>) |
attributes | object | Attributes of the role for a restriction query. |
type | string | Roles type. (roles) (default: roles, example: roles) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_role_restriction_query | select | role_id | Get restriction query for a given role. | |
list_restriction_query_roles | select | restriction_query_id | page[size], page[number] | Returns all roles that have a given restriction query. |
add_role_to_restriction_query | insert | restriction_query_id | 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. | |
remove_role_from_restriction_query | delete | restriction_query_id | Removes 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.
| Name | Datatype | Description |
|---|---|---|
restriction_query_id | string | The ID of the restriction query. |
role_id | string | The ID of the role. |
site | string | The 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_role_restriction_query
- list_restriction_query_roles
Get restriction query for a given role.
SELECT
id,
attributes,
type
FROM datadog.logs.restriction_query_roles
WHERE role_id = '{{ role_id }}' -- required
;
Returns all roles that have a given restriction query.
SELECT
id,
attributes,
type
FROM datadog.logs.restriction_query_roles
WHERE restriction_query_id = '{{ restriction_query_id }}' -- required
AND page[size] = '{{ page[size] }}'
AND page[number] = '{{ page[number] }}'
;
INSERT examples
- add_role_to_restriction_query
- Manifest
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 }}'
;
# Description fields are for documentation purposes
- name: restriction_query_roles
props:
- name: restriction_query_id
value: "{{ restriction_query_id }}"
description: Required parameter for the restriction_query_roles resource.
- name: data
description: |
Relationship to role object.
value:
id: "{{ id }}"
type: "{{ type }}"
DELETE examples
- remove_role_from_restriction_query
Removes a role from a restriction query.
DELETE FROM datadog.logs.restriction_query_roles
WHERE restriction_query_id = '{{ restriction_query_id }}' --required
;