restriction_queries
Creates, updates, deletes, gets or lists a restriction_queries resource.
Overview
| Name | restriction_queries |
| Type | Resource |
| Id | datadog.logs.restriction_queries |
Fields
The following fields are returned by SELECT queries:
- get_restriction_query
- list_restriction_queries
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the restriction query. (example: 79a0e60a-644a-11ea-ad29-43329f7f58b5) |
attributes | object | Attributes of the restriction query. |
relationships | object | Relationships of the user object. |
type | string | Restriction query resource type. (logs_restriction_queries) (default: logs_restriction_queries, example: logs_restriction_queries) |
| 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) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_restriction_query | select | restriction_query_id | Get a restriction query in the organization specified by the restriction query's restriction_query_id. | |
list_restriction_queries | select | page[size], page[number] | Returns all restriction queries, including their names and IDs. | |
create_restriction_query | insert | Create a new restriction query for your organization. | ||
update_restriction_query | update | restriction_query_id | Edit a restriction query. | |
replace_restriction_query | replace | restriction_query_id | Replace a restriction query. | |
delete_restriction_query | delete | restriction_query_id | Deletes 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. |
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_restriction_query
- list_restriction_queries
Get a restriction query in the organization specified by the restriction query's restriction_query_id.
SELECT
id,
attributes,
relationships,
type
FROM datadog.logs.restriction_queries
WHERE restriction_query_id = '{{ restriction_query_id }}' -- required
;
Returns all restriction queries, including their names and IDs.
SELECT
id,
attributes,
type
FROM datadog.logs.restriction_queries
WHERE page[size] = '{{ page[size] }}'
AND page[number] = '{{ page[number] }}'
;
INSERT examples
- create_restriction_query
- Manifest
Create a new restriction query for your organization.
INSERT INTO datadog.logs.restriction_queries (
data
)
SELECT
'{{ data }}'
RETURNING
data
;
# Description fields are for documentation purposes
- name: restriction_queries
props:
- name: data
description: |
Data related to the creation of a restriction query.
value:
attributes:
restriction_query: "{{ restriction_query }}"
type: "{{ type }}"
UPDATE examples
- update_restriction_query
Edit a restriction query.
UPDATE datadog.logs.restriction_queries
SET
data = '{{ data }}'
WHERE
restriction_query_id = '{{ restriction_query_id }}' --required
RETURNING
data;
REPLACE examples
- replace_restriction_query
Replace a restriction query.
REPLACE datadog.logs.restriction_queries
SET
data = '{{ data }}'
WHERE
restriction_query_id = '{{ restriction_query_id }}' --required
RETURNING
data;
DELETE examples
- delete_restriction_query
Deletes a restriction query.
DELETE FROM datadog.logs.restriction_queries
WHERE restriction_query_id = '{{ restriction_query_id }}' --required
;